Skip to content

Commit

Permalink
crypto: user - remove unused dump functions
Browse files Browse the repository at this point in the history
This patch removes unused dump functions for crypto_user_stats.
There are remains of the copy/paste of crypto_user_base to
crypto_user_stat and I forgot to remove them.

Signed-off-by: Corentin Labbe <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
montjoie authored and herbertx committed Dec 23, 2018
1 parent f31ba0f commit 0c99c2a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 48 deletions.
4 changes: 1 addition & 3 deletions crypto/crypto_user_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,7 @@ static const struct crypto_link {
.dump = crypto_dump_report,
.done = crypto_dump_report_done},
[CRYPTO_MSG_DELRNG - CRYPTO_MSG_BASE] = { .doit = crypto_del_rng },
[CRYPTO_MSG_GETSTAT - CRYPTO_MSG_BASE] = { .doit = crypto_reportstat,
.dump = crypto_dump_reportstat,
.done = crypto_dump_reportstat_done},
[CRYPTO_MSG_GETSTAT - CRYPTO_MSG_BASE] = { .doit = crypto_reportstat},
};

static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
Expand Down
33 changes: 0 additions & 33 deletions crypto/crypto_user_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,37 +336,4 @@ int crypto_reportstat(struct sk_buff *in_skb, struct nlmsghdr *in_nlh,
return nlmsg_unicast(crypto_nlsk, skb, NETLINK_CB(in_skb).portid);
}

int crypto_dump_reportstat(struct sk_buff *skb, struct netlink_callback *cb)
{
struct crypto_alg *alg;
struct crypto_dump_info info;
int err;

if (cb->args[0])
goto out;

cb->args[0] = 1;

info.in_skb = cb->skb;
info.out_skb = skb;
info.nlmsg_seq = cb->nlh->nlmsg_seq;
info.nlmsg_flags = NLM_F_MULTI;

list_for_each_entry(alg, &crypto_alg_list, cra_list) {
err = crypto_reportstat_alg(alg, &info);
if (err)
goto out_err;
}

out:
return skb->len;
out_err:
return err;
}

int crypto_dump_reportstat_done(struct netlink_callback *cb)
{
return 0;
}

MODULE_LICENSE("GPL");
12 changes: 0 additions & 12 deletions include/crypto/internal/cryptouser.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,10 @@
struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact);

#ifdef CONFIG_CRYPTO_STATS
int crypto_dump_reportstat(struct sk_buff *skb, struct netlink_callback *cb);
int crypto_reportstat(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, struct nlattr **attrs);
int crypto_dump_reportstat_done(struct netlink_callback *cb);
#else
static int crypto_dump_reportstat(struct sk_buff *skb, struct netlink_callback *cb)
{
return -ENOTSUPP;
}

static int crypto_reportstat(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, struct nlattr **attrs)
{
return -ENOTSUPP;
}

static int crypto_dump_reportstat_done(struct netlink_callback *cb)
{
return -ENOTSUPP;
}
#endif

0 comments on commit 0c99c2a

Please sign in to comment.