Skip to content

Commit

Permalink
crypto: user - remove redundant reporting functions
Browse files Browse the repository at this point in the history
The acomp, akcipher, and kpp algorithm types already have .report
methods defined, so there's no need to duplicate this functionality in
crypto_user itself; the duplicate functions are actually never executed.
Remove the unused code.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
ebiggers authored and herbertx committed Nov 9, 2018
1 parent fc6176a commit ed848b6
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions crypto/crypto_user_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,51 +113,6 @@ static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg)
return -EMSGSIZE;
}

static int crypto_report_acomp(struct sk_buff *skb, struct crypto_alg *alg)
{
struct crypto_report_acomp racomp;

strncpy(racomp.type, "acomp", sizeof(racomp.type));

if (nla_put(skb, CRYPTOCFGA_REPORT_ACOMP,
sizeof(struct crypto_report_acomp), &racomp))
goto nla_put_failure;
return 0;

nla_put_failure:
return -EMSGSIZE;
}

static int crypto_report_akcipher(struct sk_buff *skb, struct crypto_alg *alg)
{
struct crypto_report_akcipher rakcipher;

strncpy(rakcipher.type, "akcipher", sizeof(rakcipher.type));

if (nla_put(skb, CRYPTOCFGA_REPORT_AKCIPHER,
sizeof(struct crypto_report_akcipher), &rakcipher))
goto nla_put_failure;
return 0;

nla_put_failure:
return -EMSGSIZE;
}

static int crypto_report_kpp(struct sk_buff *skb, struct crypto_alg *alg)
{
struct crypto_report_kpp rkpp;

strncpy(rkpp.type, "kpp", sizeof(rkpp.type));

if (nla_put(skb, CRYPTOCFGA_REPORT_KPP,
sizeof(struct crypto_report_kpp), &rkpp))
goto nla_put_failure;
return 0;

nla_put_failure:
return -EMSGSIZE;
}

static int crypto_report_one(struct crypto_alg *alg,
struct crypto_user_alg *ualg, struct sk_buff *skb)
{
Expand Down Expand Up @@ -202,20 +157,6 @@ static int crypto_report_one(struct crypto_alg *alg,
goto nla_put_failure;

break;
case CRYPTO_ALG_TYPE_ACOMPRESS:
if (crypto_report_acomp(skb, alg))
goto nla_put_failure;

break;
case CRYPTO_ALG_TYPE_AKCIPHER:
if (crypto_report_akcipher(skb, alg))
goto nla_put_failure;

break;
case CRYPTO_ALG_TYPE_KPP:
if (crypto_report_kpp(skb, alg))
goto nla_put_failure;
break;
}

out:
Expand Down

0 comments on commit ed848b6

Please sign in to comment.