diff mbox

rbd: constify device_type structure

Message ID 1486795478-16655-1-git-send-email-bhumirks@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bhumika Goyal Feb. 11, 2017, 6:44 a.m. UTC
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

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/block/rbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ilya Dryomov Feb. 13, 2017, 9:12 a.m. UTC | #1
On Sat, Feb 11, 2017 at 7:44 AM, Bhumika Goyal <bhumirks@gmail.com> wrote:
> 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
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
>  drivers/block/rbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 36d2b9f..dfc708b 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -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
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 36d2b9f..dfc708b 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -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,