[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1473599168-30561-10-git-send-email-Julia.Lawall@lip6.fr>
Date: Sun, 11 Sep 2016 15:05:51 +0200
From: Julia Lawall <Julia.Lawall@...6.fr>
To: Faisal Latif <faisal.latif@...el.com>
Cc: joe@...ches.com, kernel-janitors@...r.kernel.org,
Chien Tin Tung <chien.tin.tung@...el.com>,
Mustafa Ismail <mustafa.ismail@...el.com>,
Shiraz Saleem <shiraz.saleem@...el.com>,
Tatyana Nikolova <tatyana.e.nikolova@...el.com>,
Doug Ledford <dledford@...hat.com>,
Sean Hefty <sean.hefty@...el.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 09/26] i40iw: constify local structures
For structure types defined in the same file or local header files, find
top-level static structure declarations that have the following
properties:
1. Never reassigned.
2. Address never taken
3. Not passed to a top-level macro call
4. No pointer or array-typed field passed to a function or stored in a
variable.
Declare structures having all of these properties as const.
Done using Coccinelle.
Based on a suggestion by Joe Perches <joe@...ches.com>.
Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>
---
The semantic patch seems too long for a commit log, but is in the cover
letter.
drivers/infiniband/hw/i40iw/i40iw_uk.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/i40iw/i40iw_uk.c b/drivers/infiniband/hw/i40iw/i40iw_uk.c
index 4d28c3c..eb94c03 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_uk.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_uk.c
@@ -918,7 +918,7 @@ enum i40iw_status_code i40iw_get_wqe_shift(u32 wqdepth, u32 sge, u32 inline_data
return 0;
}
-static struct i40iw_qp_uk_ops iw_qp_uk_ops = {
+static const struct i40iw_qp_uk_ops iw_qp_uk_ops = {
i40iw_qp_post_wr,
i40iw_qp_ring_push_db,
i40iw_rdma_write,
@@ -932,14 +932,14 @@ static struct i40iw_qp_uk_ops iw_qp_uk_ops = {
i40iw_nop
};
-static struct i40iw_cq_ops iw_cq_ops = {
+static const struct i40iw_cq_ops iw_cq_ops = {
i40iw_cq_request_notification,
i40iw_cq_poll_completion,
i40iw_cq_post_entries,
i40iw_clean_cq
};
-static struct i40iw_device_uk_ops iw_device_uk_ops = {
+static const struct i40iw_device_uk_ops iw_device_uk_ops = {
i40iw_cq_uk_init,
i40iw_qp_uk_init,
};
Powered by blists - more mailing lists