All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Andrew Goodbody <andrew.goodbody@linaro.org>,
	Marek Vasut <marex@denx.de>, Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, Neil Armstrong <neil.armstrong@linaro.org>,
	Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Anshul Dalal <anshuld@ti.com>,
	Andrew Goodbody <andrew.goodbody@linaro.org>
Subject: Re: [PATCH RESEND] usb: dwc3: Remove redundant test
Date: Tue, 30 Sep 2025 09:47:24 +0200	[thread overview]
Message-ID: <87wm5gidpv.fsf@kernel.org> (raw)
In-Reply-To: <20250929-dwc3_ep0-v1-1-1d5c58933bde@linaro.org>

Hi Andrew,

Thank you for the patch.

On Mon, Sep 29, 2025 at 10:11, Andrew Goodbody <andrew.goodbody@linaro.org> wrote:

> In dwc3_ep0_complete_data there is a test for 'r' being null and the
> code will return at that point if so. After that point 'r' is guaranteed
> to not be null and testing for that is redundant. Remove the test for
> 'r' being non-null.
>
> This issue was found by Smatch.
>
> Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>

> ---
>  drivers/usb/dwc3/ep0.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
> index c656cbe25ce6fad9ca1ef07aba131d30018db19d..680756532f0db16f7e6598df19f71bf2ab410820 100644
> --- a/drivers/usb/dwc3/ep0.c
> +++ b/drivers/usb/dwc3/ep0.c
> @@ -799,10 +799,7 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
>  	status = DWC3_TRB_SIZE_TRBSTS(trb->size);
>  	if (status == DWC3_TRBSTS_SETUP_PENDING) {
>  		dev_dbg(dwc->dev, "Setup Pending received");
> -
> -		if (r)
> -			dwc3_gadget_giveback(ep0, r, -ECONNRESET);
> -
> +		dwc3_gadget_giveback(ep0, r, -ECONNRESET);
>  		return;
>  	}
>  
>
> ---
> base-commit: 44c4919e9dd6c162b237633ba689441eca9a149c
> change-id: 20250925-dwc3_ep0-47c99180480d
>
> Best regards,
> -- 
> Andrew Goodbody <andrew.goodbody@linaro.org>

  parent reply	other threads:[~2025-09-30  7:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29  9:11 [PATCH RESEND] usb: dwc3: Remove redundant test Andrew Goodbody
2025-09-29 13:27 ` Marek Vasut
2025-09-29 14:10   ` Tom Rini
2025-09-30  7:47 ` Mattijs Korpershoek [this message]
2025-09-30  9:55 ` Mattijs Korpershoek

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=87wm5gidpv.fsf@kernel.org \
    --to=mkorpershoek@kernel.org \
    --cc=andrew.goodbody@linaro.org \
    --cc=anshuld@ti.com \
    --cc=marex@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.