Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1673283 > unrolled thread

[PATCH] usb: core: sysfs: constify attribute_group

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-06-23 08:00 +0200
Last post2017-06-24 10:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] usb: core: sysfs: constify attribute_group Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-06-23 08:00 +0200
    Re: [PATCH] usb: core: sysfs: constify attribute_group Greg KH <gregkh@linuxfoundation.org> - 2017-06-24 10:00 +0200

#1673283 — [PATCH] usb: core: sysfs: constify attribute_group

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-06-23 08:00 +0200
Subject[PATCH] usb: core: sysfs: constify attribute_group
Message-ID<tVpNp-6E0-21@gated-at.bofh.it>
File size before:
   text	   data	    bss	    dec	    hex	filename
   6798	   2848	      4	   9650	   25b2	drivers/usb/core/sysfs.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   7230	   2400	      4	   9634	   25a2	drivers/usb/core/sysfs.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/usb/core/sysfs.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index dfc68ed..2af3121 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -617,7 +617,7 @@ static ssize_t usb3_hardware_lpm_u2_show(struct device *dev,
 	&dev_attr_usb2_lpm_besl.attr,
 	NULL,
 };
-static struct attribute_group usb2_hardware_lpm_attr_group = {
+static const struct attribute_group usb2_hardware_lpm_attr_group = {
 	.name	= power_group_name,
 	.attrs	= usb2_hardware_lpm_attr,
 };
@@ -627,7 +627,7 @@ static ssize_t usb3_hardware_lpm_u2_show(struct device *dev,
 	&dev_attr_usb3_hardware_lpm_u2.attr,
 	NULL,
 };
-static struct attribute_group usb3_hardware_lpm_attr_group = {
+static const struct attribute_group usb3_hardware_lpm_attr_group = {
 	.name	= power_group_name,
 	.attrs	= usb3_hardware_lpm_attr,
 };
@@ -639,7 +639,7 @@ static ssize_t usb3_hardware_lpm_u2_show(struct device *dev,
 	&dev_attr_active_duration.attr,
 	NULL,
 };
-static struct attribute_group power_attr_group = {
+static const struct attribute_group power_attr_group = {
 	.name	= power_group_name,
 	.attrs	= power_attrs,
 };
@@ -805,7 +805,7 @@ static ssize_t remove_store(struct device *dev, struct device_attribute *attr,
 #endif
 	NULL,
 };
-static struct attribute_group dev_attr_grp = {
+static const struct attribute_group dev_attr_grp = {
 	.attrs = dev_attrs,
 };
 
@@ -838,7 +838,7 @@ static umode_t dev_string_attrs_are_visible(struct kobject *kobj,
 	return a->mode;
 }
 
-static struct attribute_group dev_string_attr_grp = {
+static const struct attribute_group dev_string_attr_grp = {
 	.attrs =	dev_string_attrs,
 	.is_visible =	dev_string_attrs_are_visible,
 };
@@ -1070,7 +1070,7 @@ static ssize_t interface_authorized_store(struct device *dev,
 	&dev_attr_interface_authorized.attr,
 	NULL,
 };
-static struct attribute_group intf_attr_grp = {
+static const struct attribute_group intf_attr_grp = {
 	.attrs = intf_attrs,
 };
 
@@ -1094,7 +1094,7 @@ static umode_t intf_assoc_attrs_are_visible(struct kobject *kobj,
 	return a->mode;
 }
 
-static struct attribute_group intf_assoc_attr_grp = {
+static const struct attribute_group intf_assoc_attr_grp = {
 	.attrs =	intf_assoc_attrs,
 	.is_visible =	intf_assoc_attrs_are_visible,
 };
-- 
1.9.1

[toc] | [next] | [standalone]


#1674050

FromGreg KH <gregkh@linuxfoundation.org>
Date2017-06-24 10:00 +0200
Message-ID<tVO94-533-3@gated-at.bofh.it>
In reply to#1673283
On Fri, Jun 23, 2017 at 11:28:10AM +0530, Arvind Yadav wrote:
> File size before:
>    text	   data	    bss	    dec	    hex	filename
>    6798	   2848	      4	   9650	   25b2	drivers/usb/core/sysfs.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>    7230	   2400	      4	   9634	   25a2	drivers/usb/core/sysfs.o
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

You have sent a lot of these types of patches out, and really, this is a
horrible changelog entry.  You are assuming that I know what this is,
and why it is a good thing.  Now I might, but maybe not...

Please actually explain why you are making this change.  Why it is
needed.  And big hint, it's not only about the output of the file
size...

Please fix this up for all of the patches you have sent me in this
format, as I'm deleting them all from my queue right now.

thanks,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web