From b619c7ac21853558d08a40a31132950bfecc9383 Mon Sep 17 00:00:00 2001 From: Yafang Shao Date: Thu, 19 Dec 2024 10:34:50 +0800 Subject: net: remove get_task_comm() and print task comm directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since task->comm is guaranteed to be NUL-terminated, we can print it directly without the need to copy it into a separate buffer. This simplifies the code and avoids unnecessary operations. Link: https://lkml.kernel.org/r/20241219023452.69907-4-laoar.shao@gmail.com Signed-off-by: Yafang Shao Cc: Johannes Berg Cc: "André Almeida" Cc: Andy Shevchenko Cc: Borislav Petkov (AMD) Cc: Danilo Krummrich Cc: Darren Hart Cc: Dave Hansen Cc: David Airlie Cc: Davidlohr Bueso Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: James Morris Cc: Jani Nikula Cc: Jiri Slaby Cc: Joonas Lahtinen Cc: Kalle Valo Cc: Karol Herbst Cc: Kees Cook Cc: Linus Torvalds Cc: Lyude Paul Cc: Oded Gabbay Cc: Paul Moore Cc: Peter Zijlstra Cc: Petr Mladek Cc: Rodrigo Vivi Cc: "Serge E. Hallyn" Cc: Simona Vetter Cc: Thomas Gleixner Cc: Tvrtko Ursulin Cc: Vineet Gupta Signed-off-by: Andrew Morton --- net/wireless/wext-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'net/wireless') diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c index 3bb04b05c5ce..bea70eb6f034 100644 --- a/net/wireless/wext-core.c +++ b/net/wireless/wext-core.c @@ -640,10 +640,8 @@ EXPORT_SYMBOL(wireless_send_event); #ifdef CONFIG_CFG80211_WEXT static void wireless_warn_cfg80211_wext(void) { - char name[sizeof(current->comm)]; - pr_warn_once("warning: `%s' uses wireless extensions which will stop working for Wi-Fi 7 hardware; use nl80211\n", - get_task_comm(name, current)); + current->comm); } #endif -- cgit v1.2.3-59-g8ed1b