From: Bhumika Goyal <bhumirks@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: julia.lawall@lip6.fr, san@google.com, mikew@google.com,
walken@google.com, Bhumika Goyal <bhumirks@gmail.com>
Subject: [PATCH] firmware: google: add __ro_after_init to memconsole_bin_attr
Date: Sun, 1 Jan 2017 21:59:21 +0530 [thread overview]
Message-ID: <1483288161-17026-1-git-send-email-bhumirks@gmail.com> (raw)
The object memconsole_bin_attr of type bin_attribute structure is not
modified after getting initialized by memconsole_init. Apart from
getting referenced in init it is also passed as an argument to the
functions sysfs_{remove/create}_bin_file but both the arguments are of
type const struct bin_attribute *. Therefore add __ro_after_init to its
declaration.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/firmware/google/memconsole.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/google/memconsole.c b/drivers/firmware/google/memconsole.c
index 2f569aa..54fa5a3 100644
--- a/drivers/firmware/google/memconsole.c
+++ b/drivers/firmware/google/memconsole.c
@@ -63,7 +63,7 @@ static ssize_t memconsole_read(struct file *filp, struct kobject *kobp,
return ret;
}
-static struct bin_attribute memconsole_bin_attr = {
+static struct bin_attribute memconsole_bin_attr __ro_after_init = {
.attr = {.name = "log", .mode = 0444},
.read = memconsole_read,
};
--
1.9.1
reply other threads:[~2017-01-01 16:29 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=1483288161-17026-1-git-send-email-bhumirks@gmail.com \
--to=bhumirks@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=mikew@google.com \
--cc=san@google.com \
--cc=walken@google.com \
/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®