Skip to contentSkip to conversation

crypto: user - constify netlink dispatch table

PATCH In review Mathias Krause 2 participants 2 messages Feb 24, 2013 – Mar 10, 2013 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: user - constify netlink dispatch table

There is no need to modify the netlink dispatch table at runtime and making it const even makes the resulting object file slightly smaller.

Cc Steffen Klassert <[email protected]>
---
 crypto/crypto_user.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/crypto_user.c +2 -2
index 35d700a..77f6c4e 100644
@@ -426,7 +426,7 @@ static const struct nla_policy crypto_policy[CRYPTOCFGA_MAX+1] = {
 
 #undef MSGSIZE
 
-static struct crypto_link {
+static const struct crypto_link {
 	int (*doit)(struct sk_buff *, struct nlmsghdr *, struct nlattr **);
 	int (*dump)(struct sk_buff *, struct netlink_callback *);
 	int (*done)(struct netlink_callback *);
@@ -442,7 +442,7 @@ static struct crypto_link {
 static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 {
 	struct nlattr *attrs[CRYPTOCFGA_MAX+1];
-	struct crypto_link *link;
+	const struct crypto_link *link;
 	int type, err;
 
 	type = nlh->nlmsg_type;
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw
Quoted 5 lines · Mathias Krause

There is no need to modify the netlink dispatch table at runtime and making it const even makes the resulting object file slightly smaller.

Cc Steffen Klassert <[email protected]>

Patch applied. Thanks Mathias!

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt