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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1500020610-15973-2-git-send-email-arvind.yadav.cs@gmail.com>
Date:   Fri, 14 Jul 2017 13:53:27 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     lduncan@...e.com, cleech@...hat.com, jejb@...ux.vnet.ibm.com,
        martin.petersen@...cle.com
Cc:     open-iscsi@...glegroups.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 1/4] scsi: scsi_transport_iscsi: 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
  40380	  10422	     44	  50846	   c69e	scsi/scsi_transport_iscsi.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  40764	  10070	     44	  50878	   c6be	scsi/scsi_transport_iscsi.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
 drivers/scsi/scsi_transport_iscsi.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index a424eae..55393b3 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -139,7 +139,7 @@ static void iscsi_transport_release(struct device *dev)
 	NULL,
 };
 
-static struct attribute_group iscsi_transport_group = {
+static const struct attribute_group iscsi_transport_group = {
 	.attrs = iscsi_transport_attrs,
 };
 
@@ -177,7 +177,7 @@ static void iscsi_endpoint_release(struct device *dev)
 	NULL,
 };
 
-static struct attribute_group iscsi_endpoint_group = {
+static const struct attribute_group iscsi_endpoint_group = {
 	.attrs = iscsi_endpoint_attrs,
 };
 
@@ -680,7 +680,7 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
 	NULL,
 };
 
-static struct attribute_group iscsi_iface_group = {
+static const struct attribute_group iscsi_iface_group = {
 	.attrs = iscsi_iface_attrs,
 	.is_visible = iscsi_iface_attr_is_visible,
 };
@@ -3922,7 +3922,7 @@ static umode_t iscsi_conn_attr_is_visible(struct kobject *kobj,
 	return t->attr_is_visible(ISCSI_PARAM, param);
 }
 
-static struct attribute_group iscsi_conn_group = {
+static const struct attribute_group iscsi_conn_group = {
 	.attrs = iscsi_conn_attrs,
 	.is_visible = iscsi_conn_attr_is_visible,
 };
@@ -4217,7 +4217,7 @@ static umode_t iscsi_session_attr_is_visible(struct kobject *kobj,
 	return t->attr_is_visible(ISCSI_PARAM, param);
 }
 
-static struct attribute_group iscsi_session_group = {
+static const struct attribute_group iscsi_session_group = {
 	.attrs = iscsi_session_attrs,
 	.is_visible = iscsi_session_attr_is_visible,
 };
@@ -4285,7 +4285,7 @@ static umode_t iscsi_host_attr_is_visible(struct kobject *kobj,
 	return priv->iscsi_transport->attr_is_visible(ISCSI_HOST_PARAM, param);
 }
 
-static struct attribute_group iscsi_host_group = {
+static const struct attribute_group iscsi_host_group = {
 	.attrs = iscsi_host_attrs,
 	.is_visible = iscsi_host_attr_is_visible,
 };
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