linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] usb: typec: thunderbolt: Remove IS_ERR check for plug
@ 2025-01-24 19:40 Benson Leung
  2025-01-28  8:16 ` Heikki Krogerus
  2025-02-03 15:31 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Benson Leung @ 2025-01-24 19:40 UTC (permalink / raw)
  To: heikki.krogerus, gregkh, abhishekpandit, dan.carpenter
  Cc: bleung, linux-usb, linux-kernel, akuchynski, ukaszb

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] usb: typec: thunderbolt: Remove IS_ERR check for plug
  2025-01-24 19:40 [PATCH 2/2] usb: typec: thunderbolt: Remove IS_ERR check for plug Benson Leung
@ 2025-01-28  8:16 ` Heikki Krogerus
  2025-02-03 15:31 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Heikki Krogerus @ 2025-01-28  8:16 UTC (permalink / raw)
  To: Benson Leung
  Cc: gregkh, abhishekpandit, dan.carpenter, linux-usb, linux-kernel,
	akuchynski, ukaszb

On Fri, Jan 24, 2025 at 07:40:38PM +0000, Benson Leung wrote:
> 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>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  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

-- 
heikki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] usb: typec: thunderbolt: Remove IS_ERR check for plug
  2025-01-24 19:40 [PATCH 2/2] usb: typec: thunderbolt: Remove IS_ERR check for plug Benson Leung
  2025-01-28  8:16 ` Heikki Krogerus
@ 2025-02-03 15:31 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2025-02-03 15:31 UTC (permalink / raw)
  To: Benson Leung
  Cc: heikki.krogerus, abhishekpandit, dan.carpenter, linux-usb,
	linux-kernel, akuchynski, ukaszb

On Fri, Jan 24, 2025 at 07:40:38PM +0000, Benson Leung wrote:
> 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>

Please do not put a blank line between "Fixes:" and your signed-off-by
line.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-03 15:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-24 19:40 [PATCH 2/2] usb: typec: thunderbolt: Remove IS_ERR check for plug Benson Leung
2025-01-28  8:16 ` Heikki Krogerus
2025-02-03 15:31 ` Greg KH

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).