From 7c845eb5e184977d9c7135ae20d012b59f8cc729 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Fri, 8 Aug 2014 14:24:46 -0700 Subject: scsi: use pci_zalloc_consistent Remove the now unnecessary memset too. Signed-off-by: Joe Perches Cc: Adam Radford Cc: "James E.J. Bottomley" Cc: Jayamohan Kallickal Cc: Dario Ballabio Cc: Michael Neuffer Cc: "Stephen M. Cameron" Cc: Neela Syam Kolli Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/scsi/3w-sas.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/3w-sas.c') 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) 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: -- cgit