lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <401bf1117576dabddbe30bab2ee3f8f64fad097c.1499076872.git.arvind.yadav.cs@gmail.com>
Date:   Mon,  3 Jul 2017 15:45:46 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     mchehab@...nel.org, bp@...en8.de
Cc:     linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] edac: i7core: constify attribute_group structures.

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
  12589	   1216	      8	  13813	   35f5	drivers/edac/i7core_edac.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  12717	   1088	      8	  13813	   35f5	drivers/edac/i7core_edac.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
 drivers/edac/i7core_edac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 75ad847..ba0fa11 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1079,7 +1079,7 @@ static ssize_t i7core_inject_enable_show(struct device *dev,
 	NULL
 };
 
-static struct attribute_group addrmatch_grp = {
+static const struct attribute_group addrmatch_grp = {
 	.attrs	= i7core_addrmatch_attrs,
 };
 
@@ -1110,7 +1110,7 @@ static void addrmatch_release(struct device *device)
 	NULL
 };
 
-static struct attribute_group all_channel_counts_grp = {
+static const struct attribute_group all_channel_counts_grp = {
 	.attrs	= i7core_udimm_counters_attrs,
 };
 
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