public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: rbd: constify rbd_attr_group and rbd_opts_tokens
@ 2017-06-22 12:04 Arvind Yadav
  2017-06-22 12:23 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-06-22 12:04 UTC (permalink / raw)
  To: idryomov, sage, elder; +Cc: ceph-devel, linux-kernel

File size before:
   text	   data	    bss	    dec	    hex	filename
  43100	   2161	     64	  45325	   b10d	drivers/block/rbd.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  43292	   1969	     64	  45325	   b10d	drivers/block/rbd.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/block/rbd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 454bf9c..2fb1912 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -802,7 +802,7 @@ enum {
 	Opt_err
 };
 
-static match_table_t rbd_opts_tokens = {
+static const match_table_t rbd_opts_tokens = {
 	{Opt_queue_depth, "queue_depth=%d"},
 	/* int args above */
 	/* string args above */
@@ -4670,7 +4670,7 @@ static ssize_t rbd_image_refresh(struct device *dev,
 	NULL
 };
 
-static struct attribute_group rbd_attr_group = {
+static const struct attribute_group rbd_attr_group = {
 	.attrs = rbd_attrs,
 };
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: rbd: constify rbd_attr_group and rbd_opts_tokens
  2017-06-22 12:04 [PATCH] block: rbd: constify rbd_attr_group and rbd_opts_tokens Arvind Yadav
@ 2017-06-22 12:23 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2017-06-22 12:23 UTC (permalink / raw)
  To: Arvind Yadav, idryomov, sage, elder; +Cc: ceph-devel, linux-kernel

On Thu, 2017-06-22 at 17:34 +0530, Arvind Yadav wrote:
> File size before:
>    text	   data	    bss	    dec	    hex	filename
>   43100	   2161	     64	  45325	   b10d	drivers/block/rbd.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>   43292	   1969	     64	  45325	   b10d	drivers/block/rbd.o

If you are going to do these conversions, I still think
it'd be better to use a standard struct declaration.

>From 2011, (const was also added)
http://lkml.iu.edu/hypermail/linux/kernel/1104.2/00738.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-22 12:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-22 12:04 [PATCH] block: rbd: constify rbd_attr_group and rbd_opts_tokens Arvind Yadav
2017-06-22 12:23 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox