Linux USB
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: simplify dwc3_lsp_write()
Date: Wed, 5 Aug 2026 01:17:30 +0000	[thread overview]
Message-ID: <anKPIMtwcn-SabvF@vbox> (raw)
In-Reply-To: <20260804134943.651893-1-dmantipov@yandex.ru>

On Tue, Aug 04, 2026, Dmitry Antipov wrote:
> Simplify 'dwc3_lsp_write()' by using the convenient
> 'kstrtou32_from_user()'.
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> ---
>  drivers/usb/dwc3/debugfs.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
> index 65d909e4b785..01ebd73198e0 100644
> --- a/drivers/usb/dwc3/debugfs.c
> +++ b/drivers/usb/dwc3/debugfs.c
> @@ -367,14 +367,10 @@ static ssize_t dwc3_lsp_write(struct file *file, const char __user *ubuf,
>  	struct seq_file		*s = file->private_data;
>  	struct dwc3		*dwc = s->private;
>  	unsigned long		flags;
> -	char			buf[32] = { 0 };
>  	u32			sel;
>  	int			ret;
>  
> -	if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
> -		return -EFAULT;
> -
> -	ret = kstrtouint(buf, 0, &sel);
> +	ret = kstrtou32_from_user(ubuf, count, 0, &sel);
>  	if (ret)
>  		return ret;
>  
> -- 
> 2.55.0
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

BR,
Thinh

      reply	other threads:[~2026-08-05  1:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04 13:49 [PATCH] usb: dwc3: simplify dwc3_lsp_write() Dmitry Antipov
2026-08-05  1:17 ` Thinh Nguyen [this message]

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=anKPIMtwcn-SabvF@vbox \
    --to=thinh.nguyen@synopsys.com \
    --cc=dmantipov@yandex.ru \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@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