firmware: google: add __ro_after_init to memconsole_bin_attr
PATCH 1/1 firmware: google: add __ro_after_init to memconsole_bin_attr
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 <[email protected]>
--- drivers/firmware/google/memconsole.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/google/memconsole.c +1 -1
@@ -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, };
Signature · 1 line
1.9.1