[PATCH RESEND] usb: dwc3: Remove redundant test

Marek Vasut marek.vasut at mailbox.org
Mon Sep 29 15:27:19 CEST 2025


On 9/29/25 11:11 AM, Andrew Goodbody 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.

If you really want to make this obvious, use git send-email -U20 or some 
such, this will add more context into the diff and include the relevant 
part:

  793         r = next_request(&ep0->request_list);
  794         if (!r)
  795                 return;
              ^^^^^^^^^^^^^^^
  796
  797         dwc3_flush_cache((uintptr_t)trb, sizeof(*trb));
  798
  799         status = DWC3_TRB_SIZE_TRBSTS(trb->size);
  800         if (status == DWC3_TRBSTS_SETUP_PENDING) {
  801                 dev_dbg(dwc->dev, "Setup Pending received");
  802
  803                 if (r)
  804                         dwc3_gadget_giveback(ep0, r, -ECONNRESET);

Reviewed-by: Marek Vasut <marek.vasut at mailbox.org>

Thanks !


More information about the U-Boot mailing list