BusLogic: eliminate deprecated check_region() calls
Subsystems (3)
PATCH 1/1 BusLogic: eliminate deprecated check_region() calls
This patch eliminates the deprecated calls to check_region(). They are replaced with request_region(). New version is a little more wordy due to the fact that requst_region() cannot be easily compacted into the ? operator.
(BusLogic.c was not changed between 2.6.14-rc1.kj and 2.6.14-rc2.kj)
This patch eliminates the deprecated calls to check_region(). It's replaced with request_region(). New version is a little more wordy due to the fact that requst_region() cannot be easily compacted into the ? operator.
---
drivers/scsi/BusLogic.c | 133 ++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 107 insertions(+), 26 deletions(-)
drivers/scsi/BusLogic.c renamed from drivers/scsi/BusLogic.c~deprecated_check_region_BusLogic +107 -26
@@ -582,18 +582,45 @@ 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 ) -BusLogic_AppendProbeAddressISA (0x330 ); -if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe334 :check_region (0x334 , BusLogic_MultiMasterAddressCount) ==0 ) -BusLogic_AppendProbeAddressISA (0x334 ); -if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe230 :check_region (0x230 , BusLogic_MultiMasterAddressCount) ==0 ) -BusLogic_AppendProbeAddressISA (0x230 ); -if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe234 :check_region (0x234 , BusLogic_MultiMasterAddressCount) ==0 ) -BusLogic_AppendProbeAddressISA (0x234 ); -if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe130 :check_region (0x130 , BusLogic_MultiMasterAddressCount) ==0 ) -BusLogic_AppendProbeAddressISA (0x130 ); -if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe134 :check_region (0x134 , BusLogic_MultiMasterAddressCount) ==0 ) -BusLogic_AppendProbeAddressISA (0x134 ); +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe330) +BusLogic_AppendProbeAddressISA (0x330 ); +if (BusLogic_ProbeOptions.Probe334) +BusLogic_AppendProbeAddressISA (0x334 ); +if (BusLogic_ProbeOptions.Probe230) +BusLogic_AppendProbeAddressISA (0x230 ); +if (BusLogic_ProbeOptions.Probe234) +BusLogic_AppendProbeAddressISA (0x234 ); +if (BusLogic_ProbeOptions.Probe130) +BusLogic_AppendProbeAddressISA (0x130 ); +if (BusLogic_ProbeOptions.Probe134) +BusLogic_AppendProbeAddressISA (0x134 ); + }else { +if (request_region (0x330 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +BusLogic_AppendProbeAddressISA (0x330 ); +release_region (0x330 , BusLogic_MultiMasterAddressCount); + } +if (request_region (0x334 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +BusLogic_AppendProbeAddressISA (0x334 ); +release_region (0x334 , BusLogic_MultiMasterAddressCount); + } +if (request_region (0x230 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +BusLogic_AppendProbeAddressISA (0x230 ); +release_region (0x230 , BusLogic_MultiMasterAddressCount); + } +if (request_region (0x234 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +BusLogic_AppendProbeAddressISA (0x234 ); +release_region (0x234 , BusLogic_MultiMasterAddressCount); + } +if (request_region (0x130 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +BusLogic_AppendProbeAddressISA (0x130 ); +release_region (0x130 , BusLogic_MultiMasterAddressCount); + } +if (request_region (0x134 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +BusLogic_AppendProbeAddressISA (0x134 ); +release_region (0x134 , BusLogic_MultiMasterAddressCount); + } + } }
@@ -798,26 +825,80 @@ static int __init BusLogic_InitializeMulhost adapters are probed. */ if (!BusLogic_ProbeOptions.NoProbeISA) -if (PrimaryProbeInfo->IO_Address ==0 && (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe330 :check_region (0x330 , BusLogic_MultiMasterAddressCount) ==0 )) { - PrimaryProbeInfo->HostAdapterType = BusLogic_MultiMaster; - PrimaryProbeInfo->HostAdapterBusType = BusLogic_ISA_Bus; - PrimaryProbeInfo->IO_Address =0x330 ; +if (PrimaryProbeInfo->IO_Address ==0 ) { +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe330) { +/* BusLogic_ProbeOptions.LimitedProbeISA && BusLogic_ProbeOptions.Probe330 */ + PrimaryProbeInfo->HostAdapterType = BusLogic_MultiMaster; + PrimaryProbeInfo->HostAdapterBusType = BusLogic_ISA_Bus; + PrimaryProbeInfo->IO_Address =0x330 ; + } + }else { +if (request_region (0x330 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +/* BusLogic_ProbeOptions.LimitedProbeISA && request_region */ +release_region (0x330 , BusLogic_MultiMasterAddressCount); + PrimaryProbeInfo->HostAdapterType = BusLogic_MultiMaster; + PrimaryProbeInfo->HostAdapterBusType = BusLogic_ISA_Bus; + PrimaryProbeInfo->IO_Address =0x330 ; + } + } } +/* Append the list of standard BusLogic MultiMaster ISA I/O Addresses, 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 )) -BusLogic_AppendProbeAddressISA (0x334 ); -if (!StandardAddressSeen[2 ] && (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe230 :check_region (0x230 , BusLogic_MultiMasterAddressCount) ==0 )) -BusLogic_AppendProbeAddressISA (0x230 ); -if (!StandardAddressSeen[3 ] && (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe234 :check_region (0x234 , BusLogic_MultiMasterAddressCount) ==0 )) -BusLogic_AppendProbeAddressISA (0x234 ); -if (!StandardAddressSeen[4 ] && (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe130 :check_region (0x130 , BusLogic_MultiMasterAddressCount) ==0 )) -BusLogic_AppendProbeAddressISA (0x130 ); -if (!StandardAddressSeen[5 ] && (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe134 :check_region (0x134 , BusLogic_MultiMasterAddressCount) ==0 )) -BusLogic_AppendProbeAddressISA (0x134 ); +if (!StandardAddressSeen[1 ]) { +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe334) +BusLogic_AppendProbeAddressISA (0x334 ); +else if (request_region (0x334 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +release_region (0x334 , BusLogic_MultiMasterAddressCount); +BusLogic_AppendProbeAddressISA (0x334 ); + } + } + } +if (!StandardAddressSeen[2 ]) { +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe334) +BusLogic_AppendProbeAddressISA (0x230 ); +else if (request_region (0x230 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +release_region (0x230 , BusLogic_MultiMasterAddressCount); +BusLogic_AppendProbeAddressISA (0x230 ); + } + } + } +if (!StandardAddressSeen[3 ]) { +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe334) +BusLogic_AppendProbeAddressISA (0x234 ); +else if (request_region (0x234 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +release_region (0x234 , BusLogic_MultiMasterAddressCount); +BusLogic_AppendProbeAddressISA (0x234 ); + } + } + } +if (!StandardAddressSeen[4 ]) { +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe334) +BusLogic_AppendProbeAddressISA (0x130 ); +else if (request_region (0x130 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +release_region (0x130 , BusLogic_MultiMasterAddressCount); +BusLogic_AppendProbeAddressISA (0x130 ); + } + } + } +if (!StandardAddressSeen[5 ]) { +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe334) +BusLogic_AppendProbeAddressISA (0x134 ); +else if (request_region (0x134 , BusLogic_MultiMasterAddressCount,"BusLogic" )) { +release_region (0x134 , BusLogic_MultiMasterAddressCount); +BusLogic_AppendProbeAddressISA (0x134 ); + } + } + } }/* Iterate over the older non-compliant MultiMaster PCI Host Adapters,
_
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 4 lines · Jesse Millan
This patch eliminates the deprecated calls to
check_region(). They are replaced withrequest_region(). New version is a little more wordy due to the fact thatrequst_region()cannot be easily compacted into the ? operator.
Can you split it in two parts?
1) making selecting logic more readable:
drivers/scsi/BusLogic.c static void __init BusLogic_InitializePr · line 587
Quoted 5 lines
drivers/scsi/BusLogic.c renamed from drivers/scsi/BusLogic.c~deprecated_check_region_BusLogic +3
-2-if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe134 :check_region (0x134 , BusLogic_MultiMasterAddressCount) ==0 ) -BusLogic_AppendProbeAddressISA (0x134 ); +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe330) +BusLogic_AppendProbeAddressISA (0x330 );
2) introducing request_region()
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 21 lines · Alexey Dobriyan
Quoted 5 lines · Jesse Millan
This patch eliminates the deprecated calls to
check_region(). They are replaced withrequest_region(). New version is a little more wordy due to the fact thatrequst_region()cannot be easily compacted into the ? operator.Can you split it in two parts?
1) making selecting logic more readable:
drivers/scsi/BusLogic.c static void __init BusLogic_InitializePr · line 587
Quoted 7 lines
- if (BusLogic_ProbeOptions.LimitedProbeISA ?
BusLogic_ProbeOptions.Probe134 :check_region(0x134, BusLogic_MultiMasterAddressCount)== 0)drivers/scsi/BusLogic.c renamed from drivers/scsi/BusLogic.c~deprecated_check_region_BusLogic +3
-1-BusLogic_AppendProbeAddressISA (0x134 ); +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe330) +BusLogic_AppendProbeAddressISA (0x330 );
Quoted 3 lines
2) introducing
request_region()
Like so? I think this is a little clearer.
- if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe330 : check_region(0x330, BusLogic_MultiMasterAddressCount) == 0)
+ if (BusLogic_ProbeOptions.LimitedProbeISA && BusLogic_ProbeOptions.Probe330)
+ BusLogic_AppendProbeAddressISA(0x330);
+ else if (request_region(0x330, BusLogic_MultiMasterAddressCount, "BusLogic")) {
+ release_region(0x330, BusLogic_MultiMasterAddressCount);
BusLogic_AppendProbeAddressISA(0x330);...
--
Jesse Millan
CNS Unix Team
Portland State University
Phone: (503) 725-9151
Homepage: www.system-calls.com
grep --recursive --ignore-case 'SHOULD WORK' /usr/src/linux/* | wc
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 19 lines · Jesse Millan
Quoted 18 lines · Alexey Dobriyan
Quoted 4 lines · Jesse Millan
This patch eliminates the deprecated calls to
check_region(). They are replaced withrequest_region(). New version is a little more wordy due to the fact thatrequst_region()cannot be easily compacted into the ? operator.Can you split it in two parts?
1) making selecting logic more readable:
Quoted 7 lines
- if (BusLogic_ProbeOptions.LimitedProbeISA ?
BusLogic_ProbeOptions.Probe134 :check_region(0x134, BusLogic_MultiMasterAddressCount)== 0)drivers/scsi/BusLogic.c renamed from drivers/scsi/BusLogic.c~deprecated_check_region_BusLogic +3
-1-BusLogic_AppendProbeAddressISA (0x134 ); +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe330) +BusLogic_AppendProbeAddressISA (0x330 );
Quoted 3 lines
Quoted 1 line
2) introducing
request_region()Like so?
Actually not.
Quoted 10 lines
I think this is a little clearer.
- if (BusLogic_ProbeOptions.LimitedProbeISA ?
BusLogic_ProbeOptions.Probe330 :check_region(0x330, BusLogic_MultiMasterAddressCount)== 0)
+ if (BusLogic_ProbeOptions.LimitedProbeISA &&
BusLogic_ProbeOptions.Probe330)(quoted diff) +2
-0+ BusLogic_AppendProbeAddressISA(0x330); + else if (request_region(0x330,
BusLogic_MultiMasterAddressCount, "BusLogic")) {
Quoted 2 lines
+ release_region(0x330, BusLogic_MultiMasterAddressCount);
BusLogic_AppendProbeAddressISA(0x330);What we have:
if (A ? B(330) : C(330)) D(330); if (A ? B(334) : C(334)) D(334); if (A ? B(230) : C(230)) D(230); if (A ? B(234) : C(234)) D(234); if (A ? B(130) : C(130)) D(130); if (A ? B(134) : C(134)) D(134);
Unless I'm low on coffee, this should be equivalent to:
if (A) {
if (B(330))
D(330);
if (B(334))
D(334);
if (B(230))
D(230);
if (B(234))
D(234);
if (B(130))
D(130);
if (B(134))
D(134);
} else {
if (C(330))
D(330);
if (C(334))
D(334);
if (C(230))
D(230);
if (C(234))
D(234);
if (C(130))
D(130);
if (C(134))
D(134);
}C() is check_region(). You can quite easily put request_region()/release_region() instead, but name BusLogic_InitializeProbeInfoListISA suggests we should just fill some list...
Dunno what to do next, the driver is un[censored]readable. :-/
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 86 lines · Alexey Dobriyan
Quoted 24 lines · Jesse Millan
Quoted 22 lines · Alexey Dobriyan
Quoted 5 lines · Jesse Millan
This patch eliminates the deprecated calls to
check_region(). They are replaced withrequest_region(). New version is a little more wordy due to the fact thatrequst_region()cannot be easily compacted into the ? operator.Can you split it in two parts?
1) making selecting logic more readable:
Quoted 8 lines
- if (BusLogic_ProbeOptions.LimitedProbeISA ?
BusLogic_ProbeOptions.Probe134 :check_region(0x134, BusLogic_MultiMasterAddressCount)== 0)drivers/scsi/BusLogic.c renamed from drivers/scsi/BusLogic.c~deprecated_check_region_BusLogic +3
-1-BusLogic_AppendProbeAddressISA (0x134 ); +if (BusLogic_ProbeOptions.LimitedProbeISA) { +if (BusLogic_ProbeOptions.Probe330) +BusLogic_AppendProbeAddressISA (0x330 );Quoted 5 lines
Quoted 2 lines
2) introducing
request_region()Like so?
Actually not.
Quoted 11 lines
I think this is a little clearer.
- if (BusLogic_ProbeOptions.LimitedProbeISA ?
BusLogic_ProbeOptions.Probe330 :check_region(0x330, BusLogic_MultiMasterAddressCount)== 0)
+ if (BusLogic_ProbeOptions.LimitedProbeISA &&
BusLogic_ProbeOptions.Probe330)(quoted diff) +2
-0+ BusLogic_AppendProbeAddressISA(0x330); + else if (request_region(0x330,
BusLogic_MultiMasterAddressCount, "BusLogic")) {
+ release_region(0x330,Quoted 3 lines
BusLogic_MultiMasterAddressCount); BusLogic_AppendProbeAddressISA(0x330);What we have:
if (A ? B(330) : C(330)) D(330); if (A ? B(334) : C(334)) D(334); if (A ? B(230) : C(230)) D(230); if (A ? B(234) : C(234)) D(234); if (A ? B(130) : C(130)) D(130); if (A ? B(134) : C(134)) D(134);Unless I'm low on coffee, this should be equivalent to:
if (A) { if (B(330)) D(330); if (B(334)) D(334); if (B(230)) D(230); if (B(234)) D(234); if (B(130)) D(130); if (B(134)) D(134); } else { if (C(330)) D(330); if (C(334)) D(334); if (C(230))
Quoted 8 lines
D(230);
if (C(234))
D(234);
if (C(130))
D(130);
if (C(134))
D(134);
}Which is what I had in the first place right?
Here is the relevant snippet of the first patch:
- if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe330 : check_region(0x330, BusLogic_MultiMasterAddressCount) == 0)
- BusLogic_AppendProbeAddressISA(0x330);
- if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe334 : check_region(0x334, BusLogic_MultiMasterAddressCount) == 0)
- BusLogic_AppendProbeAddressISA(0x334);
- if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe230 : check_region(0x230, BusLogic_MultiMasterAddressCount) == 0)
- BusLogic_AppendProbeAddressISA(0x230);
- if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe234 : check_region(0x234, BusLogic_MultiMasterAddressCount) == 0)
- BusLogic_AppendProbeAddressISA(0x234);
- if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe130 : check_region(0x130, BusLogic_MultiMasterAddressCount) == 0)
- BusLogic_AppendProbeAddressISA(0x130);
- if (BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe134 : check_region(0x134, BusLogic_MultiMasterAddressCount) == 0)
- BusLogic_AppendProbeAddressISA(0x134);
+ if (BusLogic_ProbeOptions.LimitedProbeISA) {
+ if (BusLogic_ProbeOptions.Probe330)
+ BusLogic_AppendProbeAddressISA(0x330);
+ if (BusLogic_ProbeOptions.Probe334)
+ BusLogic_AppendProbeAddressISA(0x334);
+ if (BusLogic_ProbeOptions.Probe230)
+ BusLogic_AppendProbeAddressISA(0x230);
+ if (BusLogic_ProbeOptions.Probe234)
+ BusLogic_AppendProbeAddressISA(0x234);
+ if (BusLogic_ProbeOptions.Probe130)
+ BusLogic_AppendProbeAddressISA(0x130);
+ if (BusLogic_ProbeOptions.Probe134)
+ BusLogic_AppendProbeAddressISA(0x134);
+ } else {
+ if (request_region(0x330, BusLogic_MultiMasterAddressCount, "BusLogic")) {
+ BusLogic_AppendProbeAddressISA(0x330);
+ release_region(0x330, BusLogic_MultiMasterAddressCount);
+ }
+ if (request_region(0x334, BusLogic_MultiMasterAddrhessCount, "BusLogic")) {
+ BusLogic_AppendProbeAddressISA(0x334);
+ release_region(0x334, BusLogic_MultiMasterAddressCount);
+ }dd
+ if (request_region(0x230, BusLogic_MultiMasterAddressCount, "BusLogic")) {
+ BusLogic_AppendProbeAddressISA(0x230);
+ release_region(0x230, BusLogic_MultiMasterAddressCount);
+ }
+ if (request_region(0x234, BusLogic_MultiMasterAddressCount, "BusLogic")) {
+ BusLogic_AppendProbeAddressISA(0x234);
+ release_region(0x234, BusLogic_MultiMasterAddressCount);
+ }
+ if (request_region(0x130, BusLogic_MultiMasterAddressCount, "BusLogic")) {
+ BusLogic_AppendProbeAddressISA(0x130);
+ release_region(0x130, BusLogic_MultiMasterAddressCount);
+ }
+ if (request_region(0x134, BusLogic_MultiMasterAddressCount, "BusLogic")) {
+ BusLogic_AppendProbeAddressISA(0x134);
+ release_region(0x134, BusLogic_MultiMasterAddressCount);
+ }
+ }
I should reverse the order of BusLogic_AppendProbeAddressISA() release_region() so that it releases first though. But that's all I see.
Quoted 9 lines
C()ischeck_region(). You can quite easily put request_region()/release_region() instead, but nameBusLogic_InitializeProbeInfoListISAsuggests we should just fill some list...Dunno what to do next, the driver is un[censored]readable. :-/
Your right, there is no real optimizations made here. The patch keeps the original flow except for the fact that it eliminates the depreciated check_region calls...
--
Jesse Millan
CNS Unix Team
Portland State University
Phone: (503) 725-9151
Homepage: www.system-calls.com
The question of whether a computer can think is no more interesting than the question of whether a submarine can swim. ~E.W. Dijkstra
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors