* [PATCH] firmware: google: add __ro_after_init to memconsole_bin_attr
@ 2017-01-01 16:29 Bhumika Goyal
0 siblings, 0 replies; only message in thread
From: Bhumika Goyal @ 2017-01-01 16:29 UTC (permalink / raw)
To: linux-kernel; +Cc: julia.lawall, san, mikew, walken, Bhumika Goyal
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-01 16:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-01 16:29 [PATCH] firmware: google: add __ro_after_init to memconsole_bin_attr Bhumika Goyal
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®