Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1716364

[PATCH 2/6] nbd: make device_attribute const

From Bhumika Goyal <bhumirks@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 2/6] nbd: make device_attribute const
Date 2017-08-21 13:50 +0200
Message-ID <ugTns-3Rl-21@gated-at.bofh.it> (permalink)
References <ugTnr-3Rl-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 5bdf923..49d7763 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -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,
 };
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] drivers:  make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 13:50 +0200
  [PATCH 2/6] nbd: make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 13:50 +0200
  [PATCH 3/6] hid: make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 13:50 +0200
  [PATCH 4/6] qlogic:  make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 13:50 +0200
    Re: [PATCH 4/6] qlogic: make device_attribute const David Miller <davem@davemloft.net> - 2017-08-21 19:30 +0200
      Re: [PATCH 4/6] qlogic: make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 19:30 +0200
  Re: [PATCH 0/6] drivers: make device_attribute const "Rafael J. Wysocki" <rafael@kernel.org> - 2017-08-21 14:30 +0200
    Re: [PATCH 0/6] drivers: make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 15:00 +0200
  Re: [PATCH 0/6] drivers: make device_attribute const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-21 15:00 +0200

csiph-web