* [PATCH] infiniband: hw: hfi1: constify mmu_notifier_ops structure
@ 2016-11-19 9:47 ` Bhumika Goyal
0 siblings, 0 replies; 5+ messages in thread
From: Bhumika Goyal @ 2016-11-19 9:47 UTC (permalink / raw)
To: julia.lawall-L2FTfq7BK8M,
mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w,
dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w,
dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Bhumika Goyal
Declare the structure mmu_notifier_ops as const as it is only stored in
the ops field of a mmu_notifier structure. The ops field is of type
const struct mmu_notifier_ops *, so mmu_notifier_ops structures having
this property can be declared as const.
Done using coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct mmu_notifier_ops i@p = {...};
@ok1@
identifier r1.i;
position p;
struct mmu_rb_handler handler;
@@
handler.mn.ops=&i@p
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct mmu_notifier_ops i={...};
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct mmu_notifier_ops i;
File size before:
text data bss dec hex filename
3566 72 16 3654 e46
drivers/infiniband/hw/hfi1/mmu_rb.o
File size after:
text data bss dec hex filename
3658 0 16 3674 e5a
drivers/infiniband/hw/hfi1/mmu_rb.o
Signed-off-by: Bhumika Goyal <bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/hw/hfi1/mmu_rb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c
index 7ad3089..ccbf52c 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.c
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.c
@@ -81,7 +81,7 @@ static void do_remove(struct mmu_rb_handler *handler,
struct list_head *del_list);
static void handle_remove(struct work_struct *work);
-static struct mmu_notifier_ops mn_opts = {
+static const struct mmu_notifier_ops mn_opts = {
.invalidate_page = mmu_notifier_page,
.invalidate_range_start = mmu_notifier_range_start,
};
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] infiniband: hw: hfi1: constify mmu_notifier_ops structure
@ 2016-11-19 9:47 ` Bhumika Goyal
0 siblings, 0 replies; 5+ messages in thread
From: Bhumika Goyal @ 2016-11-19 9:47 UTC (permalink / raw)
To: julia.lawall, mike.marciniszyn, dennis.dalessandro, dledford,
sean.hefty, hal.rosenstock, linux-rdma, linux-kernel
Cc: Bhumika Goyal
Declare the structure mmu_notifier_ops as const as it is only stored in
the ops field of a mmu_notifier structure. The ops field is of type
const struct mmu_notifier_ops *, so mmu_notifier_ops structures having
this property can be declared as const.
Done using coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct mmu_notifier_ops i@p = {...};
@ok1@
identifier r1.i;
position p;
struct mmu_rb_handler handler;
@@
handler.mn.ops=&i@p
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct mmu_notifier_ops i={...};
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct mmu_notifier_ops i;
File size before:
text data bss dec hex filename
3566 72 16 3654 e46
drivers/infiniband/hw/hfi1/mmu_rb.o
File size after:
text data bss dec hex filename
3658 0 16 3674 e5a
drivers/infiniband/hw/hfi1/mmu_rb.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/infiniband/hw/hfi1/mmu_rb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c
index 7ad3089..ccbf52c 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.c
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.c
@@ -81,7 +81,7 @@ static void do_remove(struct mmu_rb_handler *handler,
struct list_head *del_list);
static void handle_remove(struct work_struct *work);
-static struct mmu_notifier_ops mn_opts = {
+static const struct mmu_notifier_ops mn_opts = {
.invalidate_page = mmu_notifier_page,
.invalidate_range_start = mmu_notifier_range_start,
};
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] infiniband: hw: hfi1: constify mmu_notifier_ops structure
2016-11-19 9:47 ` Bhumika Goyal
(?)
@ 2016-11-23 0:43 ` ira.weiny
-1 siblings, 0 replies; 5+ messages in thread
From: ira.weiny @ 2016-11-23 0:43 UTC (permalink / raw)
To: Bhumika Goyal
Cc: julia.lawall, mike.marciniszyn, dennis.dalessandro, dledford,
sean.hefty, hal.rosenstock, linux-rdma, linux-kernel
On Sat, Nov 19, 2016 at 03:17:48PM +0530, Bhumika Goyal wrote:
> Declare the structure mmu_notifier_ops as const as it is only stored in
> the ops field of a mmu_notifier structure. The ops field is of type
> const struct mmu_notifier_ops *, so mmu_notifier_ops structures having
> this property can be declared as const.
> Done using coccinelle:
> @r1 disable optional_qualifier @
> identifier i;
> position p;
> @@
> static struct mmu_notifier_ops i@p = {...};
>
> @ok1@
> identifier r1.i;
> position p;
> struct mmu_rb_handler handler;
> @@
> handler.mn.ops=&i@p
>
> @bad@
> position p!={r1.p,ok1.p};
> identifier r1.i;
> @@
> i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r1.i;
> @@
> static
> +const
> struct mmu_notifier_ops i={...};
>
> @depends on !bad disable optional_qualifier@
> identifier r1.i;
> @@
> +const
> struct mmu_notifier_ops i;
>
> File size before:
> text data bss dec hex filename
> 3566 72 16 3654 e46
> drivers/infiniband/hw/hfi1/mmu_rb.o
>
> File size after:
> text data bss dec hex filename
> 3658 0 16 3674 e5a
> drivers/infiniband/hw/hfi1/mmu_rb.o
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> ---
> drivers/infiniband/hw/hfi1/mmu_rb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c
> index 7ad3089..ccbf52c 100644
> --- a/drivers/infiniband/hw/hfi1/mmu_rb.c
> +++ b/drivers/infiniband/hw/hfi1/mmu_rb.c
> @@ -81,7 +81,7 @@ static void do_remove(struct mmu_rb_handler *handler,
> struct list_head *del_list);
> static void handle_remove(struct work_struct *work);
>
> -static struct mmu_notifier_ops mn_opts = {
> +static const struct mmu_notifier_ops mn_opts = {
> .invalidate_page = mmu_notifier_page,
> .invalidate_range_start = mmu_notifier_range_start,
> };
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] infiniband: hw: hfi1: constify mmu_notifier_ops structure
2016-11-19 9:47 ` Bhumika Goyal
@ 2016-12-12 20:21 ` Doug Ledford
-1 siblings, 0 replies; 5+ messages in thread
From: Doug Ledford @ 2016-12-12 20:21 UTC (permalink / raw)
To: Bhumika Goyal, julia.lawall-L2FTfq7BK8M,
mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w,
dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1.1: Type: text/plain, Size: 428 bytes --]
On 11/19/2016 4:47 AM, Bhumika Goyal wrote:
> Declare the structure mmu_notifier_ops as const as it is only stored in
> the ops field of a mmu_notifier structure. The ops field is of type
> const struct mmu_notifier_ops *, so mmu_notifier_ops structures having
> this property can be declared as const.
Thanks, applied.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] infiniband: hw: hfi1: constify mmu_notifier_ops structure
@ 2016-12-12 20:21 ` Doug Ledford
0 siblings, 0 replies; 5+ messages in thread
From: Doug Ledford @ 2016-12-12 20:21 UTC (permalink / raw)
To: Bhumika Goyal, julia.lawall, mike.marciniszyn,
dennis.dalessandro, sean.hefty, hal.rosenstock, linux-rdma,
linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 399 bytes --]
On 11/19/2016 4:47 AM, Bhumika Goyal wrote:
> Declare the structure mmu_notifier_ops as const as it is only stored in
> the ops field of a mmu_notifier structure. The ops field is of type
> const struct mmu_notifier_ops *, so mmu_notifier_ops structures having
> this property can be declared as const.
Thanks, applied.
--
Doug Ledford <dledford@redhat.com>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-12-12 20:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-19 9:47 [PATCH] infiniband: hw: hfi1: constify mmu_notifier_ops structure Bhumika Goyal
2016-11-19 9:47 ` Bhumika Goyal
2016-11-23 0:43 ` ira.weiny
[not found] ` <1479548868-13563-1-git-send-email-bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-12-12 20:21 ` Doug Ledford
2016-12-12 20:21 ` Doug Ledford
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.