linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Bartosz Golaszewski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, marc.zyngier@arm.com,
	linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com,
	brgl@bgdev.pl
Subject: [tip:irq/core] genirq/irq_sim: Check the return value of irq_sim_init() for error codes
Date: Fri, 9 Mar 2018 02:49:19 -0800	[thread overview]
Message-ID: <tip-28b6afa7d4456e759031bf83706b4be3689fba94@git.kernel.org> (raw)
In-Reply-To: <20180304121018.640-3-brgl@bgdev.pl>

Commit-ID:  28b6afa7d4456e759031bf83706b4be3689fba94
Gitweb:     https://git.kernel.org/tip/28b6afa7d4456e759031bf83706b4be3689fba94
Author:     Bartosz Golaszewski <brgl@bgdev.pl>
AuthorDate: Sun, 4 Mar 2018 13:10:17 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 9 Mar 2018 11:44:03 +0100

genirq/irq_sim: Check the return value of irq_sim_init() for error codes

As discussed with Marc Zyngier: irq_sim_init() and its devres variant
should return the base of the allocated interrupt range on success rather
than 0.

Make devm_irq_sim_init() check for an error code. This is a preparatory
change for modifying irq_sim_init() itself.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Link: https://lkml.kernel.org/r/20180304121018.640-3-brgl@bgdev.pl

---
 kernel/irq/irq_sim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c
index bd7dc1db6a80..05f0d7c1698a 100644
--- a/kernel/irq/irq_sim.c
+++ b/kernel/irq/irq_sim.c
@@ -124,7 +124,7 @@ int devm_irq_sim_init(struct device *dev, struct irq_sim *sim,
 		return -ENOMEM;
 
 	rv = irq_sim_init(sim, num_irqs);
-	if (rv) {
+	if (rv < 0) {
 		devres_free(dr);
 		return rv;
 	}

  reply	other threads:[~2018-03-09 10:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-04 12:10 [PATCH 0/3] irq_sim updates for v4.17 Bartosz Golaszewski
2018-03-04 12:10 ` [PATCH 1/3] irq/irq_sim: explicitly pull in slab.h Bartosz Golaszewski
2018-03-09 10:48   ` [tip:irq/core] genirq/irq_sim: Explicitly include slab.h tip-bot for Bartosz Golaszewski
2018-03-04 12:10 ` [PATCH 2/3] irq/irq_sim: modify the return value check for irq_sim_init() Bartosz Golaszewski
2018-03-09 10:49   ` tip-bot for Bartosz Golaszewski [this message]
2018-03-04 12:10 ` [PATCH 3/3] irq/irq_sim: return the base of the irq range from irq_sim_init() Bartosz Golaszewski
2018-03-09 10:49   ` [tip:irq/core] genirq/irq_sim: Return " tip-bot for Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-28b6afa7d4456e759031bf83706b4be3689fba94@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=brgl@bgdev.pl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).