* [PATCH net-next 0/2] constify nla_policy
@ 2018-07-18 16:32 Stephen Hemminger
2018-07-18 16:32 ` [PATCH net-next 1/2] nbd: " Stephen Hemminger
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-07-18 16:32 UTC (permalink / raw)
To: josef, axboe, pablo, laforge
Cc: linux-block, nbd, osmocom-net-gprs, netdev, Stephen Hemminger
Almost all places that use nla_policy declare it const.
A couple of drivers didn't but that is fixable.
Stephen Hemminger (2):
nbd: constify nla_policy
gtp: constify nla_policy
drivers/block/nbd.c | 6 +++---
drivers/net/gtp.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
--
2.18.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] nbd: constify nla_policy
2018-07-18 16:32 [PATCH net-next 0/2] constify nla_policy Stephen Hemminger
@ 2018-07-18 16:32 ` Stephen Hemminger
2018-07-18 16:32 ` [PATCH net-next 2/2] gtp: " Stephen Hemminger
2018-07-20 19:34 ` [PATCH net-next 0/2] " David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-07-18 16:32 UTC (permalink / raw)
To: josef, axboe, pablo, laforge
Cc: linux-block, nbd, osmocom-net-gprs, netdev, Stephen Hemminger,
Stephen Hemminger
The netlink policy should be const like other drivers.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/block/nbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 74a05561b620..e07401d3901d 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1571,7 +1571,7 @@ static int find_free_cb(int id, void *ptr, void *data)
}
/* Netlink interface. */
-static struct nla_policy nbd_attr_policy[NBD_ATTR_MAX + 1] = {
+static const struct nla_policy nbd_attr_policy[NBD_ATTR_MAX + 1] = {
[NBD_ATTR_INDEX] = { .type = NLA_U32 },
[NBD_ATTR_SIZE_BYTES] = { .type = NLA_U64 },
[NBD_ATTR_BLOCK_SIZE_BYTES] = { .type = NLA_U64 },
@@ -1583,14 +1583,14 @@ static struct nla_policy nbd_attr_policy[NBD_ATTR_MAX + 1] = {
[NBD_ATTR_DEVICE_LIST] = { .type = NLA_NESTED},
};
-static struct nla_policy nbd_sock_policy[NBD_SOCK_MAX + 1] = {
+static const struct nla_policy nbd_sock_policy[NBD_SOCK_MAX + 1] = {
[NBD_SOCK_FD] = { .type = NLA_U32 },
};
/* We don't use this right now since we don't parse the incoming list, but we
* still want it here so userspace knows what to expect.
*/
-static struct nla_policy __attribute__((unused))
+static const struct nla_policy __attribute__((unused))
nbd_device_policy[NBD_DEVICE_ATTR_MAX + 1] = {
[NBD_DEVICE_INDEX] = { .type = NLA_U32 },
[NBD_DEVICE_CONNECTED] = { .type = NLA_U8 },
--
2.18.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] gtp: constify nla_policy
2018-07-18 16:32 [PATCH net-next 0/2] constify nla_policy Stephen Hemminger
2018-07-18 16:32 ` [PATCH net-next 1/2] nbd: " Stephen Hemminger
@ 2018-07-18 16:32 ` Stephen Hemminger
2018-07-20 19:34 ` [PATCH net-next 0/2] " David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-07-18 16:32 UTC (permalink / raw)
To: josef, axboe, pablo, laforge
Cc: linux-block, nbd, osmocom-net-gprs, netdev, Stephen Hemminger,
Stephen Hemminger
The netlink policy structure can be constant like other
drivers.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/gtp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index ec629a730005..7a145172d503 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -1255,7 +1255,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb,
return skb->len;
}
-static struct nla_policy gtp_genl_policy[GTPA_MAX + 1] = {
+static const struct nla_policy gtp_genl_policy[GTPA_MAX + 1] = {
[GTPA_LINK] = { .type = NLA_U32, },
[GTPA_VERSION] = { .type = NLA_U32, },
[GTPA_TID] = { .type = NLA_U64, },
--
2.18.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] constify nla_policy
2018-07-18 16:32 [PATCH net-next 0/2] constify nla_policy Stephen Hemminger
2018-07-18 16:32 ` [PATCH net-next 1/2] nbd: " Stephen Hemminger
2018-07-18 16:32 ` [PATCH net-next 2/2] gtp: " Stephen Hemminger
@ 2018-07-20 19:34 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-07-20 19:34 UTC (permalink / raw)
To: stephen
Cc: josef, axboe, pablo, laforge, linux-block, nbd, osmocom-net-gprs,
netdev, sthemmin
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 18 Jul 2018 09:32:42 -0700
> Almost all places that use nla_policy declare it const.
> A couple of drivers didn't but that is fixable.
Series applied, thanks Stephen.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-20 20:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18 16:32 [PATCH net-next 0/2] constify nla_policy Stephen Hemminger
2018-07-18 16:32 ` [PATCH net-next 1/2] nbd: " Stephen Hemminger
2018-07-18 16:32 ` [PATCH net-next 2/2] gtp: " Stephen Hemminger
2018-07-20 19:34 ` [PATCH net-next 0/2] " David Miller
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).