public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Prashanth K <prashanth.k@oss.qualcomm.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Lianqin Hu <hulianqin@vivo.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Jeff Johnson <jeff.johnson@oss.qualcomm.com>,
	Michael Walle <mwalle@kernel.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: u_serial: remove some dead code
Date: Thu, 26 Jun 2025 11:53:05 +0530	[thread overview]
Message-ID: <fde57cbf-4367-4741-8d67-b569ecb9dc61@oss.qualcomm.com> (raw)
In-Reply-To: <685c1413.050a0220.1a8223.d0b9@mx.google.com>



On 6/25/2025 8:51 PM, Dan Carpenter wrote:
> There is no need to check if "port" is NULL.  We already verified that it
> is non-NULL.  It's a stack variable and can't be modified by a different
> thread.  Delete this dead code.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---

Perhaps you could add Closes and Fixes tag, but its up to you.

Reviewed-by: Prashanth K <prashanth.k@oss.qualcomm.com>

>  drivers/usb/gadget/function/u_serial.c | 7 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
> index ab544f6824be..96756a489d6a 100644
> --- a/drivers/usb/gadget/function/u_serial.c
> +++ b/drivers/usb/gadget/function/u_serial.c
> @@ -1501,13 +1501,7 @@ void gserial_suspend(struct gserial *gser)
>  		spin_unlock_irqrestore(&serial_port_lock, flags);
>  		if (!gserial_wakeup_host(gser))
>  			return;
> -
> -		/* Check if port is valid after acquiring lock back */
>  		spin_lock_irqsave(&serial_port_lock, flags);
> -		if (!port) {
> -			spin_unlock_irqrestore(&serial_port_lock, flags);
> -			return;
> -		}
>  	}
>  
>  	spin_lock(&port->port_lock);

  reply	other threads:[~2025-06-26  6:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 15:21 [PATCH] usb: gadget: u_serial: remove some dead code Dan Carpenter
2025-06-26  6:23 ` Prashanth K [this message]
2025-06-26 13:21   ` Dan Carpenter

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=fde57cbf-4367-4741-8d67-b569ecb9dc61@oss.qualcomm.com \
    --to=prashanth.k@oss.qualcomm.com \
    --cc=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hulianqin@vivo.com \
    --cc=jeff.johnson@oss.qualcomm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mwalle@kernel.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