* [PATCH] IB/iser: constify iser_reg_ops structure
@ 2015-11-28 15:52 Julia Lawall
2015-11-29 9:31 ` Sagi Grimberg
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2015-11-28 15:52 UTC (permalink / raw)
To: Or Gerlitz
Cc: kernel-janitors, Sagi Grimberg, Roi Dayan, Doug Ledford,
Sean Hefty, Hal Rosenstock, linux-rdma, linux-kernel
The iser_reg_ops structures are never modified, so declare them as const.
Done with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/infiniband/ulp/iser/iscsi_iser.h | 2 +-
drivers/infiniband/ulp/iser/iser_memory.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index 8a5998e..08d0926 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -400,7 +400,7 @@ struct iser_device {
int refcount;
int comps_used;
struct iser_comp *comps;
- struct iser_reg_ops *reg_ops;
+ const struct iser_reg_ops *reg_ops;
};
#define ISER_CHECK_GUARD 0xc0
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index ea765fb..b137d6d 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -49,7 +49,7 @@ int iser_fast_reg_mr(struct iscsi_iser_task *iser_task,
struct iser_reg_resources *rsc,
struct iser_mem_reg *mem_reg);
-static struct iser_reg_ops fastreg_ops = {
+static const struct iser_reg_ops fastreg_ops = {
.alloc_reg_res = iser_alloc_fastreg_pool,
.free_reg_res = iser_free_fastreg_pool,
.reg_mem = iser_fast_reg_mr,
@@ -58,7 +58,7 @@ static struct iser_reg_ops fastreg_ops = {
.reg_desc_put = iser_reg_desc_put_fr,
};
-static struct iser_reg_ops fmr_ops = {
+static const struct iser_reg_ops fmr_ops = {
.alloc_reg_res = iser_alloc_fmr_pool,
.free_reg_res = iser_free_fmr_pool,
.reg_mem = iser_fast_reg_fmr,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] IB/iser: constify iser_reg_ops structure
2015-11-28 15:52 [PATCH] IB/iser: constify iser_reg_ops structure Julia Lawall
@ 2015-11-29 9:31 ` Sagi Grimberg
0 siblings, 0 replies; 2+ messages in thread
From: Sagi Grimberg @ 2015-11-29 9:31 UTC (permalink / raw)
To: Julia Lawall, Or Gerlitz
Cc: kernel-janitors, Sagi Grimberg, Roi Dayan, Doug Ledford,
Sean Hefty, Hal Rosenstock, linux-rdma, linux-kernel
On 28/11/2015 17:52, Julia Lawall wrote:
> The iser_reg_ops structures are never modified, so declare them as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Thanks,
Acked-by: Sagi Grimberg <sagig@mellanox.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-29 9:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-28 15:52 [PATCH] IB/iser: constify iser_reg_ops structure Julia Lawall
2015-11-29 9:31 ` Sagi Grimberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®