Skip to contentSkip to conversation

DAC960: kmalloc->kzalloc/Casting cleanups

PATCH In review Ahmed S. Darwish 6 participants 10 messages Jan 6, 2007 – Jan 8, 2007 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 DAC960: kmalloc->kzalloc/Casting cleanups

Hi all,
I'm not able to find the DAC960 block driver maintainer. If someones knows please reply :).

A patch to switch kmalloc->kzalloc and to clean unneeded kammloc, pci_alloc_consistent casts

drivers/block/DAC960.c +13 -14
index 8d81a3a..4febe7f 100644
@@ -1373,8 +1373,7 @@ static boolean DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T
   Controller->BounceBufferLimit = DAC690_V2_PciDmaMask;
 
   /* This is a temporary dma mapping, used only in the scope of this function */
-  CommandMailbox =
-	  (DAC960_V2_CommandMailbox_T *)pci_alloc_consistent( PCI_Device,
+  CommandMailbox = pci_alloc_consistent(PCI_Device,
 		sizeof(DAC960_V2_CommandMailbox_T), &CommandMailboxDMA);
   if (CommandMailbox == NULL)
 	  return false;
@@ -1879,8 +1878,8 @@ static boolean DAC960_V2_ReadControllerConfiguration(DAC960_Controller_T
       if (NewLogicalDeviceInfo->LogicalDeviceState !=
 	  DAC960_V2_LogicalDevice_Offline)
 	Controller->LogicalDriveInitiallyAccessible[LogicalDeviceNumber] = true;
-      LogicalDeviceInfo = (DAC960_V2_LogicalDeviceInfo_T *)
-	kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T), GFP_ATOMIC);
+      LogicalDeviceInfo = kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T),
+				   GFP_ATOMIC);
       if (LogicalDeviceInfo == NULL)
 	return DAC960_Failure(Controller, "LOGICAL DEVICE ALLOCATION");
       Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] =
@@ -2113,8 +2112,8 @@ static boolean DAC960_V2_ReadDeviceConfiguration(DAC960_Controller_T
       if (!DAC960_V2_NewPhysicalDeviceInfo(Controller, Channel, TargetID, LogicalUnit))
 	  break;
 
-      PhysicalDeviceInfo = (DAC960_V2_PhysicalDeviceInfo_T *)
-		kmalloc(sizeof(DAC960_V2_PhysicalDeviceInfo_T), GFP_ATOMIC);
+      PhysicalDeviceInfo = kmalloc(sizeof(DAC960_V2_PhysicalDeviceInfo_T),
+				    GFP_ATOMIC);
       if (PhysicalDeviceInfo == NULL)
 		return DAC960_Failure(Controller, "PHYSICAL DEVICE ALLOCATION");
       Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex] =
