irq: simplify condition in irq_matrix_reserve()
PATCH 1/1 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 <[email protected]>
--- kernel/irq/matrix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/irq/matrix.c +2 -3
@@ -337,15 +337,14 @@ void irq_matrix_assign(struct irq_matrix *m, unsigned int bit)* irq_matrix_reserve - Reserve interrupts * @m: Matrix pointer * -* This is merily a book keeping call. It increments the number of globally +* This is merely a book keeping call. It increments the number of globally * reserved interrupt bits w/o actually allocating them. This allows to * setup interrupt descriptors w/o assigning low level resources to it. * The actual allocation happens when the interrupt gets activated. */ void irq_matrix_reserve (struct irq_matrix *m) { -if (m->global_reserved <= m->global_available && - m->global_reserved +1 > m->global_available) +if (m->global_reserved == m->global_available)pr_warn ("Interrupt reservation exceeds available resources\n" ); m->global_reserved++;
Signature · 1 line
2.26.2
[tip: irq/core] irq: Simplify condition in irq_matrix_reserve()
The following commit has been merged into the irq/core branch of tip:
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 2c6b02185cc608c19a22691fadc6ca2cd114c286 Gitweb: https://git.kernel.org/tip/2c6b02185cc608c19a22691fadc6ca2cd114c286 Author: Juergen Gross <[email protected]> AuthorDate: Thu, 11 Feb 2021 08:09:53 +01:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Wed, 17 Mar 2021 21:44:01 +01:00
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 <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>
--- kernel/irq/matrix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/irq/matrix.c +2 -3
@@ -337,15 +337,14 @@ void irq_matrix_assign(struct irq_matrix *m, unsigned int bit)* irq_matrix_reserve - Reserve interrupts * @m: Matrix pointer * -* This is merily a book keeping call. It increments the number of globally +* This is merely a book keeping call. It increments the number of globally * reserved interrupt bits w/o actually allocating them. This allows to * setup interrupt descriptors w/o assigning low level resources to it. * The actual allocation happens when the interrupt gets activated. */ void irq_matrix_reserve (struct irq_matrix *m) { -if (m->global_reserved <= m->global_available && - m->global_reserved +1 > m->global_available) +if (m->global_reserved == m->global_available)pr_warn ("Interrupt reservation exceeds available resources\n" ); m->global_reserved++;