Re: BusLogic check_region patch

2007-02-12 Thread Jeff Garzik
On Mon, Feb 12, 2007 at 04:27:04PM -0800, Michael Clay wrote:
> This patch is meant to remove the calls to check_region, a now
> deprecated function in order to get rid of compilation warning.  This
> was done by finding all calls to check_region and replacing them with
> calls to request_region.  check_region essentially was a wrapper around
> request_region, and was checking if the request_region returned a
> pointer or null.  As a result, I simply inlined the process of checking
> for null, eliminating the need to call the check_region wrapper.

Yes, but what happens when half the request_region() calls succeed, and
the other half fail?

You cannot simply substitute check_region with request_region.

Jeff



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


BusLogic check_region patch

2007-02-12 Thread Michael Clay
This patch is meant to remove the calls to check_region, a now
deprecated function in order to get rid of compilation warning.  This
was done by finding all calls to check_region and replacing them with
calls to request_region.  check_region essentially was a wrapper around
request_region, and was checking if the request_region returned a
pointer or null.  As a result, I simply inlined the process of checking
for null, eliminating the need to call the check_region wrapper.


--- drivers/scsi/BusLogic.c 2007-02-12 16:05:29.0 -0800
+++ /home/claym/sandbox/BusLogic.c  2007-02-12 16:11:23.0 -0800
@@ -579,17 +579,17 @@ static void __init BusLogic_InitializePr
/*
   Append the list of standard BusLogic MultiMaster ISA I/O Addresses.
 */
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe330 : check_region(0x330, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe330 : request_region(0x330, 
BusLogic_MultiMasterAddressCount, "Buslogic") != NULL)
BusLogic_AppendProbeAddressISA(0x330);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe334 : check_region(0x334, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe334 : request_region(0x334, 
BusLogic_MultiMasterAddressCount, "BusLogic") != NULL)
BusLogic_AppendProbeAddressISA(0x334);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe230 : check_region(0x230, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe230 : request_region(0x230, 
BusLogic_MultiMasterAddressCount, "BusLogic") != NULL)
BusLogic_AppendProbeAddressISA(0x230);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe234 : check_region(0x234, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe234 : request_region(0x234, 
BusLogic_MultiMasterAddressCount, "BusLogic") != NULL)
BusLogic_AppendProbeAddressISA(0x234);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe130 : check_region(0x130, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe130 : request_region(0x130, 
BusLogic_MultiMasterAddressCount, "BusLogic") != NULL)
BusLogic_AppendProbeAddressISA(0x130);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe134 : check_region(0x134, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe134 : request_region(0x134, 
BusLogic_MultiMasterAddressCount, "BusLogic") != NULL)
BusLogic_AppendProbeAddressISA(0x134);
 }
 
@@ -795,7 +795,7 @@ static int __init BusLogic_InitializeMul
   host adapters are probed.
 */
