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>
这个提交包含在:
@@ -683,14 +683,13 @@ static int twl_allocate_memory(TW_Device_Extension *tw_dev, int size, int which)
|
||||
unsigned long *cpu_addr;
|
||||
int retval = 1;
|
||||
|
||||
cpu_addr = pci_alloc_consistent(tw_dev->tw_pci_dev, size*TW_Q_LENGTH, &dma_handle);
|
||||
cpu_addr = pci_zalloc_consistent(tw_dev->tw_pci_dev, size * TW_Q_LENGTH,
|
||||
&dma_handle);
|
||||
if (!cpu_addr) {
|
||||
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x5, "Memory allocation failed");
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset(cpu_addr, 0, size*TW_Q_LENGTH);
|
||||
|
||||
for (i = 0; i < TW_Q_LENGTH; i++) {
|
||||
switch(which) {
|
||||
case 0:
|
||||
|
在新工单中引用
屏蔽一个用户