From: Benson Leung <bleung@chromium.org>
To: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org,
abhishekpandit@chromium.org, dan.carpenter@linaro.org
Cc: bleung@chromium.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, akuchynski@google.com,
ukaszb@chromium.org
Subject: [PATCH 2/2] usb: typec: thunderbolt: Remove IS_ERR check for plug
Date: Fri, 24 Jan 2025 19:40:38 +0000 [thread overview]
Message-ID: <Z5PstnlA52Z1F2SU@google.com> (raw)
Fixes these Smatch static checker warnings:
drivers/usb/typec/altmodes/thunderbolt.c:354 tbt_ready() warn: 'plug' is not an error pointer
Fixes: 100e25738659 ("usb: typec: Add driver for Thunderbolt 3 Alternate Mode")
Signed-off-by: Benson Leung <bleung@chromium.org>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/usb/typec/altmodes/thunderbolt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/altmodes/thunderbolt.c b/drivers/usb/typec/altmodes/thunderbolt.c
index 94e47d30e598..6eadf7835f8f 100644
--- a/drivers/usb/typec/altmodes/thunderbolt.c
+++ b/drivers/usb/typec/altmodes/thunderbolt.c
@@ -351,10 +351,10 @@ static bool tbt_ready(struct typec_altmode *alt)
*/
for (int i = 0; i < TYPEC_PLUG_SOP_PP + 1; i++) {
plug = typec_altmode_get_plug(tbt->alt, i);
- if (IS_ERR(plug))
+ if (!plug)
continue;
- if (!plug || plug->svid != USB_TYPEC_TBT_SID)
+ if (plug->svid != USB_TYPEC_TBT_SID)
break;
plug->desc = "Thunderbolt3";
--
2.48.1.262.g85cc9f2d1e-goog
next reply other threads:[~2025-01-24 19:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-24 19:40 Benson Leung [this message]
2025-01-28 8:16 ` [PATCH 2/2] usb: typec: thunderbolt: Remove IS_ERR check for plug Heikki Krogerus
2025-02-03 15:31 ` Greg KH
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=Z5PstnlA52Z1F2SU@google.com \
--to=bleung@chromium.org \
--cc=abhishekpandit@chromium.org \
--cc=akuchynski@google.com \
--cc=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ukaszb@chromium.org \
/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).