mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
	linux-usb@vger.kernel.org, smatch@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
Subject: [PATCH] usb: dwc3: gadget: use explicit 0 for success in __dwc3_gadget_kick_transfer()
Date: Fri,  6 Mar 2026 14:06:43 +0500	[thread overview]
Message-ID: <20260306090643.47383-1-zeeshanahmad022019@gmail.com> (raw)

Smatch warns that __dwc3_gadget_kick_transfer() might be missing an
error code when returning 'ret' at line 1691.

While 'ret' is guaranteed to be 0 at this point, returning an explicit 0
improves readability by removing a level of indirection and clarifies
the intent that this is a successful "no-op" path. This change also
silences the Smatch warning.

Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
---
Link: https://lore.kernel.org/linux-usb/CAPBWGpEi77+sksNLazw=dtyA3d6fBn-r10917k1rEzwzT3M=gA@mail.gmail.com/T/#t

 drivers/usb/dwc3/gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 0a688904ce8c..3d4ca68e584c 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1688,7 +1688,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep)
 	 * transfer, there's no need to update the transfer.
 	 */
 	if (!ret && !starting)
-		return ret;
+		return 0;
 
 	req = next_request(&dep->started_list);
 	if (!req) {
-- 
2.43.0


             reply	other threads:[~2026-03-06  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06  9:06 Zeeshan Ahmad [this message]
2026-03-06 23:06 ` Thinh Nguyen

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=20260306090643.47383-1-zeeshanahmad022019@gmail.com \
    --to=zeeshanahmad022019@gmail.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=smatch@vger.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

all inboxes | Powered by JetHome®