From: Markus Elfring <Markus.Elfring@web.de>
To: kernel-janitors@vger.kernel.org, Lee Jones <lee.jones@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] mfd: asic3: One function call less in asic3_irq_probe()
Date: Fri, 5 Jul 2019 20:30:08 +0200 [thread overview]
Message-ID: <e57f9ad8-24b2-5c1e-2a48-6b49e15e597c@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 5 Jul 2019 20:22:26 +0200
Avoid an extra function call by using a ternary operator instead of
a conditional statement.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/mfd/asic3.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 83b18c998d6f..50f5368fb170 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -401,11 +401,10 @@ static int __init asic3_irq_probe(struct platform_device *pdev)
irq_base = asic->irq_base;
for (irq = irq_base; irq < irq_base + ASIC3_NR_IRQS; irq++) {
- if (irq < asic->irq_base + ASIC3_NUM_GPIOS)
- irq_set_chip(irq, &asic3_gpio_irq_chip);
- else
- irq_set_chip(irq, &asic3_irq_chip);
-
+ irq_set_chip(irq,
+ (irq < asic->irq_base + ASIC3_NUM_GPIOS)
+ ? &asic3_gpio_irq_chip
+ : &asic3_irq_chip);
irq_set_chip_data(irq, asic);
irq_set_handler(irq, handle_level_irq);
irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
--
2.22.0
next reply other threads:[~2019-07-05 18:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-05 18:30 Markus Elfring [this message]
2019-07-05 18:30 [PATCH] mfd: asic3: One function call less in asic3_irq_probe() Markus Elfring
2019-07-07 0:52 ` Al Viro
2019-07-07 7:56 ` Markus Elfring
2019-07-08 10:18 ` Enrico Weigelt, metux IT consult
2019-07-08 6:36 ` Lee Jones
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=e57f9ad8-24b2-5c1e-2a48-6b49e15e597c@web.de \
--to=markus.elfring@web.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/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).