linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] nfc: pn533: Delete an unnecessary check
@ 2025-08-13  5:51 Dan Carpenter
  2025-08-13  8:13 ` Krzysztof Kozlowski
  2025-08-15  0:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-08-13  5:51 UTC (permalink / raw)
  To: Lars Poeschel, Krzysztof Kozlowski
  Cc: Paolo Abeni, Aleksandr Mishin, netdev, linux-kernel,
	kernel-janitors

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


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

* Re: [PATCH net-next] nfc: pn533: Delete an unnecessary check
  2025-08-13  5:51 [PATCH net-next] nfc: pn533: Delete an unnecessary check Dan Carpenter
@ 2025-08-13  8:13 ` Krzysztof Kozlowski
  2025-08-15  0:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-13  8:13 UTC (permalink / raw)
  To: Dan Carpenter, Lars Poeschel
  Cc: Paolo Abeni, Aleksandr Mishin, netdev, linux-kernel,
	kernel-janitors

On 13/08/2025 07:51, Dan Carpenter wrote:
> 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(-)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

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

* Re: [PATCH net-next] nfc: pn533: Delete an unnecessary check
  2025-08-13  5:51 [PATCH net-next] nfc: pn533: Delete an unnecessary check Dan Carpenter
  2025-08-13  8:13 ` Krzysztof Kozlowski
@ 2025-08-15  0:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-15  0:40 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: poeschel, krzk, pabeni, amishin, netdev, linux-kernel,
	kernel-janitors

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 13 Aug 2025 08:51:22 +0300 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next] nfc: pn533: Delete an unnecessary check
    https://git.kernel.org/netdev/net-next/c/c6f68f69416d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-08-15  0:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13  5:51 [PATCH net-next] nfc: pn533: Delete an unnecessary check Dan Carpenter
2025-08-13  8:13 ` Krzysztof Kozlowski
2025-08-15  0:40 ` patchwork-bot+netdevbpf

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).