Skip to content

Commit 9682c35

Browse files
bleungatchromiumgregkh
authored andcommitted
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: 100e257 ("usb: typec: Add driver for Thunderbolt 3 Alternate Mode") Signed-off-by: Benson Leung <[email protected]> Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b51c1e8 commit 9682c35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/typec/altmodes/thunderbolt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,10 @@ static bool tbt_ready(struct typec_altmode *alt)
351351
*/
352352
for (int i = 0; i < TYPEC_PLUG_SOP_PP + 1; i++) {
353353
plug = typec_altmode_get_plug(tbt->alt, i);
354-
if (IS_ERR(plug))
354+
if (!plug)
355355
continue;
356356

357-
if (!plug || plug->svid != USB_TYPEC_TBT_SID)
357+
if (plug->svid != USB_TYPEC_TBT_SID)
358358
break;
359359

360360
plug->desc = "Thunderbolt3";

0 commit comments

Comments
 (0)