From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751241AbdBKTGY (ORCPT ); Sat, 11 Feb 2017 14:06:24 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:36744 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750999AbdBKTGX (ORCPT ); Sat, 11 Feb 2017 14:06:23 -0500 From: Bhumika Goyal To: julia.lawall@lip6.fr, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, ptesarik@suse.com, keescook@chromium.org Cc: Bhumika Goyal Subject: [PATCH] kernel: ksysfs: add __ro_after_init to bin_attribute structure Date: Sun, 12 Feb 2017 00:36:09 +0530 Message-Id: <1486839969-16891-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 notes_attr of type bin_attribute is not modified after getting initailized by ksysfs_init. Apart from initialization in ksysfs_init it is also passed as an argument to the function sysfs_create_bin_file but this argument is of type const. Therefore, add __ro_after_init to its declaration. Signed-off-by: Bhumika Goyal --- kernel/ksysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index ee1bc1b..0999679 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c @@ -195,7 +195,7 @@ static ssize_t notes_read(struct file *filp, struct kobject *kobj, return count; } -static struct bin_attribute notes_attr = { +static struct bin_attribute notes_attr __ro_after_init = { .attr = { .name = "notes", .mode = S_IRUGO, -- 1.9.1