Discussion:
[PATCH 3/7] ieee802154: 6lowpan: make header_ops const
(too old to reply)
Marcel Holtmann
2017-08-25 16:17:21 UTC
Permalink
Hi Bhumika,
Make 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(-)
patch has been applied to bluetooth-next tree.

Regards

Marcel
David Miller
2017-08-28 18:30:15 UTC
Permalink
From: Bhumika Goyal <***@gmail.com>
Date: Fri, 25 Aug 2017 19:51:42 +0530
Make this const as it is only passed to a const argument of the function
ebt_register_table.
Applied.
David Miller
2017-08-28 18:30:21 UTC
Permalink
From: Bhumika Goyal <***@gmail.com>
Date: Fri, 25 Aug 2017 19:51:44 +0530
Make these const as they are only passed to a const argument of the
function inet_add_protocol.
Applied.
David Miller
2017-08-28 18:30:26 UTC
Permalink
From: Bhumika Goyal <***@gmail.com>
Date: Fri, 25 Aug 2017 19:51:45 +0530
Make this const as it is either used during a copy operation or passed
to a const argument of the function rhltable_init
Applied.
Bhumika Goyal
2017-08-25 14:21:41 UTC
Permalink
Make this const as it is only stored as a reference in a const field of
a net_device structure.

Signed-off-by: Bhumika Goyal <***@gmail.com>
---
net/bluetooth/6lowpan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 4e2576f..50fcdd1 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -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,
};
--
1.9.1
Bhumika Goyal
2017-08-25 14:21:46 UTC
Permalink
Make this const as it is either used during a copy operation or passed
to a const argument of the function rhltable_init.

Signed-off-by: Bhumika Goyal <***@gmail.com>
---
net/netfilter/nf_nat_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c
index b1d3740..df983ea 100644
--- a/net/netfilter/nf_nat_core.c
+++ b/net/netfilter/nf_nat_core.c
@@ -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,
--
1.9.1
Bhumika Goyal
2017-08-25 14:21:47 UTC
Permalink
Make this const as it is only used during a copy operation.

Signed-off-by: Bhumika Goyal <***@gmail.com>
---
net/sunrpc/xdr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index e34f4ee..a096025 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -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)
--
1.9.1
Jeff Layton
2017-08-25 14:48:56 UTC
Permalink
Post by Bhumika Goyal
Make this const as it is only used during a copy operation.
---
net/sunrpc/xdr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index e34f4ee..a096025 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -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)
Reviewed-by: Jeff Layton <***@redhat.com>

Stefan Schmidt
2017-08-25 14:36:37 UTC
Permalink
Hello.
Make 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(-)
diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
index de2661c..974765b 100644
--- a/net/ieee802154/6lowpan/core.c
+++ b/net/ieee802154/6lowpan/core.c
@@ -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,
};
Acked-by: Stefan Schmidt <***@osg.samsung.com>

regards
Stefan Schmidt
Santosh Shilimkar
2017-08-25 15:31:36 UTC
Permalink
Make this const as it is either used during a copy operation or passed
to a const argument of the function rhltable_init
---
Acked-by: Santosh Shilimkar <***@oracle.com>
Continue reading on narkive:
Loading...