usb: typec: thunderbolt: Remove IS_ERR check for plug
Subsystems (3)
PATCH 2/2 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 <[email protected]>
Reported-by Dan Carpenter <[email protected]>
--- drivers/usb/typec/altmodes/thunderbolt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/typec/altmodes/thunderbolt.c +2 -2
@@ -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" ;
Signature · 1 line
2.48.1.262.g85cc9f2d1e-goog
Quoted 7 lines · Benson Leung
Fixes these Smatch static checker warnings:
drivers/usb/typec/altmodes/thunderbolt.c:354tbt_ready()warn: 'plug' is not an error pointerFixes 100e25738659 ("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]>
Quoted 23 lines
--- drivers/usb/typec/altmodes/thunderbolt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/usb/typec/altmodes/thunderbolt.c +2
-2@@ -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" ;Signature · 1 line
2.48.1.262.g85cc9f2d1e-goog
Signature · 1 line
heikki
Greg KH
maintainerQuoted 6 lines · Benson Leung
Fixes these Smatch static checker warnings:
drivers/usb/typec/altmodes/thunderbolt.c:354tbt_ready()warn: 'plug' is not an error pointerFixes 100e25738659 ("usb: typec: Add driver for Thunderbolt 3 Alternate Mode")Signed-off-by Benson Leung <[email protected]>
Please do not put a blank line between "Fixes:" and your signed-off-by line.
thanks,
greg k-h