mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 11:19:37 +00:00
staging: Convert vmalloc/memset to vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
f5a22e91e0
commit
fcfd8ac0a5
2 changed files with 3 additions and 6 deletions
|
@ -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);
|
RTSX_DEBUGP("ms_card->segment_cnt = %d\n", ms_card->segment_cnt);
|
||||||
|
|
||||||
size = ms_card->segment_cnt * sizeof(struct zone_entry);
|
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) {
|
if (ms_card->segment == NULL) {
|
||||||
TRACE_RET(chip, STATUS_FAIL);
|
TRACE_RET(chip, STATUS_FAIL);
|
||||||
}
|
}
|
||||||
memset(ms_card->segment, 0, size);
|
|
||||||
|
|
||||||
retval = ms_read_page(chip, ms_card->boot_block, 1);
|
retval = ms_read_page(chip, ms_card->boot_block, 1);
|
||||||
if (retval != STATUS_SUCCESS) {
|
if (retval != STATUS_SUCCESS) {
|
||||||
|
|
|
@ -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);
|
RTSX_DEBUGP("dw_len = %d\n", dw_len);
|
||||||
|
|
||||||
data = (u32 *)vmalloc(dw_len * 4);
|
data = vzalloc(dw_len * 4);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
TRACE_RET(chip, STATUS_NOMEM);
|
TRACE_RET(chip, STATUS_NOMEM);
|
||||||
}
|
}
|
||||||
memset(data, 0, dw_len * 4);
|
|
||||||
|
|
||||||
mask = (u32 *)vmalloc(dw_len * 4);
|
mask = vzalloc(dw_len * 4);
|
||||||
if (!mask) {
|
if (!mask) {
|
||||||
vfree(data);
|
vfree(data);
|
||||||
TRACE_RET(chip, STATUS_NOMEM);
|
TRACE_RET(chip, STATUS_NOMEM);
|
||||||
}
|
}
|
||||||
memset(mask, 0, dw_len * 4);
|
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
|
|
Loading…
Reference in a new issue