From: Hugo Villeneuve <hugo@hugovil.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Hugo Villeneuve <hvilleneuve@dimonoff.com>,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] rtc: isl1208: avoid unnecessary rc variable tests
Date: Wed, 5 Jan 2022 14:34:39 -0500 [thread overview]
Message-ID: <20220105193440.151359-1-hugo@hugovil.com> (raw)
From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
The rc variable doesn't need to be tested a second time when the <if> block
evaluates to false.
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
drivers/rtc/rtc-isl1208.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
index 182dfa605515..c7f04df5a0b6 100644
--- a/drivers/rtc/rtc-isl1208.c
+++ b/drivers/rtc/rtc-isl1208.c
@@ -880,15 +880,17 @@ isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id)
if (rc)
return rc;
- if (client->irq > 0)
+ if (client->irq > 0) {
rc = isl1208_setup_irq(client, client->irq);
- if (rc)
- return rc;
+ if (rc)
+ return rc;
+ }
- if (evdet_irq > 0 && evdet_irq != client->irq)
+ if (evdet_irq > 0 && evdet_irq != client->irq) {
rc = isl1208_setup_irq(client, evdet_irq);
- if (rc)
- return rc;
+ if (rc)
+ return rc;
+ }
rc = devm_rtc_nvmem_register(isl1208->rtc, &isl1208->nvmem_config);
if (rc)
--
2.30.2
next reply other threads:[~2022-01-05 19:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 19:34 Hugo Villeneuve [this message]
2022-01-05 20:01 ` Alexandre Belloni
2022-01-05 20:34 ` Hugo Villeneuve
2022-01-05 22:25 ` Alexandre Belloni
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=20220105193440.151359-1-hugo@hugovil.com \
--to=hugo@hugovil.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=hvilleneuve@dimonoff.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@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
all inboxes | Powered by JetHome®