From: Amitoj Kaur Chawla <amitoj1606@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] loop: constify attribute_group structure
Date: Wed, 2 Aug 2017 19:00:49 -0400 [thread overview]
Message-ID: <20170802230049.GA29677@amitoj-Inspiron-3542> (raw)
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
reply other threads:[~2017-08-02 22:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170802230049.GA29677@amitoj-Inspiron-3542 \
--to=amitoj1606@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®