@@ -2122,8 +2121,8 @@ static boolean DAC960_V2_ReadDeviceConfiguration(DAC960_Controller_T
       memcpy(PhysicalDeviceInfo, NewPhysicalDeviceInfo,
 		sizeof(DAC960_V2_PhysicalDeviceInfo_T));
 
-      InquiryUnitSerialNumber = (DAC960_SCSI_Inquiry_UnitSerialNumber_T *)
-	kmalloc(sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T), GFP_ATOMIC);
+      InquiryUnitSerialNumber = kmalloc(
+	      sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T), GFP_ATOMIC);
       if (InquiryUnitSerialNumber == NULL) {
 	kfree(PhysicalDeviceInfo);
 	return DAC960_Failure(Controller, "SERIAL NUMBER ALLOCATION");
@@ -4949,8 +4948,8 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
 	      PhysicalDevice.LogicalUnit = NewLogicalDeviceInfo->LogicalUnit;
 	      Controller->V2.LogicalDriveToVirtualDevice[LogicalDeviceNumber] =
 		PhysicalDevice;
-	      LogicalDeviceInfo = (DAC960_V2_LogicalDeviceInfo_T *)
-		kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T), GFP_ATOMIC);
+	      LogicalDeviceInfo = kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T),
+					  GFP_ATOMIC);
 	      Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] =
 		LogicalDeviceInfo;
 	      DAC960_Critical("Logical Drive %d (/dev/rd/c%dd%d) "
@@ -5709,14 +5708,14 @@ static boolean DAC960_CheckStatusBuffer(DAC960_Controller_T *Controller,
       unsigned int NewStatusBufferLength = DAC960_InitialStatusBufferSize;
       while (NewStatusBufferLength < ByteCount)
 	NewStatusBufferLength *= 2;
-      Controller->CombinedStatusBuffer =
-	(unsigned char *) kmalloc(NewStatusBufferLength, GFP_ATOMIC);
+      Controller->CombinedStatusBuffer = kmalloc(NewStatusBufferLength, 
+						  GFP_ATOMIC);
       if (Controller->CombinedStatusBuffer == NULL) return false;
       Controller->CombinedStatusBufferLength = NewStatusBufferLength;
       return true;
     }
-  NewStatusBuffer = (unsigned char *)
-    kmalloc(2 * Controller->CombinedStatusBufferLength, GFP_ATOMIC);
+  NewStatusBuffer = kmalloc(2 * Controller->CombinedStatusBufferLength, 
+			     GFP_ATOMIC);
   if (NewStatusBuffer == NULL)
     {
       DAC960_Warning("Unable to expand Combined Status Buffer - Truncating\n",
Signature · 2 lines
Ahmed S. Darwish
http://darwish-07.blogspot.com
#1 lore raw

drivers/block/DAC960.c

Quoted 10 lines · Ahmed S. Darwish

Hi all,
I'm not able to find the DAC960 block driver maintainer. If someones knows please reply :).

A patch to switch kmalloc->kzalloc and to clean unneeded kammloc, pci_alloc_consistent casts

drivers/block/DAC960.c +0 -0

a couple bits of advice here. you should start your patch
submission with *only* that descriptive text you want included in the log, followed by your "Signed-off-by" line, then a line containing "---".

*after* that "---" line, and *before* you start the actual patch,
you can add superfluous text, like asking about who the maintainer is, so that informal dialogue like that doesn't become part of the permanent patch record.

in short, your patch should look like:

A patch to switch...

Signed-off-by ...

---

i'm not sure who the maintainer is. can anyone help?

(quoted diff) +0 -0

rday

#2 lore raw
Quoted 11 lines · Robert P. J. Day

a couple bits of advice here. you should start your patch
submission with *only* that descriptive text you want included in the log, followed by your "Signed-off-by" line, then a line containing "---".

*after* that "---" line, and *before* you start the actual patch,
you can add superfluous text, like asking about who the maintainer is, so that informal dialogue like that doesn't become part of the permanent patch record.

rday

Thanks for all the good notes ..

Signature · 2 lines
Ahmed S. Darwish
http://darwish-07.blogspot.com
#3 lore raw
In reply to Ahmed S. Darwish
Quoted 3 lines · On Sat, 6 Jan 2007 15:17:25 +0200 Ahmed S. Darwish wrote:

Hi all,
I'm not able to find the DAC960 block driver maintainer. If someones knows please reply :).

It's orphaned. Andrew can decide to merge this, or one of the storage or block maintainers could possibly do that. or it could go thru KJ, but then Andrew may still end up merging it.

Quoted 85 lines

A patch to switch kmalloc->kzalloc and to clean unneeded kammloc, pci_alloc_consistent casts

drivers/block/DAC960.c +13 -14
index 8d81a3a..4febe7f 100644
@@ -1373,8 +1373,7 @@ static boolean DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T
   Controller->BounceBufferLimit = DAC690_V2_PciDmaMask;
 
   /* This is a temporary dma mapping, used only in the scope of this function */
-  CommandMailbox =
-	  (DAC960_V2_CommandMailbox_T *)pci_alloc_consistent( PCI_Device,
+  CommandMailbox = pci_alloc_consistent(PCI_Device,
 		sizeof(DAC960_V2_CommandMailbox_T), &CommandMailboxDMA);
   if (CommandMailbox == NULL)
 	  return false;
@@ -1879,8 +1878,8 @@ static boolean DAC960_V2_ReadControllerConfiguration(DAC960_Controller_T
       if (NewLogicalDeviceInfo->LogicalDeviceState !=
 	  DAC960_V2_LogicalDevice_Offline)
 	Controller->LogicalDriveInitiallyAccessible[LogicalDeviceNumber] = true;
-      LogicalDeviceInfo = (DAC960_V2_LogicalDeviceInfo_T *)
-	kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T), GFP_ATOMIC);
+      LogicalDeviceInfo = kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T),
+				   GFP_ATOMIC);
       if (LogicalDeviceInfo == NULL)
 	return DAC960_Failure(Controller, "LOGICAL DEVICE ALLOCATION");
       Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] =
