summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2020-02-03 17:34:52 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-02-04 03:05:24 +0000
commit046755a28f9ddc95fd153e76e62d4b3205ac79cd (patch)
tree8e2c1b89271bd0587ab170fa9f3965151b0c6e7d /drivers/block
parentca0a95a6ac0c444d782abdcb44fd633a5c320d61 (diff)
drivers/block/null_blk_main.c: fix uninitialized var warnings
With gcc-7.2, many instances of drivers/block/null_blk_main.c: In function ‘nullb_device_zone_nr_conv_store’: drivers/block/null_blk_main.c:291:12: warning: ‘new_value’ may be used uninitialized in this function [-Wmaybe-uninitialized] dev->NAME = new_value; \ ^ drivers/block/null_blk_main.c:279:7: note: ‘new_value’ was declared here TYPE new_value; \ ^ Presumably notabug, so use uninitialized_var() to suppress them. Cc: Shaohua Li <shli@fb.com> Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/null_blk_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c
index 9ce75f171f8b..16510795e377 100644
--- a/drivers/block/null_blk_main.c
+++ b/drivers/block/null_blk_main.c
@@ -276,7 +276,7 @@ nullb_device_##NAME##_store(struct config_item *item, const char *page, \
{ \
int (*apply_fn)(struct nullb_device *dev, TYPE new_value) = APPLY;\
struct nullb_device *dev = to_nullb_device(item); \
- TYPE new_value; \
+ TYPE uninitialized_var(new_value); \
int ret; \
\
ret = nullb_device_##TYPE##_attr_store(&new_value, page, count);\