Skip to content

Commit f1c8781

Browse files
Lotte-Baiaxboe
authored andcommitted
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>
1 parent b9c10f6 commit f1c8781

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/s390/block/dasd_eckd.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,17 +1480,14 @@ static int dasd_eckd_pe_handler(struct dasd_device *device,
14801480
{
14811481
struct pe_handler_work_data *data;
14821482

1483-
data = kmalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA);
1483+
data = kzalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA);
14841484
if (!data) {
14851485
if (mutex_trylock(&dasd_pe_handler_mutex)) {
14861486
data = pe_handler_worker;
14871487
data->isglobal = 1;
14881488
} else {
14891489
return -ENOMEM;
14901490
}
1491-
} else {
1492-
memset(data, 0, sizeof(*data));
1493-
data->isglobal = 0;
14941491
}
14951492
INIT_WORK(&data->worker, do_pe_handler_work);
14961493
dasd_get_device(device);

0 commit comments

Comments
 (0)