Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1681451

[PATCH] input: synaptics-rmi4: Constify attribute_group structures.

Path csiph.com!goblin2!goblin1!goblin.stu.neva.ru!border1.nntp.ams1.giganews.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!feeds.phibee-telecom.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Arvind Yadav <arvind.yadav.cs@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] input: synaptics-rmi4: Constify attribute_group structures.
Date Wed, 05 Jul 2017 12:40:03 +0200
Message-ID <tZPSX-537-41@gated-at.bofh.it> (permalink)
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Zxu5BIRlaPrgf9y9Ov+gJMKsbt78q3OED1p3iFIQK+w=; b=WiAFjA669TeqqyUZ3+a/rTGyDRHxwF3tzOdoQjcvmF6iyWhZTsSDtD3zk32oBZvJAb 4alUor+SJRGjXIUhUNkCPP2W1eiEQ7jrF2md4WfuSEgR+3zRoezwRQPyiWiE49BahHYm spmC8cB2sh8Ygo8z4AU+TEplSpmmRUdK4HAALKGu4PQ3SyfVqkFBvEt+8VWnUtr79Jjn jlt7xYGjaQQ9kUzcKwRK68Y5Qs3Rl4A52Dt/TN6AGTk8fpZVkOKyxd63iLYVFbBKjTX/ QRvJ+whvk4eRABW2oCKqze2DZv+ab3BAw75PpHWWCe+pZnzD0umcxOmXHv859ZjjKNOS SM3w==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Zxu5BIRlaPrgf9y9Ov+gJMKsbt78q3OED1p3iFIQK+w=; b=A3o90npv/rrOL6ieie4iY6bgdLiIgHq7GO6t2VQa+gqt7bfvP1DEvvT423OvQu7eY0 TVGP4feWcq1uayn+Jj6NFngxrWiL+9xAn9ffgKj6k/BJdpYK7d/Z+1No3G7iUH2R0YZG 9j7LH0Tfh8yrGiZ+9TIhO1hC5R+JMDTnc8vV5dDZO6sFqvlDCBHsu72VUxG2cZH5TZ26 9u3YYAunTYR9qkXcwJ/K7VE7z4dQZMr8KlKu3nUIe73Sm1i2E5o6nyY8+kDHswFXGGfL VPb/XcTYIGpWcXxuNCI2Ffe4RX/0i6KpK239SfrpCprSn/xpNdrjxrz0wuvcZTJmann6 wIZg==
X-Gm-Message-State AIVw113fc4t6kEBBbnx83SumxHRdmQd4Je9ng5XaJqBiSkFD6fvoocmp BuzXjZeTHa3lCP/a
X-Received by 10.99.188.18 with SMTP id q18mr20277415pge.79.1499250648263; Wed, 05 Jul 2017 03:30:48 -0700 (PDT)
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 32
Organization linux.* mail to news gateway
X-Original-Cc linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Wed, 5 Jul 2017 16:00:30 +0530
X-Original-Message-ID <910bd7f4f3001b8c1b3ad7d40eb6619c091b2b29.1499250565.git.arvind.yadav.cs@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1681451

Show key headers only | View raw


attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work with const
attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   4777	    480	      0	   5257	   1489	drivers/input/rmi4/rmi_f01.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   4817	    416	      0	   5233	   1471	drivers/input/rmi4/rmi_f01.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/rmi4/rmi_f01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c
index 7f7e917..aa1aabf 100644
--- a/drivers/input/rmi4/rmi_f01.c
+++ b/drivers/input/rmi4/rmi_f01.c
@@ -334,7 +334,7 @@ static ssize_t rmi_driver_package_id_show(struct device *dev,
 	NULL
 };
 
-static struct attribute_group rmi_f01_attr_group = {
+static const struct attribute_group rmi_f01_attr_group = {
 	.attrs = rmi_f01_attrs,
 };
 
-- 
1.9.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] input: synaptics-rmi4: Constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-05 12:40 +0200

csiph-web