From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932222AbdAAQ3o (ORCPT ); Sun, 1 Jan 2017 11:29:44 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35128 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932066AbdAAQ3m (ORCPT ); Sun, 1 Jan 2017 11:29:42 -0500 From: Bhumika Goyal To: linux-kernel@vger.kernel.org Cc: julia.lawall@lip6.fr, san@google.com, mikew@google.com, walken@google.com, Bhumika Goyal Subject: [PATCH] firmware: google: add __ro_after_init to memconsole_bin_attr Date: Sun, 1 Jan 2017 21:59:21 +0530 Message-Id: <1483288161-17026-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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