block: Constify disk_type
authorBart Van Assche <bart.vanassche@sandisk.com>
Tue, 20 Jun 2017 18:15:48 +0000 (11:15 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 21 Jun 2017 01:27:14 +0000 (19:27 -0600)
The variable 'disk_type' is never modified so constify it.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c

index d252d29fe837322142d1ec26270a5eea861dd092..7f520fa25d16d47841cb892094d4615e4258534e 100644 (file)
@@ -36,7 +36,7 @@ struct kobject *block_depr;
 static DEFINE_SPINLOCK(ext_devt_lock);
 static DEFINE_IDR(ext_devt_idr);
 
-static struct device_type disk_type;
+static const struct device_type disk_type;
 
 static void disk_check_events(struct disk_events *ev,
                              unsigned int *clearing_ptr);
@@ -1183,7 +1183,7 @@ static char *block_devnode(struct device *dev, umode_t *mode,
        return NULL;
 }
 
-static struct device_type disk_type = {
+static const struct device_type disk_type = {
        .name           = "disk",
        .groups         = disk_attr_groups,
        .release        = disk_release,