From: Dan Carpenter <dan.carpenter@linaro.org>
To: Lars Poeschel <poeschel@lemonage.de>,
Krzysztof Kozlowski <krzk@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>,
Aleksandr Mishin <amishin@t-argos.ru>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH net-next] nfc: pn533: Delete an unnecessary check
Date: Wed, 13 Aug 2025 08:51:22 +0300 [thread overview]
Message-ID: <aJwn2ox5g9WsD2Vx@stanley.mountain> (raw)
The "rc" variable is set like this:
if (IS_ERR(resp)) {
rc = PTR_ERR(resp);
We know that "rc" is negative so there is no need to check.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/nfc/pn533/pn533.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c
index 14661249c690..2b043a9f9533 100644
--- a/drivers/nfc/pn533/pn533.c
+++ b/drivers/nfc/pn533/pn533.c
@@ -1412,11 +1412,9 @@ static int pn533_autopoll_complete(struct pn533 *dev, void *arg,
if (dev->poll_mod_count != 0)
return rc;
goto stop_poll;
- } else if (rc < 0) {
- nfc_err(dev->dev,
- "Error %d when running autopoll\n", rc);
- goto stop_poll;
}
+ nfc_err(dev->dev, "Error %d when running autopoll\n", rc);
+ goto stop_poll;
}
nbtg = resp->data[0];
@@ -1505,11 +1503,9 @@ static int pn533_poll_complete(struct pn533 *dev, void *arg,
if (dev->poll_mod_count != 0)
return rc;
goto stop_poll;
- } else if (rc < 0) {
- nfc_err(dev->dev,
- "Error %d when running poll\n", rc);
- goto stop_poll;
}
+ nfc_err(dev->dev, "Error %d when running poll\n", rc);
+ goto stop_poll;
}
cur_mod = dev->poll_mod_active[dev->poll_mod_curr];
--
2.47.2
next reply other threads:[~2025-08-13 5:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 5:51 Dan Carpenter [this message]
2025-08-13 8:13 ` [PATCH net-next] nfc: pn533: Delete an unnecessary check Krzysztof Kozlowski
2025-08-15 0:40 ` patchwork-bot+netdevbpf
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=aJwn2ox5g9WsD2Vx@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=amishin@t-argos.ru \
--cc=kernel-janitors@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=poeschel@lemonage.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