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

irq: Simplify condition in irq_matrix_reserve()

The if condition in irq_matrix_reserve() can be much simpler.

While at it fix a typo in the comment.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210211070953.5914-1-jgross@suse.com

authored by

Juergen Gross and committed by
Thomas Gleixner
2c6b0218 ba9e6cab

+2 -3
+2 -3
kernel/irq/matrix.c
··· 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++;