linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, M Chetan Kumar <m.chetan.kumar@intel.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH 5.18 05/11] net: wwan: iosm: remove pointless null check
Date: Thu, 23 Jun 2022 18:45:17 +0200	[thread overview]
Message-ID: <20220623164322.472090999@linuxfoundation.org> (raw)
In-Reply-To: <20220623164322.315085512@linuxfoundation.org>

From: Jakub Kicinski <kuba@kernel.org>

commit dbbc7d04c549a43ad343c69e17b27a57e2102041 upstream.

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>
Link: https://lore.kernel.org/r/20220519004342.2109832-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c |   10 ----------
 1 file changed, 10 deletions(-)

--- 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 i
 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;
 
@@ -401,14 +399,6 @@ struct sk_buff *ipc_protocol_dl_td_proce
 		ipc_pcie_kfree_skb(ipc_protocol->pcie, skb);
 		skb = NULL;
 		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) {



  parent reply	other threads:[~2022-06-23 18:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 16:45 [PATCH 5.18 00/11] 5.18.7-rc1 review Greg Kroah-Hartman
2022-06-23 16:45 ` [PATCH 5.18 01/11] s390/mm: use non-quiescing sske for KVM switch to keyed guest Greg Kroah-Hartman
2022-06-23 16:45 ` [PATCH 5.18 02/11] zonefs: fix zonefs_iomap_begin() for reads Greg Kroah-Hartman
2022-06-23 16:45 ` [PATCH 5.18 03/11] wifi: rtlwifi: remove always-true condition pointed out by GCC 12 Greg Kroah-Hartman
2022-06-23 16:45 ` [PATCH 5.18 04/11] eth: sun: cassini: remove dead code Greg Kroah-Hartman
2022-06-23 16:45 ` Greg Kroah-Hartman [this message]
2022-06-23 16:45 ` [PATCH 5.18 06/11] x86/boot: Wrap literal addresses in absolute_pointer() Greg Kroah-Hartman
2022-06-23 16:45 ` [PATCH 5.18 07/11] fsnotify: introduce mark type iterator Greg Kroah-Hartman
2022-06-23 16:45 ` [PATCH 5.18 08/11] fsnotify: consistent behavior for parent not watching children Greg Kroah-Hartman
2022-06-23 16:45 ` [PATCH 5.18 09/11] bpf: Fix calling global functions from BPF_PROG_TYPE_EXT programs Greg Kroah-Hartman
2022-06-23 16:45 ` [PATCH 5.18 10/11] selftests/bpf: Add selftest for calling global functions from freplace Greg Kroah-Hartman
2022-06-23 16:45 ` [PATCH 5.18 11/11] dt-bindings: nvmem: sfp: Add clock properties Greg Kroah-Hartman
2022-06-23 20:33 ` [PATCH 5.18 00/11] 5.18.7-rc1 review Florian Fainelli
2022-06-23 23:31 ` Zan Aziz
2022-06-24  0:51 ` Shuah Khan
2022-06-24  7:30 ` Ron Economos
2022-06-24  9:25 ` Bagas Sanjaya
2022-06-24 10:39 ` Sudip Mukherjee
2022-06-24 16:07 ` Rudi Heitbaum
2022-06-24 16:38 ` Justin Forbes
2022-06-24 23:36 ` Guenter Roeck
2022-06-25 13:24 ` Naresh Kamboju

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=20220623164322.472090999@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.chetan.kumar@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).