if (!BusLogic_ProbeOptions.NoProbeISA)
-   if (PrimaryProbeInfo->IO_Address == 0 && 
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe330 : 
check_region(0x330, BusLogic_MultiMasterAddressCount) == 0)) {
+   if (PrimaryProbeInfo->IO_Address == 0 && 
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe330 : 
request_region(0x330, BusLogic_MultiMasterAddressCount,"BusLogic") != NULL)) {
PrimaryProbeInfo->HostAdapterType = 
BusLogic_MultiMaster;
PrimaryProbeInfo->HostAdapterBusType = BusLogic_ISA_Bus;
PrimaryProbeInfo->IO_Address = 0x330;
@@ -805,15 +805,15 @@ static int __init BusLogic_InitializeMul
   omitting the Primary I/O Address which has already been handled.
 */
if (!BusLogic_ProbeOptions.NoProbeISA) {
-   if (!StandardAddressSeen[1] && 
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe334 : 
check_region(0x334, BusLogic_MultiMasterAddressCount) == 0))
+   if (!StandardAddressSeen[1] && 
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe334 : 
request_region(0x334, BusLogic_MultiMasterAddressCount, "BusLogic") != NULL))
BusLogic_AppendProbeAddressISA(0x334);
-   if (!StandardAddressSeen[2] && 
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe230 : 
check_region(0x230, BusLogic_MultiMasterAddressCount) == 0))
+   if (!StandardAddressSeen[2] && 
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe230 : 
request_region(0x230, BusLogic_MultiMasterAddressCount, "BusLogic") != NULL))
BusLogic_AppendProbeAddressISA(0x230);
-   if (!StandardAddressSeen[3] && 
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe234 : 

BusLogic check_region patch

2007-02-12 Thread Michael Clay
This patch is meant to remove the calls to check_region, a now
deprecated function in order to get rid of compilation warning.  This
was done by finding all calls to check_region and replacing them with
calls to request_region.  check_region essentially was a wrapper around
request_region, and was checking if the request_region returned a
pointer or null.  As a result, I simply inlined the process of checking
for null, eliminating the need to call the check_region wrapper.


--- drivers/scsi/BusLogic.c 2007-02-12 16:05:29.0 -0800
+++ /home/claym/sandbox/BusLogic.c  2007-02-12 16:11:23.0 -0800
@@ -579,17 +579,17 @@ static void __init BusLogic_InitializePr
/*
   Append the list of standard BusLogic MultiMaster ISA I/O Addresses.
 */
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe330 : check_region(0x330, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe330 : request_region(0x330, 
BusLogic_MultiMasterAddressCount, Buslogic) != NULL)
BusLogic_AppendProbeAddressISA(0x330);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe334 : check_region(0x334, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe334 : request_region(0x334, 
BusLogic_MultiMasterAddressCount, BusLogic) != NULL)
BusLogic_AppendProbeAddressISA(0x334);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe230 : check_region(0x230, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe230 : request_region(0x230, 
BusLogic_MultiMasterAddressCount, BusLogic) != NULL)
BusLogic_AppendProbeAddressISA(0x230);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe234 : check_region(0x234, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe234 : request_region(0x234, 
BusLogic_MultiMasterAddressCount, BusLogic) != NULL)
BusLogic_AppendProbeAddressISA(0x234);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe130 : check_region(0x130, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe130 : request_region(0x130, 
BusLogic_MultiMasterAddressCount, BusLogic) != NULL)
BusLogic_AppendProbeAddressISA(0x130);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe134 : check_region(0x134, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe134 : request_region(0x134, 
BusLogic_MultiMasterAddressCount, BusLogic) != NULL)
BusLogic_AppendProbeAddressISA(0x134);
 }
 
@@ -795,7 +795,7 @@ static int __init BusLogic_InitializeMul
   host adapters are probed.
 */
if (!BusLogic_ProbeOptions.NoProbeISA)
-   if (PrimaryProbeInfo-IO_Address == 0  
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe330 : 
check_region(0x330, BusLogic_MultiMasterAddressCount) == 0)) {
+   if (PrimaryProbeInfo-IO_Address == 0  
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe330 : 
request_region(0x330, BusLogic_MultiMasterAddressCount,BusLogic) != NULL)) {
PrimaryProbeInfo-HostAdapterType = 
BusLogic_MultiMaster;
PrimaryProbeInfo-HostAdapterBusType = BusLogic_ISA_Bus;
PrimaryProbeInfo-IO_Address = 0x330;
@@ -805,15 +805,15 @@ static int __init BusLogic_InitializeMul
   omitting the Primary I/O Address which has already been handled.
 */
if (!BusLogic_ProbeOptions.NoProbeISA) {
-   if (!StandardAddressSeen[1]  
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe334 : 
check_region(0x334, BusLogic_MultiMasterAddressCount) == 0))
+   if (!StandardAddressSeen[1]  
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe334 : 
request_region(0x334, BusLogic_MultiMasterAddressCount, BusLogic) != NULL))
BusLogic_AppendProbeAddressISA(0x334);
-   if (!StandardAddressSeen[2]  
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe230 : 
check_region(0x230, BusLogic_MultiMasterAddressCount) == 0))
+   if (!StandardAddressSeen[2]  
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe230 : 
request_region(0x230, BusLogic_MultiMasterAddressCount, BusLogic) != NULL))
BusLogic_AppendProbeAddressISA(0x230);
-   if (!StandardAddressSeen[3]  
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe234 : 
check_region(0x234, 

Re: BusLogic check_region patch

2007-02-12 Thread Jeff Garzik
On Mon, Feb 12, 2007 at 04:27:04PM -0800, Michael Clay wrote:
 This patch is meant to remove the calls to check_region, a now
 deprecated function in order to get rid of compilation warning.  This
 was done by finding all calls to check_region and replacing them with
 calls to request_region.  check_region essentially was a wrapper around
 request_region, and was checking if the request_region returned a
 pointer or null.  As a result, I simply inlined the process of checking
 for null, eliminating the need to call the check_region wrapper.

Yes, but what happens when half the request_region() calls succeed, and
the other half fail?

You cannot simply substitute check_region with request_region.

Jeff



-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/