nbd: make device_attribute const
authorBhumika Goyal <bhumirks@gmail.com>
Mon, 21 Aug 2017 11:43:08 +0000 (17:13 +0530)
committerJens Axboe <axboe@kernel.dk>
Mon, 28 Aug 2017 21:21:27 +0000 (15:21 -0600)
Make this const as is is only passed as an argument to the
function device_create_file and device_remove_file and the corresponding
arguments are of type const.
Done using Coccinelle

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c

index 6752b9178a396780762bde612a8983aa62ae261b..2aa87cbdede0ed19b77c8e4aaffea2c2d8146758 100644 (file)
@@ -165,7 +165,7 @@ static ssize_t pid_show(struct device *dev,
        return sprintf(buf, "%d\n", task_pid_nr(nbd->task_recv));
 }
 
-static struct device_attribute pid_attr = {
+static const struct device_attribute pid_attr = {
        .attr = { .name = "pid", .mode = S_IRUGO},
        .show = pid_show,
 };