aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAhmed S. Darwish <darwish.07@gmail.com>2007-02-05 19:38:55 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-02-07 18:29:39 -0500
commit0a361e31864f0822671703963f52957b3f275b93 (patch)
treec4af59332c5467963578dd35c1c9a0fa46a653a8 /drivers/block
parent22cfefb56b53103a99908ec63311e61c217eaffe (diff)
[SCSI] DAC960: kmalloc->kzalloc/Casting cleanups
A patch to switch kmalloc->kzalloc and to clean unneeded kammloc, pci_alloc_consistent casts Signed-off-by: Ahmed Darwish <darwish.07@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/DAC960.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 8d81a3a64c07..7c72f104567e 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -1373,8 +1373,7 @@ static boolean DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T
1373 Controller->BounceBufferLimit = DAC690_V2_PciDmaMask; 1373 Controller->BounceBufferLimit = DAC690_V2_PciDmaMask;
1374 1374
1375 /* This is a temporary dma mapping, used only in the scope of this function */ 1375 /* This is a temporary dma mapping, used only in the scope of this function */
1376 CommandMailbox = 1376 CommandMailbox = pci_alloc_consistent(PCI_Device,
1377 (DAC960_V2_CommandMailbox_T *)pci_alloc_consistent( PCI_Device,
1378 sizeof(DAC960_V2_CommandMailbox_T), &CommandMailboxDMA); 1377 sizeof(DAC960_V2_CommandMailbox_T), &CommandMailboxDMA);
1379 if (CommandMailbox == NULL) 1378 if (CommandMailbox == NULL)
1380 return false; 1379 return false;
@@ -1879,8 +1878,8 @@ static boolean DAC960_V2_ReadControllerConfiguration(DAC960_Controller_T
1879 if (NewLogicalDeviceInfo->LogicalDeviceState != 1878 if (NewLogicalDeviceInfo->LogicalDeviceState !=
1880 DAC960_V2_LogicalDevice_Offline) 1879 DAC960_V2_LogicalDevice_Offline)
1881 Controller->LogicalDriveInitiallyAccessible[LogicalDeviceNumber] = true; 1880 Controller->LogicalDriveInitiallyAccessible[LogicalDeviceNumber] = true;
1882 LogicalDeviceInfo = (DAC960_V2_LogicalDeviceInfo_T *) 1881 LogicalDeviceInfo = kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T),
1883 kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T), GFP_ATOMIC); 1882 GFP_ATOMIC);
1884 if (LogicalDeviceInfo == NULL) 1883 if (LogicalDeviceInfo == NULL)
1885 return DAC960_Failure(Controller, "LOGICAL DEVICE ALLOCATION"); 1884 return DAC960_Failure(Controller, "LOGICAL DEVICE ALLOCATION");
1886 Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] = 1885 Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] =
@@ -2113,8 +2112,8 @@ static boolean DAC960_V2_ReadDeviceConfiguration(DAC960_Controller_T
2113 if (!DAC960_V2_NewPhysicalDeviceInfo(Controller, Channel, TargetID, LogicalUnit)) 2112 if (!DAC960_V2_NewPhysicalDeviceInfo(Controller, Channel, TargetID, LogicalUnit))
2114 break; 2113 break;
2115 2114
2116 PhysicalDeviceInfo = (DAC960_V2_PhysicalDeviceInfo_T *) 2115 PhysicalDeviceInfo = kmalloc(sizeof(DAC960_V2_PhysicalDeviceInfo_T),
2117 kmalloc(sizeof(DAC960_V2_PhysicalDeviceInfo_T), GFP_ATOMIC); 2116 GFP_ATOMIC);
2118 if (PhysicalDeviceInfo == NULL) 2117 if (PhysicalDeviceInfo == NULL)
2119 return DAC960_Failure(Controller, "PHYSICAL DEVICE ALLOCATION"); 2118 return DAC960_Failure(Controller, "PHYSICAL DEVICE ALLOCATION");
2120 Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex] = 2119 Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex] =
@@ -2122,8 +2121,8 @@ static boolean DAC960_V2_ReadDeviceConfiguration(DAC960_Controller_T
2122 memcpy(PhysicalDeviceInfo, NewPhysicalDeviceInfo, 2121 memcpy(PhysicalDeviceInfo, NewPhysicalDeviceInfo,
2123 sizeof(DAC960_V2_PhysicalDeviceInfo_T)); 2122 sizeof(DAC960_V2_PhysicalDeviceInfo_T));
2124 2123
2125 InquiryUnitSerialNumber = (DAC960_SCSI_Inquiry_UnitSerialNumber_T *) 2124 InquiryUnitSerialNumber = kmalloc(
2126 kmalloc(sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T), GFP_ATOMIC); 2125 sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T), GFP_ATOMIC);
2127 if (InquiryUnitSerialNumber == NULL) { 2126 if (InquiryUnitSerialNumber == NULL) {
2128 kfree(PhysicalDeviceInfo); 2127 kfree(PhysicalDeviceInfo);
2129 return DAC960_Failure(Controller, "SERIAL NUMBER ALLOCATION"); 2128 return DAC960_Failure(Controller, "SERIAL NUMBER ALLOCATION");
@@ -4949,8 +4948,8 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
4949 PhysicalDevice.LogicalUnit = NewLogicalDeviceInfo->LogicalUnit; 4948 PhysicalDevice.LogicalUnit = NewLogicalDeviceInfo->LogicalUnit;
4950 Controller->V2.LogicalDriveToVirtualDevice[LogicalDeviceNumber] = 4949 Controller->V2.LogicalDriveToVirtualDevice[LogicalDeviceNumber] =
4951 PhysicalDevice; 4950 PhysicalDevice;
4952 LogicalDeviceInfo = (DAC960_V2_LogicalDeviceInfo_T *) 4951 LogicalDeviceInfo = kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T),
4953 kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T), GFP_ATOMIC); 4952 GFP_ATOMIC);
4954 Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] = 4953 Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] =
4955 LogicalDeviceInfo; 4954 LogicalDeviceInfo;
4956 DAC960_Critical("Logical Drive %d (/dev/rd/c%dd%d) " 4955 DAC960_Critical("Logical Drive %d (/dev/rd/c%dd%d) "
@@ -5709,14 +5708,14 @@ static boolean DAC960_CheckStatusBuffer(DAC960_Controller_T *Controller,
5709 unsigned int NewStatusBufferLength = DAC960_InitialStatusBufferSize; 5708 unsigned int NewStatusBufferLength = DAC960_InitialStatusBufferSize;
5710 while (NewStatusBufferLength < ByteCount) 5709 while (NewStatusBufferLength < ByteCount)
5711 NewStatusBufferLength *= 2; 5710 NewStatusBufferLength *= 2;
5712 Controller->CombinedStatusBuffer = 5711 Controller->CombinedStatusBuffer = kmalloc(NewStatusBufferLength,
5713 (unsigned char *) kmalloc(NewStatusBufferLength, GFP_ATOMIC); 5712 GFP_ATOMIC);
5714 if (Controller->CombinedStatusBuffer == NULL) return false; 5713 if (Controller->CombinedStatusBuffer == NULL) return false;
5715 Controller->CombinedStatusBufferLength = NewStatusBufferLength; 5714 Controller->CombinedStatusBufferLength = NewStatusBufferLength;
5716 return true; 5715 return true;
5717 } 5716 }
5718 NewStatusBuffer = (unsigned char *) 5717 NewStatusBuffer = kmalloc(2 * Controller->CombinedStatusBufferLength,
5719 kmalloc(2 * Controller->CombinedStatusBufferLength, GFP_ATOMIC); 5718 GFP_ATOMIC);
5720 if (NewStatusBuffer == NULL) 5719 if (NewStatusBuffer == NULL)
5721 { 5720 {
5722 DAC960_Warning("Unable to expand Combined Status Buffer - Truncating\n", 5721 DAC960_Warning("Unable to expand Combined Status Buffer - Truncating\n",