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


Groups > linux.kernel > #1702539 > unrolled thread

[PATCH] loop: constify attribute_group structure

Started byAmitoj Kaur Chawla <amitoj1606@gmail.com>
First post2017-08-03 01:00 +0200
Last post2017-08-03 01:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] loop: constify attribute_group structure Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2017-08-03 01:00 +0200

#1702539 — [PATCH] loop: constify attribute_group structure

FromAmitoj Kaur Chawla <amitoj1606@gmail.com>
Date2017-08-03 01:00 +0200
Subject[PATCH] loop: constify attribute_group structure
Message-ID<uaaMq-7QI-3@gated-at.bofh.it>
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
 27981     5489     480   33950    849e drivers/block/loop.o

File size after:
 text      data     bss     dec     hex filename
 28320     5421     480   34221    85ad drivers/block/loop.o

This change was made with the help of Coccinelle.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/block/loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index ef83349..a7f35a0 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -798,7 +798,7 @@ static struct attribute *loop_attrs[] = {
 	NULL,
 };
 
-static struct attribute_group loop_attribute_group = {
+static const struct attribute_group loop_attribute_group = {
 	.name = "loop",
 	.attrs= loop_attrs,
 };
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web