From: Benson Leung Date: Fri, 24 Jan 2025 19:40:38 +0000 (+0000) Subject: usb: typec: thunderbolt: Remove IS_ERR check for plug X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9682c35ff6ecd76d9462d4749b8b413d3e8e605e;p=users%2Fwilly%2Fxarray.git usb: typec: thunderbolt: Remove IS_ERR check for plug 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 Reported-by: Dan Carpenter Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/Z5PstnlA52Z1F2SU@google.com Signed-off-by: Greg Kroah-Hartman --- 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";