mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] imon: constify attribute_group structures
@ 2017-08-05  1:51 Amitoj Kaur Chawla
  2017-08-10 21:55 ` Sean Young
  0 siblings, 1 reply; 2+ messages in thread
From: Amitoj Kaur Chawla @ 2017-08-05  1:51 UTC (permalink / raw)
  To: mchehab, linux-media, linux-kernel

Functions working with attribute_groups provided by <linux/sysfs.h>
work with const attribute_group. These attribute_group structures do not
change at runtime so mark them as const.

File size before:
 text      data     bss     dec     hex filename
 36981    16776     960   54717    d5bd drivers/media/rc/imon.o

File size after:
 text      data     bss     dec     hex filename
 37173    16584     960   54717    d5bd drivers/media/rc/imon.o

This change was made with the help of Coccinelle.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/media/rc/imon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index bd76534..717ba78 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -911,7 +911,7 @@ static struct attribute *imon_display_sysfs_entries[] = {
 	NULL
 };
 
-static struct attribute_group imon_display_attr_group = {
+static const struct attribute_group imon_display_attr_group = {
 	.attrs = imon_display_sysfs_entries
 };
 
@@ -920,7 +920,7 @@ static struct attribute *imon_rf_sysfs_entries[] = {
 	NULL
 };
 
-static struct attribute_group imon_rf_attr_group = {
+static const struct attribute_group imon_rf_attr_group = {
 	.attrs = imon_rf_sysfs_entries
 };
 
-- 
2.7.4

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

end of thread, other threads:[~2017-08-10 21:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-05  1:51 [PATCH] imon: constify attribute_group structures Amitoj Kaur Chawla
2017-08-10 21:55 ` Sean Young

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

all inboxes | Powered by JetHome®