null_blk: remove duplicate 0 initialization
diff mbox series

Message ID 20190620045658.3662-1-chaitanya.kulkarni@wdc.com
State New
Headers show
Series
  • null_blk: remove duplicate 0 initialization
Related show

Commit Message

Chaitanya Kulkarni June 20, 2019, 4:56 a.m. UTC
In function null_add_dev() struct nullb *nullb member is allocated
using kzalloc_node() which returns 0red memory.

In function setup_queues() which is called from the null_add_dev(), on
successful queue allocation we set the nullb->nr_queues = 0 which is not
needed due to earlier use of kzalloc_node().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/block/null_blk_main.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Jens Axboe June 20, 2019, 9:19 a.m. UTC | #1
On 6/19/19 10:56 PM, Chaitanya Kulkarni wrote:
> In function null_add_dev() struct nullb *nullb member is allocated
> using kzalloc_node() which returns 0red memory.
> 
> In function setup_queues() which is called from the null_add_dev(), on
> successful queue allocation we set the nullb->nr_queues = 0 which is not
> needed due to earlier use of kzalloc_node().

Applied, thanks.

Patch
diff mbox series

diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c
index 2a4f8bc4f930..22303e59a274 100644
--- a/drivers/block/null_blk_main.c
+++ b/drivers/block/null_blk_main.c
@@ -1489,7 +1489,6 @@  static int setup_queues(struct nullb *nullb)
 	if (!nullb->queues)
 		return -ENOMEM;
 
-	nullb->nr_queues = 0;
 	nullb->queue_depth = nullb->dev->hw_queue_depth;
 
 	return 0;