Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1723234 > unrolled thread

[PATCH] RDS: constify rhashtable_params

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-30 14:00 +0200
Last post2017-08-30 16:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] RDS: constify rhashtable_params Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-30 14:00 +0200
    Re: [PATCH] RDS: constify rhashtable_params "santosh.shilimkar@oracle.com" <santosh.shilimkar@oracle.com> - 2017-08-30 16:00 +0200

#1723234 — [PATCH] RDS: constify rhashtable_params

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-30 14:00 +0200
Subject[PATCH] RDS: constify rhashtable_params
Message-ID<uk9P4-7OL-11@gated-at.bofh.it>
rhashtable_params are not supposed to change at runtime. All
Functions rhashtable_* working with const rhashtable_params
provided by <linux/rhashtable.h>. So mark the non-const structs
as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 net/rds/bind.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rds/bind.c b/net/rds/bind.c
index 3a915be..75d43dc 100644
--- a/net/rds/bind.c
+++ b/net/rds/bind.c
@@ -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),
-- 
1.9.1

[toc] | [next] | [standalone]


#1723352

From"santosh.shilimkar@oracle.com" <santosh.shilimkar@oracle.com>
Date2017-08-30 16:00 +0200
Message-ID<ukbHc-yr-25@gated-at.bofh.it>
In reply to#1723234
On 8/30/17 4:49 AM, Arvind Yadav wrote:
> rhashtable_params are not supposed to change at runtime. All
> Functions rhashtable_* working with const rhashtable_params
> provided by <linux/rhashtable.h>. So mark the non-const structs
> as const.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
This is already addressed in net-next by [1]

Regards,
Santosh

[1] https://lkml.org/lkml/2017/8/25/482

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web