IB/iser: constify iser_reg_ops structure
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 28 Nov 2015 15:52:04 +0000 (16:52 +0100)
committerDoug Ledford <dledford@redhat.com>
Thu, 24 Dec 2015 05:17:33 +0000 (00:17 -0500)
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>
Acked-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/iser/iscsi_iser.h
drivers/infiniband/ulp/iser/iser_memory.c

index d3f5255ef03448947ef54e81403c2df427e602cd..aeaa7586794593c0f9893c9bafc1cfd396720d1e 100644 (file)
@@ -410,7 +410,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
index e64cfa148e64f5670af40031ef0fe8999a1d51c0..bcec0a4c9c30c701f87747163cad864fd515dea2 100644 (file)
@@ -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,