From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Steffen Klassert <steffen.klassert@secunet.com>,
netdev@vger.kernel.org
Subject: [PATCH 2/6] af_key: constify lookup tables
Date: Thu, 22 Aug 2013 13:12:06 +0200 [thread overview]
Message-ID: <1377169931-7302-3-git-send-email-steffen.klassert@secunet.com> (raw)
In-Reply-To: <1377169931-7302-1-git-send-email-steffen.klassert@secunet.com>
From: Mathias Krause <minipli@googlemail.com>
The lookup tables for minimum sizes of extensions and for the pfkey
handler functions are read only, therefore can be const.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/key/af_key.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 4089a21..d49f676 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -338,7 +338,7 @@ static int pfkey_error(const struct sadb_msg *orig, int err, struct sock *sk)
return 0;
}
-static u8 sadb_ext_min_len[] = {
+static const u8 sadb_ext_min_len[] = {
[SADB_EXT_RESERVED] = (u8) 0,
[SADB_EXT_SA] = (u8) sizeof(struct sadb_sa),
[SADB_EXT_LIFETIME_CURRENT] = (u8) sizeof(struct sadb_lifetime),
@@ -2737,7 +2737,7 @@ static int pfkey_spdflush(struct sock *sk, struct sk_buff *skb, const struct sad
typedef int (*pfkey_handler)(struct sock *sk, struct sk_buff *skb,
const struct sadb_msg *hdr, void * const *ext_hdrs);
-static pfkey_handler pfkey_funcs[SADB_MAX + 1] = {
+static const pfkey_handler pfkey_funcs[SADB_MAX + 1] = {
[SADB_RESERVED] = pfkey_reserved,
[SADB_GETSPI] = pfkey_getspi,
[SADB_UPDATE] = pfkey_add,
--
1.7.9.5
next prev parent reply other threads:[~2013-08-22 11:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-22 11:12 pull request (net-next): ipsec-next 2013-08-22 Steffen Klassert
2013-08-22 11:12 ` [PATCH 1/6] xfrm: constify mark argument of xfrm_find_acq() Steffen Klassert
2013-08-22 11:12 ` Steffen Klassert [this message]
2013-08-22 11:12 ` [PATCH 3/6] xfrm: Delete hold_timer when destroy policy Steffen Klassert
2013-08-22 11:12 ` [PATCH 4/6] xfrm: Remove rebundant address family checking Steffen Klassert
2013-08-22 11:12 ` [PATCH 5/6] xfrm: Make xfrm_state timer monotonic Steffen Klassert
2013-08-22 11:12 ` [PATCH 6/6] xfrm: remove irrelevant comment in xfrm_input() Steffen Klassert
2013-08-22 23:05 ` pull request (net-next): ipsec-next 2013-08-22 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1377169931-7302-3-git-send-email-steffen.klassert@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).