rbd: constify device_type structure
Subsystems (2)
PATCH 1/1 rbd: constify device_type structure
Declare device_type structure as const as it is only stored in the type field of a device structure. This field is of type const, so add const to the declaration of device_type structure.
File size before:
text data bss dec hex filename
61546 11610 208 73364 11e94 drivers/block/rbd.o
File size after:
text data bss dec hex filename
61610 11578 208 73396 11eb4 drivers/block/rbd.o
--- drivers/block/rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/rbd.c +1 -1
@@ -4779,7 +4779,7 @@ static ssize_t rbd_image_refresh(struct device *dev,static void rbd_dev_release (struct device *dev); -static struct device_type rbd_device_type = { +static const struct device_type rbd_device_type = { .name ="rbd" , .groups = rbd_attr_groups, .release = rbd_dev_release,
Signature · 1 line
1.9.1
Quoted 22 lines · Bhumika Goyal
Declare
device_typestructure as const as it is only stored in the type field of a device structure. This field is of type const, so add const to the declaration ofdevice_typestructure.File size before:
text data bss dec hex filename
61546 11610 208 73364 11e94drivers/block/rbd.oFile size after:
text data bss dec hex filename
61610 11578 208 73396 11eb4drivers/block/rbd.oSigned-off-by Bhumika Goyal <[email protected]>--- drivers/block/rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/block/rbd.c +0
-0
drivers/block/rbd.c static ssize_t rbd_image_refresh(struct device *dev, · line 4785
Quoted 8 lines
drivers/block/rbd.c +1
-1@@ -4779,7 +4779,7 @@ static ssize_t rbd_image_refresh(struct device *dev,static void rbd_dev_release (struct device *dev); -static struct device_type rbd_device_type = { +static const struct device_type rbd_device_type = { .name ="rbd" , .groups = rbd_attr_groups, .release = rbd_dev_release,
Applied.
Thanks,
Ilya