aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 18:34:17 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:24 -0400
commitecfa935a2f7ef89543608f3ca05340c158c9a236 (patch)
tree7844721aa440c0585da0150e21d1cdccbefef053 /drivers
parent13575e81bb38fc797a5513ad1bd8e6fda17439b8 (diff)
PNP: use conventional "i" for loop indices
Cosmetic only: just use "i" instead of "tmp". Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-By: Rene Herman <rene.herman@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pnp/resource.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index ef8835ec5778..15995f9f8b7c 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -241,7 +241,7 @@ void pnp_free_option(struct pnp_option *option)
241 241
242int pnp_check_port(struct pnp_dev *dev, int idx) 242int pnp_check_port(struct pnp_dev *dev, int idx)
243{ 243{
244 int tmp; 244 int i;
245 struct pnp_dev *tdev; 245 struct pnp_dev *tdev;
246 resource_size_t *port, *end, *tport, *tend; 246 resource_size_t *port, *end, *tport, *tend;
247 247
@@ -260,18 +260,18 @@ int pnp_check_port(struct pnp_dev *dev, int idx)
260 } 260 }
261 261
262 /* check if the resource is reserved */ 262 /* check if the resource is reserved */
263 for (tmp = 0; tmp < 8; tmp++) { 263 for (i = 0; i < 8; i++) {
264 int rport = pnp_reserve_io[tmp << 1]; 264 int rport = pnp_reserve_io[i << 1];
265 int rend = pnp_reserve_io[(tmp << 1) + 1] + rport - 1; 265 int rend = pnp_reserve_io[(i << 1) + 1] + rport - 1;
266 if (ranged_conflict(port, end, &rport, &rend)) 266 if (ranged_conflict(port, end, &rport, &rend))
267 return 0; 267 return 0;
268 } 268 }
269 269
270 /* check for internal conflicts */ 270 /* check for internal conflicts */
271 for (tmp = 0; tmp < PNP_MAX_PORT && tmp != idx; tmp++) { 271 for (i = 0; i < PNP_MAX_PORT && i != idx; i++) {
272 if (dev->res.port_resource[tmp].flags & IORESOURCE_IO) { 272 if (dev->res.port_resource[i].flags & IORESOURCE_IO) {
273 tport = &dev->res.port_resource[tmp].start; 273 tport = &dev->res.port_resource[i].start;
274 tend = &dev->res.port_resource[tmp].end; 274 tend = &dev->res.port_resource[i].end;
275 if (ranged_conflict(port, end, tport, tend)) 275 if (ranged_conflict(port, end, tport, tend))
276 return 0; 276 return 0;
277 } 277 }
@@ -281,13 +281,13 @@ int pnp_check_port(struct pnp_dev *dev, int idx)
281 pnp_for_each_dev(tdev) { 281 pnp_for_each_dev(tdev) {
282 if (tdev == dev) 282 if (tdev == dev)
283 continue; 283 continue;
284 for (tmp = 0; tmp < PNP_MAX_PORT; tmp++) { 284 for (i = 0; i < PNP_MAX_PORT; i++) {
285 if (tdev->res.port_resource[tmp].flags & IORESOURCE_IO) { 285 if (tdev->res.port_resource[i].flags & IORESOURCE_IO) {
286 if (cannot_compare 286 if (cannot_compare
287 (tdev->res.port_resource[tmp].flags)) 287 (tdev->res.port_resource[i].flags))
288 continue; 288 continue;
289 tport = &tdev->res.port_resource[tmp].start; 289 tport = &tdev->res.port_resource[i].start;
290 tend = &tdev->res.port_resource[tmp].end; 290 tend = &tdev->res.port_resource[i].end;
291 if (ranged_conflict(port, end, tport, tend)) 291 if (ranged_conflict(port, end, tport, tend))
292 return 0; 292 return 0;
293 } 293 }
@@ -299,7 +299,7 @@ int pnp_check_port(struct pnp_dev *dev, int idx)
299 299
300int pnp_check_mem(struct pnp_dev *dev, int idx) 300int pnp_check_mem(struct pnp_dev *dev, int idx)
301{ 301{
302 int tmp; 302 int i;
303 struct pnp_dev *tdev; 303 struct pnp_dev *tdev;
304 resource_size_t *addr, *end, *taddr, *tend; 304 resource_size_t *addr, *end, *taddr, *tend;
305 305
@@ -318,18 +318,18 @@ int pnp_check_mem(struct pnp_dev *dev, int idx)
318 } 318 }
319 319
320 /* check if the resource is reserved */ 320 /* check if the resource is reserved */
321 for (tmp = 0; tmp < 8; tmp++) { 321 for (i = 0; i < 8; i++) {
322 int raddr = pnp_reserve_mem[tmp << 1]; 322 int raddr = pnp_reserve_mem[i << 1];
323 int rend = pnp_reserve_mem[(tmp << 1) + 1] + raddr - 1; 323 int rend = pnp_reserve_mem[(i << 1) + 1] + raddr - 1;
324 if (ranged_conflict(addr, end, &raddr, &rend)) 324 if (ranged_conflict(addr, end, &raddr, &rend))
325 return 0; 325 return 0;
326 } 326 }
327 327
328 /* check for internal conflicts */ 328 /* check for internal conflicts */
329 for (tmp = 0; tmp < PNP_MAX_MEM && tmp != idx; tmp++) { 329 for (i = 0; i < PNP_MAX_MEM && i != idx; i++) {
330 if (dev->res.mem_resource[tmp].flags & IORESOURCE_MEM) { 330 if (dev->res.mem_resource[i].flags & IORESOURCE_MEM) {
331 taddr = &dev->res.mem_resource[tmp].start; 331 taddr = &dev->res.mem_resource[i].start;
332 tend = &dev->res.mem_resource[tmp].end; 332 tend = &dev->res.mem_resource[i].end;
333 if (ranged_conflict(addr, end, taddr, tend)) 333 if (ranged_conflict(addr, end, taddr, tend))
334 return 0; 334 return 0;
335 } 335 }
@@ -339,13 +339,13 @@ int pnp_check_mem(struct pnp_dev *dev, int idx)
339 pnp_for_each_dev(tdev) { 339 pnp_for_each_dev(tdev) {
340 if (tdev == dev) 340 if (tdev == dev)
341 continue; 341 continue;
342 for (tmp = 0; tmp < PNP_MAX_MEM; tmp++) { 342 for (i = 0; i < PNP_MAX_MEM; i++) {
343 if (tdev->res.mem_resource[tmp].flags & IORESOURCE_MEM) { 343 if (tdev->res.mem_resource[i].flags & IORESOURCE_MEM) {
344 if (cannot_compare 344 if (cannot_compare
345 (tdev->res.mem_resource[tmp].flags)) 345 (tdev->res.mem_resource[i].flags))
346 continue; 346 continue;
347 taddr = &tdev->res.mem_resource[tmp].start; 347 taddr = &tdev->res.mem_resource[i].start;
348 tend = &tdev->res.mem_resource[tmp].end; 348 tend = &tdev->res.mem_resource[i].end;
349 if (ranged_conflict(addr, end, taddr, tend)) 349 if (ranged_conflict(addr, end, taddr, tend))
350 return 0; 350 return 0;
351 } 351 }
@@ -362,7 +362,7 @@ static irqreturn_t pnp_test_handler(int irq, void *dev_id)
362 362
363int pnp_check_irq(struct pnp_dev *dev, int idx) 363int pnp_check_irq(struct pnp_dev *dev, int idx)
364{ 364{
365 int tmp; 365 int i;
366 struct pnp_dev *tdev; 366 struct pnp_dev *tdev;
367 resource_size_t *irq = &dev->res.irq_resource[idx].start; 367 resource_size_t *irq = &dev->res.irq_resource[idx].start;
368 368
@@ -375,15 +375,15 @@ int pnp_check_irq(struct pnp_dev *dev, int idx)
375 return 0; 375 return 0;
376 376
377 /* check if the resource is reserved */ 377 /* check if the resource is reserved */
378 for (tmp = 0; tmp < 16; tmp++) { 378 for (i = 0; i < 16; i++) {
379 if (pnp_reserve_irq[tmp] == *irq) 379 if (pnp_reserve_irq[i] == *irq)
380 return 0; 380 return 0;
381 } 381 }
382 382
383 /* check for internal conflicts */ 383 /* check for internal conflicts */
384 for (tmp = 0; tmp < PNP_MAX_IRQ && tmp != idx; tmp++) { 384 for (i = 0; i < PNP_MAX_IRQ && i != idx; i++) {
385 if (dev->res.irq_resource[tmp].flags & IORESOURCE_IRQ) { 385 if (dev->res.irq_resource[i].flags & IORESOURCE_IRQ) {
386 if (dev->res.irq_resource[tmp].start == *irq) 386 if (dev->res.irq_resource[i].start == *irq)
387 return 0; 387 return 0;
388 } 388 }
389 } 389 }
@@ -414,12 +414,12 @@ int pnp_check_irq(struct pnp_dev *dev, int idx)
414 pnp_for_each_dev(tdev) { 414 pnp_for_each_dev(tdev) {
415 if (tdev == dev) 415 if (tdev == dev)
416 continue; 416 continue;
417 for (tmp = 0; tmp < PNP_MAX_IRQ; tmp++) { 417 for (i = 0; i < PNP_MAX_IRQ; i++) {
418 if (tdev->res.irq_resource[tmp].flags & IORESOURCE_IRQ) { 418 if (tdev->res.irq_resource[i].flags & IORESOURCE_IRQ) {
419 if (cannot_compare 419 if (cannot_compare
420 (tdev->res.irq_resource[tmp].flags)) 420 (tdev->res.irq_resource[i].flags))
421 continue; 421 continue;
422 if ((tdev->res.irq_resource[tmp].start == *irq)) 422 if ((tdev->res.irq_resource[i].start == *irq))
423 return 0; 423 return 0;
424 } 424 }
425 } 425 }
@@ -431,7 +431,7 @@ int pnp_check_irq(struct pnp_dev *dev, int idx)
431int pnp_check_dma(struct pnp_dev *dev, int idx) 431int pnp_check_dma(struct pnp_dev *dev, int idx)
432{ 432{
433#ifndef CONFIG_IA64 433#ifndef CONFIG_IA64
434 int tmp; 434 int i;
435 struct pnp_dev *tdev; 435 struct pnp_dev *tdev;
436 resource_size_t *dma = &dev->res.dma_resource[idx].start; 436 resource_size_t *dma = &dev->res.dma_resource[idx].start;
437 437
@@ -444,15 +444,15 @@ int pnp_check_dma(struct pnp_dev *dev, int idx)
444 return 0; 444 return 0;
445 445
446 /* check if the resource is reserved */ 446 /* check if the resource is reserved */
447 for (tmp = 0; tmp < 8; tmp++) { 447 for (i = 0; i < 8; i++) {
448 if (pnp_reserve_dma[tmp] == *dma) 448 if (pnp_reserve_dma[i] == *dma)
449 return 0; 449 return 0;
450 } 450 }
451 451
452 /* check for internal conflicts */ 452 /* check for internal conflicts */
453 for (tmp = 0; tmp < PNP_MAX_DMA && tmp != idx; tmp++) { 453 for (i = 0; i < PNP_MAX_DMA && i != idx; i++) {
454 if (dev->res.dma_resource[tmp].flags & IORESOURCE_DMA) { 454 if (dev->res.dma_resource[i].flags & IORESOURCE_DMA) {
455 if (dev->res.dma_resource[tmp].start == *dma) 455 if (dev->res.dma_resource[i].start == *dma)
456 return 0; 456 return 0;
457 } 457 }
458 } 458 }
@@ -469,12 +469,12 @@ int pnp_check_dma(struct pnp_dev *dev, int idx)
469 pnp_for_each_dev(tdev) { 469 pnp_for_each_dev(tdev) {
470 if (tdev == dev) 470 if (tdev == dev)
471 continue; 471 continue;
472 for (tmp = 0; tmp < PNP_MAX_DMA; tmp++) { 472 for (i = 0; i < PNP_MAX_DMA; i++) {
473 if (tdev->res.dma_resource[tmp].flags & IORESOURCE_DMA) { 473 if (tdev->res.dma_resource[i].flags & IORESOURCE_DMA) {
474 if (cannot_compare 474 if (cannot_compare
475 (tdev->res.dma_resource[tmp].flags)) 475 (tdev->res.dma_resource[i].flags))
476 continue; 476 continue;
477 if ((tdev->res.dma_resource[tmp].start == *dma)) 477 if ((tdev->res.dma_resource[i].start == *dma))
478 return 0; 478 return 0;
479 } 479 }
480 } 480 }