All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] wifi: rtw89: simplify rtw89_debug_priv_mac_reg_dump_select()
@ 2025-02-11  7:39 Dmitry Antipov
  2025-02-11  7:39 ` [PATCH 2/2] wifi: rtw89: rtw8852b{t}: fix TSSI debug timestamps Dmitry Antipov
  2025-02-12  5:35 ` [PATCH 1/2] wifi: rtw89: simplify rtw89_debug_priv_mac_reg_dump_select() Ping-Ke Shih
  0 siblings, 2 replies; 10+ messages in thread
From: Dmitry Antipov @ 2025-02-11  7:39 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: Kalle Valo, linux-wireless, Dmitry Antipov

Simplify 'rtw89_debug_priv_mac_reg_dump_select()' by using
the convenient 'kstrtoint_from_user()'. Compile tested only.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/realtek/rtw89/debug.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c
index 09fa977a6e6d..339f9f6672fd 100644
--- a/drivers/net/wireless/realtek/rtw89/debug.c
+++ b/drivers/net/wireless/realtek/rtw89/debug.c
@@ -924,17 +924,10 @@ rtw89_debug_priv_mac_reg_dump_select(struct file *filp,
 	struct rtw89_debugfs_priv *debugfs_priv = m->private;
 	struct rtw89_dev *rtwdev = debugfs_priv->rtwdev;
 	const struct rtw89_chip_info *chip = rtwdev->chip;
-	char buf[32];
-	size_t buf_size;
 	int sel;
 	int ret;
 
-	buf_size = min(count, sizeof(buf) - 1);
-	if (copy_from_user(buf, user_buf, buf_size))
-		return -EFAULT;
-
-	buf[buf_size] = '\0';
-	ret = kstrtoint(buf, 0, &sel);
+	ret = kstrtoint_from_user(user_buf, count, 0, &sel);
 	if (ret)
 		return ret;
 
-- 
2.48.1


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

end of thread, other threads:[~2025-02-21  1:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-11  7:39 [PATCH 1/2] wifi: rtw89: simplify rtw89_debug_priv_mac_reg_dump_select() Dmitry Antipov
2025-02-11  7:39 ` [PATCH 2/2] wifi: rtw89: rtw8852b{t}: fix TSSI debug timestamps Dmitry Antipov
2025-02-12  5:42   ` Ping-Ke Shih
2025-02-12  7:38     ` [PATCH v2] " Dmitry Antipov
2025-02-13  0:45       ` Ping-Ke Shih
2025-02-13  5:42         ` [PATCH v3] " Dmitry Antipov
2025-02-13  7:55           ` Ping-Ke Shih
2025-02-13  9:50             ` [PATCH v4] " Dmitry Antipov
2025-02-21  1:36               ` Ping-Ke Shih
2025-02-12  5:35 ` [PATCH 1/2] wifi: rtw89: simplify rtw89_debug_priv_mac_reg_dump_select() Ping-Ke Shih

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.