* [PATCH net-next] net: wwan: iosm: remove pointless null check
@ 2022-05-19 0:43 Jakub Kicinski
2022-05-19 7:12 ` Kumar, M Chetan
2022-05-20 1:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2022-05-19 0:43 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, Jakub Kicinski, m.chetan.kumar,
linuxwwan, loic.poulain, ryazanov.s.a, johannes
GCC 12 warns:
drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c: In function ‘ipc_protocol_dl_td_process’:
drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c:406:13: warning: the comparison will always evaluate as ‘true’ for the address of ‘cb’ will never be NULL [-Waddress]
406 | if (!IPC_CB(skb)) {
| ^
Indeed the check seems entirely pointless. Hopefully the other
validation checks will catch if the cb is bad, but it can't be
NULL.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: m.chetan.kumar@intel.com
CC: linuxwwan@intel.com
CC: loic.poulain@linaro.org
CC: ryazanov.s.a@gmail.com
CC: johannes@sipsolutions.net
---
drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c b/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c
index c6b032f95d2e..4627847c6daa 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c
@@ -372,8 +372,6 @@ bool ipc_protocol_dl_td_prepare(struct iosm_protocol *ipc_protocol,
struct sk_buff *ipc_protocol_dl_td_process(struct iosm_protocol *ipc_protocol,
struct ipc_pipe *pipe)
{
- u32 tail =
- le32_to_cpu(ipc_protocol->p_ap_shm->tail_array[pipe->pipe_nr]);
struct ipc_protocol_td *p_td;
struct sk_buff *skb;
@@ -403,14 +401,6 @@ struct sk_buff *ipc_protocol_dl_td_process(struct iosm_protocol *ipc_protocol,
goto ret;
}
- if (!IPC_CB(skb)) {
- dev_err(ipc_protocol->dev, "pipe# %d, tail: %d skb_cb is NULL",
- pipe->pipe_nr, tail);
- ipc_pcie_kfree_skb(ipc_protocol->pcie, skb);
- skb = NULL;
- goto ret;
- }
-
if (p_td->buffer.address != IPC_CB(skb)->mapping) {
dev_err(ipc_protocol->dev, "invalid buf=%llx or skb=%p",
(unsigned long long)p_td->buffer.address, skb->data);
--
2.34.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH net-next] net: wwan: iosm: remove pointless null check
2022-05-19 0:43 [PATCH net-next] net: wwan: iosm: remove pointless null check Jakub Kicinski
@ 2022-05-19 7:12 ` Kumar, M Chetan
2022-05-20 1:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Kumar, M Chetan @ 2022-05-19 7:12 UTC (permalink / raw)
To: Jakub Kicinski, davem
Cc: netdev, edumazet, pabeni, linuxwwan, loic.poulain, ryazanov.s.a,
johannes
> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Thursday, May 19, 2022 6:14 AM
> To: davem@davemloft.net
> Cc: netdev@vger.kernel.org; edumazet@google.com; pabeni@redhat.com;
> Jakub Kicinski <kuba@kernel.org>; Kumar, M Chetan
> <m.chetan.kumar@intel.com>; linuxwwan <linuxwwan@intel.com>;
> loic.poulain@linaro.org; ryazanov.s.a@gmail.com;
> johannes@sipsolutions.net
> Subject: [PATCH net-next] net: wwan: iosm: remove pointless null check
>
> GCC 12 warns:
>
> drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c: In function
> ‘ipc_protocol_dl_td_process’:
> drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c:406:13: warning: the
> comparison will always evaluate as ‘true’ for the address of ‘cb’ will never be
> NULL [-Waddress]
> 406 | if (!IPC_CB(skb)) {
> | ^
>
> Indeed the check seems entirely pointless. Hopefully the other validation
> checks will catch if the cb is bad, but it can't be NULL.
Reviewed-by: M Chetan Kumar <m.chetan.kumar@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: wwan: iosm: remove pointless null check
2022-05-19 0:43 [PATCH net-next] net: wwan: iosm: remove pointless null check Jakub Kicinski
2022-05-19 7:12 ` Kumar, M Chetan
@ 2022-05-20 1:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-20 1:50 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, m.chetan.kumar, linuxwwan,
loic.poulain, ryazanov.s.a, johannes
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 18 May 2022 17:43:42 -0700 you wrote:
> GCC 12 warns:
>
> drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c: In function ‘ipc_protocol_dl_td_process’:
> drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c:406:13: warning: the comparison will always evaluate as ‘true’ for the address of ‘cb’ will never be NULL [-Waddress]
> 406 | if (!IPC_CB(skb)) {
> | ^
>
> [...]
Here is the summary with links:
- [net-next] net: wwan: iosm: remove pointless null check
https://git.kernel.org/netdev/net-next/c/dbbc7d04c549
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:[~2022-05-20 1:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 0:43 [PATCH net-next] net: wwan: iosm: remove pointless null check Jakub Kicinski
2022-05-19 7:12 ` Kumar, M Chetan
2022-05-20 1:50 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.