Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irq_domain: remove NO_IRQ from irq domain code

zero always means no irq when using irq domains. Get rid of the NO_IRQ
references.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>

+19 -19
+19 -19
kernel/irq/irqdomain.c
··· 108 108 case IRQ_DOMAIN_MAP_LINEAR: 109 109 rmap = (unsigned int *)(host + 1); 110 110 for (i = 0; i < revmap_arg; i++) 111 - rmap[i] = NO_IRQ; 111 + rmap[i] = 0; 112 112 host->revmap_data.linear.size = revmap_arg; 113 113 host->revmap_data.linear.revmap = rmap; 114 114 break; ··· 218 218 WARN_ON(host->revmap_type != IRQ_DOMAIN_MAP_NOMAP); 219 219 220 220 virq = irq_alloc_desc_from(1, 0); 221 - if (virq == NO_IRQ) { 221 + if (!virq) { 222 222 pr_debug("irq: create_direct virq allocation failed\n"); 223 - return NO_IRQ; 223 + return 0; 224 224 } 225 225 if (virq >= irq_virq_count) { 226 226 pr_err("ERROR: no free irqs available below %i maximum\n", ··· 233 233 234 234 if (irq_setup_virq(host, virq, virq)) { 235 235 irq_free_desc(virq); 236 - return NO_IRQ; 236 + return 0; 237 237 } 238 238 239 239 return virq; ··· 263 263 printk(KERN_WARNING "irq_create_mapping called for" 264 264 " NULL host, hwirq=%lx\n", hwirq); 265 265 WARN_ON(1); 266 - return NO_IRQ; 266 + return 0; 267 267 } 268 268 pr_debug("irq: -> using host @%p\n", host); 269 269 270 270 /* Check if mapping already exists */ 271 271 virq = irq_find_mapping(host, hwirq); 272 - if (virq != NO_IRQ) { 272 + if (virq) { 273 273 pr_debug("irq: -> existing mapping on virq %d\n", virq); 274 274 return virq; 275 275 } ··· 279 279 /* Handle legacy */ 280 280 virq = (unsigned int)hwirq; 281 281 if (virq == 0 || virq >= NUM_ISA_INTERRUPTS) 282 - return NO_IRQ; 282 + return 0; 283 283 return virq; 284 284 } else { 285 285 /* Allocate a virtual interrupt number */ ··· 289 289 virq = irq_alloc_desc_from(hint, 0); 290 290 if (!virq) 291 291 virq = irq_alloc_desc_from(1, 0); 292 - if (virq == NO_IRQ) { 292 + if (!virq) { 293 293 pr_debug("irq: -> virq allocation failed\n"); 294 - return NO_IRQ; 294 + return 0; 295 295 } 296 296 } 297 297 298 298 if (irq_setup_virq(host, virq, hwirq)) { 299 299 if (host->revmap_type != IRQ_DOMAIN_MAP_LEGACY) 300 300 irq_free_desc(virq); 301 - return NO_IRQ; 301 + return 0; 302 302 } 303 303 304 304 pr_debug("irq: irq %lu on host %s mapped to virtual irq %u\n", ··· 323 323 if (host == NULL) { 324 324 printk(KERN_WARNING "irq: no irq host found for %s !\n", 325 325 controller->full_name); 326 - return NO_IRQ; 326 + return 0; 327 327 } 328 328 329 329 /* If host has no translation, then we assume interrupt line */ ··· 332 332 else { 333 333 if (host->ops->xlate(host, controller, intspec, intsize, 334 334 &hwirq, &type)) 335 - return NO_IRQ; 335 + return 0; 336 336 } 337 337 338 338 /* Create mapping */ 339 339 virq = irq_create_mapping(host, hwirq); 340 - if (virq == NO_IRQ) 340 + if (!virq) 341 341 return virq; 342 342 343 343 /* Set type if specified and different than the current one */ ··· 358 358 struct irq_domain *host; 359 359 irq_hw_number_t hwirq; 360 360 361 - if (virq == NO_IRQ || !irq_data) 361 + if (!virq || !irq_data) 362 362 return; 363 363 364 364 host = irq_data->domain; ··· 387 387 switch(host->revmap_type) { 388 388 case IRQ_DOMAIN_MAP_LINEAR: 389 389 if (hwirq < host->revmap_data.linear.size) 390 - host->revmap_data.linear.revmap[hwirq] = NO_IRQ; 390 + host->revmap_data.linear.revmap[hwirq] = 0; 391 391 break; 392 392 case IRQ_DOMAIN_MAP_TREE: 393 393 mutex_lock(&revmap_trees_mutex); ··· 422 422 if (host == NULL) 423 423 host = irq_default_host; 424 424 if (host == NULL) 425 - return NO_IRQ; 425 + return 0; 426 426 427 427 /* legacy -> bail early */ 428 428 if (host->revmap_type == IRQ_DOMAIN_MAP_LEGACY) ··· 440 440 if (i >= irq_virq_count) 441 441 i = 1; 442 442 } while(i != hint); 443 - return NO_IRQ; 443 + return 0; 444 444 } 445 445 EXPORT_SYMBOL_GPL(irq_find_mapping); 446 446 ··· 493 493 if (WARN_ON(host->revmap_type != IRQ_DOMAIN_MAP_TREE)) 494 494 return; 495 495 496 - if (virq != NO_IRQ) { 496 + if (virq) { 497 497 mutex_lock(&revmap_trees_mutex); 498 498 radix_tree_insert(&host->revmap_data.tree, hwirq, irq_data); 499 499 mutex_unlock(&revmap_trees_mutex); ··· 527 527 return irq_find_mapping(host, hwirq); 528 528 529 529 /* Fill up revmap with slow path if no mapping found */ 530 - if (unlikely(revmap[hwirq] == NO_IRQ)) 530 + if (unlikely(!revmap[hwirq])) 531 531 revmap[hwirq] = irq_find_mapping(host, hwirq); 532 532 533 533 return revmap[hwirq];