mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] irq: simplify condition in irq_matrix_reserve()
@ 2021-02-11  7:09 Juergen Gross
  2021-03-17 20:47 ` [tip: irq/core] irq: Simplify " tip-bot2 for Juergen Gross
  0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2021-02-11  7:09 UTC (permalink / raw)
  To: xen-devel, linux-kernel; +Cc: Juergen Gross, Thomas Gleixner

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>
---
 kernel/irq/matrix.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/irq/matrix.c b/kernel/irq/matrix.c
index 651a4ad6d711..1f02a5c801a3 100644
--- a/kernel/irq/matrix.c
+++ b/kernel/irq/matrix.c
@@ -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++;
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip: irq/core] irq: Simplify condition in irq_matrix_reserve()
  2021-02-11  7:09 [PATCH] irq: simplify condition in irq_matrix_reserve() Juergen Gross
@ 2021-03-17 20:47 ` tip-bot2 for Juergen Gross
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Juergen Gross @ 2021-03-17 20:47 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Juergen Gross, Thomas Gleixner, x86, linux-kernel, maz

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 <jgross@suse.com>
AuthorDate:    Thu, 11 Feb 2021 08:09:53 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
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 <jgross@suse.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210211070953.5914-1-jgross@suse.com

---
 kernel/irq/matrix.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/irq/matrix.c b/kernel/irq/matrix.c
index 7a9465f..6f8b1d1 100644
--- a/kernel/irq/matrix.c
+++ b/kernel/irq/matrix.c
@@ -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++;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-17 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11  7:09 [PATCH] irq: simplify condition in irq_matrix_reserve() Juergen Gross
2021-03-17 20:47 ` [tip: irq/core] irq: Simplify " tip-bot2 for Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®