* [PATCH net-next] nfc: st21nfca: Drop unneeded null check in st21nfca_tx_work()
@ 2025-01-04 14:20 Krzysztof Kozlowski
2025-01-06 16:03 ` Simon Horman
2025-01-07 1:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-04 14:20 UTC (permalink / raw)
To: Krzysztof Kozlowski, netdev, linux-kernel; +Cc: Krzysztof Kozlowski
Variable 'info' is obtained via container_of() of struct work_struct, so
it cannot be NULL. Simplify the code and solve Smatch warning:
drivers/nfc/st21nfca/dep.c:119 st21nfca_tx_work() warn: can 'info' even be NULL?
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/nfc/st21nfca/dep.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/nfc/st21nfca/dep.c b/drivers/nfc/st21nfca/dep.c
index 1ec651e31064..3425b68f0ddc 100644
--- a/drivers/nfc/st21nfca/dep.c
+++ b/drivers/nfc/st21nfca/dep.c
@@ -116,18 +116,16 @@ static void st21nfca_tx_work(struct work_struct *work)
struct nfc_dev *dev;
struct sk_buff *skb;
- if (info) {
- dev = info->hdev->ndev;
- skb = info->dep_info.tx_pending;
+ dev = info->hdev->ndev;
+ skb = info->dep_info.tx_pending;
- device_lock(&dev->dev);
+ device_lock(&dev->dev);
- nfc_hci_send_cmd_async(info->hdev, ST21NFCA_RF_READER_F_GATE,
- ST21NFCA_WR_XCHG_DATA, skb->data, skb->len,
- info->async_cb, info);
- device_unlock(&dev->dev);
- kfree_skb(skb);
- }
+ nfc_hci_send_cmd_async(info->hdev, ST21NFCA_RF_READER_F_GATE,
+ ST21NFCA_WR_XCHG_DATA, skb->data, skb->len,
+ info->async_cb, info);
+ device_unlock(&dev->dev);
+ kfree_skb(skb);
}
static void st21nfca_im_send_pdu(struct st21nfca_hci_info *info,
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] nfc: st21nfca: Drop unneeded null check in st21nfca_tx_work()
2025-01-04 14:20 [PATCH net-next] nfc: st21nfca: Drop unneeded null check in st21nfca_tx_work() Krzysztof Kozlowski
@ 2025-01-06 16:03 ` Simon Horman
2025-01-07 1:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-01-06 16:03 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: Krzysztof Kozlowski, netdev, linux-kernel
On Sat, Jan 04, 2025 at 03:20:43PM +0100, Krzysztof Kozlowski wrote:
> Variable 'info' is obtained via container_of() of struct work_struct, so
> it cannot be NULL. Simplify the code and solve Smatch warning:
>
> drivers/nfc/st21nfca/dep.c:119 st21nfca_tx_work() warn: can 'info' even be NULL?
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] nfc: st21nfca: Drop unneeded null check in st21nfca_tx_work()
2025-01-04 14:20 [PATCH net-next] nfc: st21nfca: Drop unneeded null check in st21nfca_tx_work() Krzysztof Kozlowski
2025-01-06 16:03 ` Simon Horman
@ 2025-01-07 1:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-07 1:00 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: krzk, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 4 Jan 2025 15:20:43 +0100 you wrote:
> Variable 'info' is obtained via container_of() of struct work_struct, so
> it cannot be NULL. Simplify the code and solve Smatch warning:
>
> drivers/nfc/st21nfca/dep.c:119 st21nfca_tx_work() warn: can 'info' even be NULL?
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> [...]
Here is the summary with links:
- [net-next] nfc: st21nfca: Drop unneeded null check in st21nfca_tx_work()
https://git.kernel.org/netdev/net-next/c/21a8a77abb4c
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-01-07 1:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-04 14:20 [PATCH net-next] nfc: st21nfca: Drop unneeded null check in st21nfca_tx_work() Krzysztof Kozlowski
2025-01-06 16:03 ` Simon Horman
2025-01-07 1:00 ` 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).