The if condition in irq_matrix_reserve() can be much simpler. While at it fix a typo in the comment.
Unified · Split
| @@ -337,15 +337,14 @@ void irq_matrix_assign(struct irq_matrix *m, unsigned int bit) · 336 unmodified lines | ||
| 337 | 337 | * irq_matrix_reserve - Reserve interrupts |
| 338 | 338 | * @m: Matrix pointer |
| 339 | 339 | * |
| 340 | − * This is merily a book keeping call. It increments the number of globally | |
| 340 | + * This is merely a book keeping call. It increments the number of globally | |
| 341 | 341 | * reserved interrupt bits w/o actually allocating them. This allows to |
| 342 | 342 | * setup interrupt descriptors w/o assigning low level resources to it. |
| 343 | 343 | * The actual allocation happens when the interrupt gets activated. |
| 344 | 344 | */ |
| 345 | 345 | void irq_matrix_reserve(struct irq_matrix *m) |
| 346 | 346 | { |
| 347 | − if (m->global_reserved <= m->global_available && | |
| 348 | − m->global_reserved + 1 > m->global_available) | |
| 347 | + if (m->global_reserved == m->global_available) | |
| 349 | 348 | pr_warn("Interrupt reservation exceeds available resources\n"); |
| 350 | 349 | |
| 351 | 350 | m->global_reserved++; |