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


Groups > linux.kernel > #1687153 > unrolled thread

[PATCH 3/4] scsi: scsi_transport_fc: constify attribute_group structures.

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-07-14 10:30 +0200
Last post2017-07-14 10:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/4] scsi: scsi_transport_fc: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-14 10:30 +0200

#1687153 — [PATCH 3/4] scsi: scsi_transport_fc: constify attribute_group structures.

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-07-14 10:30 +0200
Subject[PATCH 3/4] scsi: scsi_transport_fc: constify attribute_group structures.
Message-ID<u3494-LP-21@gated-at.bofh.it>
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/transport_class.h>
work with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
  34122	   1932	      4	  36058	   8cda	drivers/scsi/scsi_transport_fc.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  34186	   1868	      4	  36058	   8cda	drivers/scsi/scsi_transport_fc.o

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

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 7e24aa3..eda39cc 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -1808,7 +1808,7 @@ static FC_DEVICE_ATTR(host, reset_statistics, S_IWUSR, NULL,
 	NULL
 };
 
-static struct attribute_group fc_statistics_group = {
+static const struct attribute_group fc_statistics_group = {
 	.name = "statistics",
 	.attrs = fc_statistics_attrs,
 };
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web