net: make some structures const
Subsystems (11)
cover net: make some structures const
Make these const as they are not modified.
Bhumika Goyal (7):
Bluetooth: 6lowpan: make header_ops const
bridge: make ebt_table const
ieee802154: 6lowpan: make header_ops const
ipv4: make net_protocol const
RDS: make rhashtable_params const
netfilter: nat: make rhashtable_params const
SUNRPC: make kvec const
net/bluetooth/6lowpan.c | 2 +- net/bridge/netfilter/ebtable_nat.c | 2 +- net/ieee802154/6lowpan/core.c | 2 +- net/ipv4/af_inet.c | 4 ++-- net/netfilter/nf_nat_core.c | 2 +- net/rds/bind.c | 2 +- net/sunrpc/xdr.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/7 Bluetooth: 6lowpan: make header_ops const
Make this const as it is only stored as a reference in a const field of a net_device structure.
--- net/bluetooth/6lowpan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/6lowpan.c +1 -1
@@ -581,7 +581,7 @@ static int bt_dev_init(struct net_device *dev) .ndo_start_xmit = bt_xmit, }; -static struct header_ops header_ops = { +static const struct header_ops header_ops = { .create = header_create, };
Signature · 1 line
1.9.1
PATCH 2/7 bridge: make ebt_table const
In reply to Bhumika GoyalMake this const as it is only passed to a const argument of the function ebt_register_table.
--- net/bridge/netfilter/ebtable_nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/netfilter/ebtable_nat.c +1 -1
@@ -48,7 +48,7 @@ static int check(const struct ebt_table_info *info, unsigned int valid_hooks)return 0 ; } -static struct ebt_table frame_nat = { +static const struct ebt_table frame_nat = { .name ="nat" , .table = &initial_table, .valid_hooks =NAT_VALID_HOOKS ,
Signature · 1 line
1.9.1
Re: [PATCH 2/7] bridge: make ebt_table const
From: Bhumika Goyal <[email protected]>
Date: Fri, 25 Aug 2017 19:51:42 +0530
Quoted 4 lines
Make this const as it is only passed to a const argument of the function
ebt_register_table.Signed-off-by Bhumika Goyal <[email protected]>
Applied.
PATCH 3/7 ieee802154: 6lowpan: make header_ops const
In reply to Bhumika GoyalMake this const as it is only stored as a reference in a const field of a net_device structure.
--- net/ieee802154/6lowpan/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ieee802154/6lowpan/core.c +1 -1
@@ -54,7 +54,7 @@static int open_count; -static struct header_ops lowpan_header_ops = { +static const struct header_ops lowpan_header_ops = { .create = lowpan_header_create, };
Signature · 1 line
1.9.1
Re: [PATCH 3/7] ieee802154: 6lowpan: make header_ops const
Hello.
Quoted 14 lines · Bhumika Goyal
Make this const as it is only stored as a reference in a const field of a
net_devicestructure.Signed-off-by Bhumika Goyal <[email protected]>--- net/ieee802154/6lowpan/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ieee802154/6lowpan/core.c +0
-0
net/ieee802154/6lowpan/core.c line 60
Quoted 8 lines
net/ieee802154/6lowpan/core.c +1
-1@@ -54,7 +54,7 @@static int open_count; -static struct header_ops lowpan_header_ops = { +static const struct header_ops lowpan_header_ops = { .create = lowpan_header_create, };
regards
Stefan Schmidt
Marcel Holtmann
maintainerRe: [PATCH 3/7] ieee802154: 6lowpan: make header_ops const
In reply to Bhumika GoyalHi Bhumika,
Quoted 7 lines
Make this const as it is only stored as a reference in a const field of a
net_devicestructure.Signed-off-by Bhumika Goyal <[email protected]>---
net/ieee802154/6lowpan/core.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
PATCH 4/7 ipv4: make net_protocol const
In reply to Bhumika GoyalMake these const as they are only passed to a const argument of the function inet_add_protocol.
--- net/ipv4/af_inet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/af_inet.c +2 -2
@@ -1596,7 +1596,7 @@ u64 snmp_fold_field64(void __percpu *mib, int offt, size_t syncp_offset) };#endif -static struct net_protocol tcp_protocol = { +static const struct net_protocol tcp_protocol = { .early_demux = tcp_v4_early_demux, .early_demux_handler = tcp_v4_early_demux, .handler = tcp_v4_rcv,
@@ -1606,7 +1606,7 @@ u64 snmp_fold_field64(void __percpu *mib, int offt, size_t syncp_offset) .icmp_strict_tag_validation = 1, }; -static struct net_protocol udp_protocol = { +static const struct net_protocol udp_protocol = { .early_demux = udp_v4_early_demux, .early_demux_handler = udp_v4_early_demux, .handler = udp_rcv,
Signature · 1 line
1.9.1
Re: [PATCH 4/7] ipv4: make net_protocol const
From: Bhumika Goyal <[email protected]>
Date: Fri, 25 Aug 2017 19:51:44 +0530
Quoted 4 lines
Make these const as they are only passed to a const argument of the function
inet_add_protocol.Signed-off-by Bhumika Goyal <[email protected]>
Applied.
PATCH 5/7 RDS: make rhashtable_params const
In reply to Bhumika GoyalMake this const as it is either used during a copy operation or passed to a const argument of the function rhltable_init
--- net/rds/bind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/rds/bind.c +1 -1
@@ -40,7 +40,7 @@static struct rhashtable bind_hash_table; -static struct rhashtable_params ht_parms = { +static const struct rhashtable_params ht_parms = { .nelem_hint =768 , .key_len =sizeof (u64), .key_offset = offsetof(struct rds_sock , rs_bound_key),
Signature · 1 line
1.9.1
Re: [PATCH 5/7] RDS: make rhashtable_params const
Quoted 5 lines · Bhumika Goyal
Make this const as it is either used during a copy operation or passed to a const argument of the function
rhltable_initSigned-off-by Bhumika Goyal <[email protected]>---
Re: [PATCH 5/7] RDS: make rhashtable_params const
In reply to Bhumika GoyalFrom: Bhumika Goyal <[email protected]>
Date: Fri, 25 Aug 2017 19:51:45 +0530
Quoted 4 lines
Make this const as it is either used during a copy operation or passed to a const argument of the function
rhltable_initSigned-off-by Bhumika Goyal <[email protected]>
Applied.
PATCH 6/7 netfilter: nat: make rhashtable_params const
In reply to Bhumika GoyalMake this const as it is either used during a copy operation or passed to a const argument of the function rhltable_init.
--- net/netfilter/nf_nat_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_nat_core.c +1 -1
@@ -198,7 +198,7 @@ static int nf_nat_bysource_cmp(struct rhashtable_compare_arg *arg,return 0 ; } -static struct rhashtable_params nf_nat_bysource_params = { +static const struct rhashtable_params nf_nat_bysource_params = { .head_offset = offsetof(struct nf_conn , nat_bysource), .obj_hashfn = nf_nat_bysource_hash, .obj_cmpfn = nf_nat_bysource_cmp,
Signature · 1 line
1.9.1
Re: [PATCH 6/7] netfilter: nat: make rhashtable_params const
Bhumika Goyal <[email protected]> wrote:
[..]
trimming CC list, also this should probably have been
sent to [email protected] on its own, with [nf-next] in subject line. That aside:
PATCH 7/7 SUNRPC: make kvec const
In reply to Bhumika GoyalMake this const as it is only used during a copy operation.
--- net/sunrpc/xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/xdr.c +1 -1
@@ -998,7 +998,7 @@ void xdr_enter_page(struct xdr_stream *xdr, unsigned int len) }EXPORT_SYMBOL_GPL (xdr_enter_page); -static struct kvec empty_iov = {.iov_base =NULL , .iov_len =0 }; +static const struct kvec empty_iov = {.iov_base =NULL , .iov_len =0 };void xdr_buf_from_iov (struct kvec *iov,struct xdr_buf *buf)
Signature · 1 line
1.9.1
Re: [PATCH 7/7] SUNRPC: make kvec const
Quoted 12 lines · Bhumika Goyal
Make this const as it is only used during a copy operation.
Signed-off-by Bhumika Goyal <[email protected]>--- net/sunrpc/xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/sunrpc/xdr.c +0
-0
net/sunrpc/xdr.c void xdr_enter_page(struct xdr_stream *xdr, unsigned int len) · line 1004
Quoted 8 lines
net/sunrpc/xdr.c +1
-1@@ -998,7 +998,7 @@ void xdr_enter_page(struct xdr_stream *xdr, unsigned int len) }EXPORT_SYMBOL_GPL (xdr_enter_page); -static struct kvec empty_iov = {.iov_base =NULL , .iov_len =0 }; +static const struct kvec empty_iov = {.iov_base =NULL , .iov_len =0 };void xdr_buf_from_iov (struct kvec *iov,struct xdr_buf *buf)