nfc: pn533: Delete an unnecessary check
Subsystems (4)
PATCH 1/1 nfc: pn533: Delete an unnecessary check
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 <[email protected]>
--- drivers/nfc/pn533/pn533.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/nfc/pn533/pn533.c +4 -8
@@ -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];
Signature · 1 line
2.47.2
Quoted 11 lines · Dan Carpenter
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 <[email protected]>--- drivers/nfc/pn533/pn533.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
Reviewed-by Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · 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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html