Coly Li 3f146f
From edf8ff558887364714e115d396b2d06949cf1e07 Mon Sep 17 00:00:00 2001
Coly Li 3f146f
From: Bart Van Assche <bart.vanassche@sandisk.com>
Coly Li 3f146f
Date: Tue, 20 Jun 2017 11:15:48 -0700
Coly Li 3f146f
Subject: [PATCH] block: Constify disk_type
Coly Li 3f146f
Git-commit: edf8ff558887364714e115d396b2d06949cf1e07
Coly Li 3f146f
Patch-mainline: v4.13-rc1
Coly Li 3f146f
References: fate#322738,fate#322919,fate#322950,fate#323773
Coly Li 3f146f
Coly Li 3f146f
The variable 'disk_type' is never modified so constify it.
Coly Li 3f146f
Coly Li 3f146f
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Coly Li 3f146f
Reviewed-by: Christoph Hellwig <hch@lst.de>
Coly Li 3f146f
Cc: Hannes Reinecke <hare@suse.com>
Coly Li 3f146f
Cc: Omar Sandoval <osandov@fb.com>
Coly Li 3f146f
Cc: Ming Lei <ming.lei@redhat.com>
Coly Li 3f146f
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Coly Li 3f146f
Signed-off-by: Coly Li <colyli@suse.de>
Coly Li 3f146f
Coly Li 3f146f
---
Coly Li 3f146f
 block/genhd.c | 4 ++--
Coly Li 3f146f
 1 file changed, 2 insertions(+), 2 deletions(-)
Coly Li 3f146f
Coly Li 3f146f
diff --git a/block/genhd.c b/block/genhd.c
Coly Li 3f146f
index d252d29fe837..7f520fa25d16 100644
Coly Li 3f146f
--- a/block/genhd.c
Coly Li 3f146f
+++ b/block/genhd.c
Coly Li 3f146f
@@ -36,7 +36,7 @@ struct kobject *block_depr;
Coly Li 3f146f
 static DEFINE_SPINLOCK(ext_devt_lock);
Coly Li 3f146f
 static DEFINE_IDR(ext_devt_idr);
Coly Li 3f146f
 
Coly Li 3f146f
-static struct device_type disk_type;
Coly Li 3f146f
+static const struct device_type disk_type;
Coly Li 3f146f
 
Coly Li 3f146f
 static void disk_check_events(struct disk_events *ev,
Coly Li 3f146f
 			      unsigned int *clearing_ptr);
Coly Li 3f146f
@@ -1183,7 +1183,7 @@ static char *block_devnode(struct device *dev, umode_t *mode,
Coly Li 3f146f
 	return NULL;
Coly Li 3f146f
 }
Coly Li 3f146f
 
Coly Li 3f146f
-static struct device_type disk_type = {
Coly Li 3f146f
+static const struct device_type disk_type = {
Coly Li 3f146f
 	.name		= "disk",
Coly Li 3f146f
 	.groups		= disk_attr_groups,
Coly Li 3f146f
 	.release	= disk_release,
Coly Li 3f146f
-- 
Coly Li 3f146f
2.13.1
Coly Li 3f146f