@@ -2113,8 +2112,8 @@ static boolean DAC960_V2_ReadDeviceConfiguration(DAC960_Controller_T
       if (!DAC960_V2_NewPhysicalDeviceInfo(Controller, Channel, TargetID, LogicalUnit))
 	  break;
 
-      PhysicalDeviceInfo = (DAC960_V2_PhysicalDeviceInfo_T *)
-		kmalloc(sizeof(DAC960_V2_PhysicalDeviceInfo_T), GFP_ATOMIC);
+      PhysicalDeviceInfo = kmalloc(sizeof(DAC960_V2_PhysicalDeviceInfo_T),
+				    GFP_ATOMIC);
       if (PhysicalDeviceInfo == NULL)
 		return DAC960_Failure(Controller, "PHYSICAL DEVICE ALLOCATION");
       Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex] =
@@ -2122,8 +2121,8 @@ static boolean DAC960_V2_ReadDeviceConfiguration(DAC960_Controller_T
       memcpy(PhysicalDeviceInfo, NewPhysicalDeviceInfo,
 		sizeof(DAC960_V2_PhysicalDeviceInfo_T));
 
-      InquiryUnitSerialNumber = (DAC960_SCSI_Inquiry_UnitSerialNumber_T *)
-	kmalloc(sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T), GFP_ATOMIC);
+      InquiryUnitSerialNumber = kmalloc(
+	      sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T), GFP_ATOMIC);
       if (InquiryUnitSerialNumber == NULL) {
 	kfree(PhysicalDeviceInfo);
 	return DAC960_Failure(Controller, "SERIAL NUMBER ALLOCATION");
@@ -4949,8 +4948,8 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
 	      PhysicalDevice.LogicalUnit = NewLogicalDeviceInfo->LogicalUnit;
 	      Controller->V2.LogicalDriveToVirtualDevice[LogicalDeviceNumber] =
 		PhysicalDevice;
-	      LogicalDeviceInfo = (DAC960_V2_LogicalDeviceInfo_T *)
-		kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T), GFP_ATOMIC);
+	      LogicalDeviceInfo = kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T),
+					  GFP_ATOMIC);
 	      Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] =
 		LogicalDeviceInfo;
 	      DAC960_Critical("Logical Drive %d (/dev/rd/c%dd%d) "
@@ -5709,14 +5708,14 @@ static boolean DAC960_CheckStatusBuffer(DAC960_Controller_T *Controller,
       unsigned int NewStatusBufferLength = DAC960_InitialStatusBufferSize;
       while (NewStatusBufferLength < ByteCount)
 	NewStatusBufferLength *= 2;
-      Controller->CombinedStatusBuffer =
-	(unsigned char *) kmalloc(NewStatusBufferLength, GFP_ATOMIC);
+      Controller->CombinedStatusBuffer = kmalloc(NewStatusBufferLength, 
+						  GFP_ATOMIC);
       if (Controller->CombinedStatusBuffer == NULL) return false;
       Controller->CombinedStatusBufferLength = NewStatusBufferLength;
       return true;
     }
-  NewStatusBuffer = (unsigned char *)
-    kmalloc(2 * Controller->CombinedStatusBufferLength, GFP_ATOMIC);
+  NewStatusBuffer = kmalloc(2 * Controller->CombinedStatusBufferLength, 
+			     GFP_ATOMIC);
   if (NewStatusBuffer == NULL)
     {
       DAC960_Warning("Unable to expand Combined Status Buffer - Truncating\n",
Signature · 1 line
-- 

---
~Randy

#4 lore raw
Quoted 10 lines · Randy Dunlap
Quoted 3 lines · On Sat, 6 Jan 2007 15:17:25 +0200 Ahmed S. Darwish wrote:

Hi all,
I'm not able to find the DAC960 block driver maintainer. If someones knows please reply :).

It's orphaned. Andrew can decide to merge this, or one of the storage or block maintainers could possibly do that. or it could go thru KJ, but then Andrew may still end up merging it.

Should Kernel janitors then care of cleaning orphaned files ?.
If so, I should forward it to Andrew Morton without CCing LKML again, right ?

Signature · 2 lines
Ahmed S. Darwish
http://darwish-07.blogspot.com
#5 lore raw
Quoted 1 line

Should Kernel janitors then care of cleaning orphaned files ?.

If you have the hardware to run tests then yes, if not then they are best handled with caution. Working is preferred to pretty.

Alan

#6 lore raw
In reply to Ahmed S. Darwish
Quoted 8 lines · On Sun, 7 Jan 2007 04:00:10 +0200 Ahmed S. Darwish wrote:
Quoted 6 lines · Randy Dunlap
Quoted 3 lines · On Sat, 6 Jan 2007 15:17:25 +0200 Ahmed S. Darwish wrote:

Hi all,
I'm not able to find the DAC960 block driver maintainer. If someones knows please reply :).

Quoted 6 lines
Quoted 4 lines

It's orphaned. Andrew can decide to merge this, or one of the storage or block maintainers could possibly do that. or it could go thru KJ, but then Andrew may still end up merging it.

Should Kernel janitors then care of cleaning orphaned files ?.

Kernel janitors could do that (IMO). It's up to you where you want to send the patch.

Quoted 1 line

If so, I should forward it to Andrew Morton without CCing LKML again, right ?

I would expect that Andrew has seen the patch. Anyway, you should always send the patch to a mailing list and usually to a specific maintainer also (like Andrew or a subsystem maintainer or the KJ maintainer). [except for some security-related patches]

---
~Randy

#7 lore raw
In reply to Ahmed S. Darwish
Quoted 8 lines · Ahmed S. Darwish
Quoted 6 lines · Randy Dunlap
Quoted 3 lines · On Sat, 6 Jan 2007 15:17:25 +0200 Ahmed S. Darwish wrote:

Hi all,
I'm not able to find the DAC960 block driver maintainer. If someones knows please reply :).

Quoted 8 lines
Quoted 4 lines

It's orphaned. Andrew can decide to merge this, or one of the storage or block maintainers could possibly do that. or it could go thru KJ, but then Andrew may still end up merging it.

Should Kernel janitors then care of cleaning orphaned files ?.
If so, I should forward it to Andrew Morton without CCing LKML again, right ?

Sending the patch to LKML and Cc'ing Andrew and KJ would be my approach.

Signature · 3 lines
Jesper Juhl <[email protected]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
#8 lore raw
In reply to Ahmed S. Darwish
Quoted 8 lines · Ahmed S. Darwish
Quoted 6 lines · Randy Dunlap
Quoted 3 lines · On Sat, 6 Jan 2007 15:17:25 +0200 Ahmed S. Darwish wrote:

Hi all,
I'm not able to find the DAC960 block driver maintainer. If someones knows please reply :).

Quoted 8 lines
Quoted 4 lines

It's orphaned. Andrew can decide to merge this, or one of the storage or block maintainers could possibly do that. or it could go thru KJ, but then Andrew may still end up merging it.

Should Kernel janitors then care of cleaning orphaned files ?.
If so, I should forward it to Andrew Morton without CCing LKML again, right ?

Sending the patch to LKML and Cc'ing Andrew and KJ would be my approach.

Signature · 3 lines
Jesper Juhl <[email protected]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
#9 lore raw
In reply to Ahmed S. Darwish
Quoted 3 lines · Ahmed S. Darwish

Hi all,
I'm not able to find the DAC960 block driver maintainer. If someones knows please reply :).

After Leonard Zubkoff unfortunately died in a helicopter accident Dave Olien <[email protected]> did some great work on the driver. Maybe he's still around?

Regards,
Toon.