Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/dasd: Use kzalloc instead of kmalloc/memset

Use kzalloc rather than duplicating its implementation, which
makes code simple and easy to understand.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://lore.kernel.org/r/20220505141733.1989450-6-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Haowen Bai and committed by
Jens Axboe
f1c8781a b9c10f68

+1 -4
+1 -4
drivers/s390/block/dasd_eckd.c
··· 1480 1480 { 1481 1481 struct pe_handler_work_data *data; 1482 1482 1483 - data = kmalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA); 1483 + data = kzalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA); 1484 1484 if (!data) { 1485 1485 if (mutex_trylock(&dasd_pe_handler_mutex)) { 1486 1486 data = pe_handler_worker; ··· 1488 1488 } else { 1489 1489 return -ENOMEM; 1490 1490 } 1491 - } else { 1492 - memset(data, 0, sizeof(*data)); 1493 - data->isglobal = 0; 1494 1491 } 1495 1492 INIT_WORK(&data->worker, do_pe_handler_work); 1496 1493 dasd_get_device(device);