This patch removes a use of "idx" in pnp_check_port() and similar
functions, in preparation for replacing idx with a pointer to the
resource itself.
I split this out because it changes the behavior slightly: we used
to check for conflicts only with earlier resources, e.g., we checked
resource 2 against resources 0 and 1 but not against 3, 4, etc. Now
we will check against all resources except 2.
Since resources are assigned in ascending order, the old behavior
was probably safe, but I don't like to depend on that ordering.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Index: work10/drivers/pnp/resource.c
===================================================================
--- work10.orig/drivers/pnp/resource.c 2008-04-28 16:09:32.000000000 -0600
+++ work10/drivers/pnp/resource.c 2008-04-28 16:09:33.000000000 -0600
@@ -270,9 +270,9 @@
}
/* check for internal conflicts */
- for (i = 0; i < PNP_MAX_PORT && i != idx; i++) {
+ for (i = 0; i < PNP_MAX_PORT; i++) {
tres = &dev->res.port_resource[i];
- if (tres->flags & IORESOURCE_IO) {
+ if (tres != res && tres->flags & IORESOURCE_IO) {
tport = &tres->start;
tend = &tres->end;
if (ranged_conflict(port, end, tport, tend))
@@ -331,9 +331,9 @@
}
/* check for internal conflicts */
- for (i = 0; i < PNP_MAX_MEM && i != idx; i++) {
+ for (i = 0; i < PNP_MAX_MEM; i++) {
tres = &dev->res.mem_resource[i];
- if (tres->flags & IORESOURCE_MEM) {
+ if (tres != res && tres->flags & IORESOURCE_MEM) {
taddr = &tres->start;
tend = &tres->end;
if (ranged_conflict(addr, end, taddr, tend))
@@ -391,9 +391,9 @@
}
/* check for internal conflicts */
- for (i = 0; i < PNP_MAX_IRQ && i != idx; i++) {
+ for (i = 0; i < PNP_MAX_IRQ; i++) {
tres = &dev->res.irq_resource[i];
- if (tres->flags & IORESOURCE_IRQ) {
+ if (tres != res && tres->flags & IORESOURCE_IRQ) {
if (tres->start == *irq)
return 0;
}
@@ -465,9 +465,9 @@
}
/* check for internal conflicts */
- for (i = 0; i < PNP_MAX_DMA && i != idx; i++) {
+ for (i = 0; i < PNP_MAX_DMA; i++) {
tres = &dev->res.dma_resource[i];
- if (tres->flags & IORESOURCE_DMA) {
+ if (tres != res && tres->flags & IORESOURCE_DMA) {
if (tres->start == *dma)
return 0;
}
--
--
| Arjan van de Ven | [patch] Add basic sanity checks to the syscall execution patch |
| Ingo Molnar | Re: [patch] high-res timers: UP resume fix |
| Satyam Sharma | Re: 2.6.23-rc4-mm1 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| Eric Wong | Re: [RFC] Git config file reader in Perl (WIP) |
| Raimund Bauer | [wishlist] graphical diff |
| Junio C Hamano | Re: git-diff on touched files: bug or feature? |
| Steve | Re: Libification project (SoC) |
| François Rousseau | carp, ospf can't see carp state |
| Benjamin Bennett | Re: Multi-Threaded SSH/SCP made by university of Puttsburgh |
| Nuno Magalhães | Can't scp, ssh is slow to authenticate. |
| Brian | drm at vga1? |
| Olof Johansson | [PATCH 3/3] pasemi_mac: Disable interface on close |
| Ilpo Järvinen | Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+ |
| Chris Snook | [RFC] introducing the Atheros L2 Fast Ethernet driver |
| Steven Whitehouse | My 802.3ad is my bond |
