From fcfd8ac0a599dc99eb67259ed809312dc8c4df51 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Sat, 28 May 2011 10:36:31 -0700 Subject: [PATCH] staging: Convert vmalloc/memset to vzalloc Signed-off-by: Joe Perches Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rts_pstor/ms.c | 3 +-- drivers/staging/rts_pstor/rtsx_chip.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rts_pstor/ms.c b/drivers/staging/rts_pstor/ms.c index 2e8258754c96..66341dff8c99 100644 --- a/drivers/staging/rts_pstor/ms.c +++ b/drivers/staging/rts_pstor/ms.c @@ -2064,11 +2064,10 @@ static int ms_init_l2p_tbl(struct rtsx_chip *chip) RTSX_DEBUGP("ms_card->segment_cnt = %d\n", ms_card->segment_cnt); size = ms_card->segment_cnt * sizeof(struct zone_entry); - ms_card->segment = (struct zone_entry *)vmalloc(size); + ms_card->segment = vzalloc(size); if (ms_card->segment == NULL) { TRACE_RET(chip, STATUS_FAIL); } - memset(ms_card->segment, 0, size); retval = ms_read_page(chip, ms_card->boot_block, 1); if (retval != STATUS_SUCCESS) { diff --git a/drivers/staging/rts_pstor/rtsx_chip.c b/drivers/staging/rts_pstor/rtsx_chip.c index 4e60780ea804..5452069fbe08 100644 --- a/drivers/staging/rts_pstor/rtsx_chip.c +++ b/drivers/staging/rts_pstor/rtsx_chip.c @@ -1596,18 +1596,16 @@ int rtsx_write_cfg_seq(struct rtsx_chip *chip, u8 func, u16 addr, u8 *buf, int l } RTSX_DEBUGP("dw_len = %d\n", dw_len); - data = (u32 *)vmalloc(dw_len * 4); + data = vzalloc(dw_len * 4); if (!data) { TRACE_RET(chip, STATUS_NOMEM); } - memset(data, 0, dw_len * 4); - mask = (u32 *)vmalloc(dw_len * 4); + mask = vzalloc(dw_len * 4); if (!mask) { vfree(data); TRACE_RET(chip, STATUS_NOMEM); } - memset(mask, 0, dw_len * 4); j = 0; for (i = 0; i < len; i++) { -- 2.20.1