diff options
author | Joe Perches <joe@perches.com> | 2014-08-08 17:24:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 18:57:29 -0400 |
commit | 7c845eb5e184977d9c7135ae20d012b59f8cc729 (patch) | |
tree | 71115a1f8b3528722917faf589171a4c690547ea /drivers/scsi/3w-sas.c | |
parent | 8ac41b9dc719b4a5c65a2192988e8199278bb71a (diff) |
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>
Diffstat (limited to 'drivers/scsi/3w-sas.c')
-rw-r--r-- | drivers/scsi/3w-sas.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index 4de346017e9f..6da6cec9a651 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c | |||
@@ -683,14 +683,13 @@ static int twl_allocate_memory(TW_Device_Extension *tw_dev, int size, int which) | |||
683 | unsigned long *cpu_addr; | 683 | unsigned long *cpu_addr; |
684 | int retval = 1; | 684 | int retval = 1; |
685 | 685 | ||
686 | cpu_addr = pci_alloc_consistent(tw_dev->tw_pci_dev, size*TW_Q_LENGTH, &dma_handle); | 686 | cpu_addr = pci_zalloc_consistent(tw_dev->tw_pci_dev, size * TW_Q_LENGTH, |
687 | &dma_handle); | ||
687 | if (!cpu_addr) { | 688 | if (!cpu_addr) { |
688 | TW_PRINTK(tw_dev->host, TW_DRIVER, 0x5, "Memory allocation failed"); | 689 | TW_PRINTK(tw_dev->host, TW_DRIVER, 0x5, "Memory allocation failed"); |
689 | goto out; | 690 | goto out; |
690 | } | 691 | } |
691 | 692 | ||
692 | memset(cpu_addr, 0, size*TW_Q_LENGTH); | ||
693 | |||
694 | for (i = 0; i < TW_Q_LENGTH; i++) { | 693 | for (i = 0; i < TW_Q_LENGTH; i++) { |
695 | switch(which) { | 694 | switch(which) { |
696 | case 0: | 695 | case 0: |