[PATCH] blk-sysfs: Make structure queue_attr_group constant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The static structure queue_attr_group is used only once, when it is
passed as the second argument to the function sysfs_create_group().
However, the second parameter of sysfs_create_group() is already defined
as constant. Hence make queue_attr_group itself constant, as it is never
modified.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@xxxxxxxxx>
---
 block/blk-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 977c659dcd18..9401b0cc2e29 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -783,7 +783,7 @@ static umode_t queue_attr_visible(struct kobject *kobj, struct attribute *attr,
 	return attr->mode;
 }
 
-static struct attribute_group queue_attr_group = {
+static const struct attribute_group queue_attr_group = {
 	.attrs = queue_attrs,
 	.is_visible = queue_attr_visible,
 };
-- 
2.19.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux