scsi: use pci_zalloc_consistent
Remove the now unnecessary memset too. Signed-off-by: Joe Perches <joe@perches.com> Cc: Adam Radford <linuxraid@lsi.com> Cc: "James E.J. Bottomley" <JBottomley@parallels.com> Cc: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Cc: Dario Ballabio <ballabio_dario@emc.com> Cc: Michael Neuffer <mike@i-Connect.Net> Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com> Cc: Neela Syam Kolli <megaraidlinux@lsi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
8ac41b9dc7
commit
7c845eb5e1
@@ -3538,10 +3538,9 @@ static int be_queue_alloc(struct beiscsi_hba *phba, struct be_queue_info *q,
|
||||
q->len = len;
|
||||
q->entry_size = entry_size;
|
||||
mem->size = len * entry_size;
|
||||
mem->va = pci_alloc_consistent(phba->pcidev, mem->size, &mem->dma);
|
||||
mem->va = pci_zalloc_consistent(phba->pcidev, mem->size, &mem->dma);
|
||||
if (!mem->va)
|
||||
return -ENOMEM;
|
||||
memset(mem->va, 0, mem->size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4320,9 +4319,9 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
|
||||
"BM_%d : No boot session\n");
|
||||
return ret;
|
||||
}
|
||||
nonemb_cmd.va = pci_alloc_consistent(phba->ctrl.pdev,
|
||||
sizeof(*session_resp),
|
||||
&nonemb_cmd.dma);
|
||||
nonemb_cmd.va = pci_zalloc_consistent(phba->ctrl.pdev,
|
||||
sizeof(*session_resp),
|
||||
&nonemb_cmd.dma);
|
||||
if (nonemb_cmd.va == NULL) {
|
||||
beiscsi_log(phba, KERN_ERR,
|
||||
BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG,
|
||||
@@ -4332,7 +4331,6 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(nonemb_cmd.va, 0, sizeof(*session_resp));
|
||||
tag = mgmt_get_session_info(phba, s_handle,
|
||||
&nonemb_cmd);
|
||||
if (!tag) {
|
||||
|
@@ -900,13 +900,12 @@ free_cmd:
|
||||
static int mgmt_alloc_cmd_data(struct beiscsi_hba *phba, struct be_dma_mem *cmd,
|
||||
int iscsi_cmd, int size)
|
||||
{
|
||||
cmd->va = pci_alloc_consistent(phba->ctrl.pdev, size, &cmd->dma);
|
||||
cmd->va = pci_zalloc_consistent(phba->ctrl.pdev, size, &cmd->dma);
|
||||
if (!cmd->va) {
|
||||
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
|
||||
"BG_%d : Failed to allocate memory for if info\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(cmd->va, 0, size);
|
||||
cmd->size = size;
|
||||
be_cmd_hdr_prepare(cmd->va, CMD_SUBSYSTEM_ISCSI, iscsi_cmd, size);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user