All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: simplify dwc3_lsp_write()
@ 2026-08-04 13:49 Dmitry Antipov
  2026-08-05  1:17 ` Thinh Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Antipov @ 2026-08-04 13:49 UTC (permalink / raw)
  To: Thinh Nguyen; +Cc: Greg Kroah-Hartman, linux-usb, Dmitry Antipov

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-05  1:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04 13:49 [PATCH] usb: dwc3: simplify dwc3_lsp_write() Dmitry Antipov
2026-08-05  1:17 ` Thinh Nguyen

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.