Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

arch: remove get_task_comm() and print task comm directly

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-3-laoar.shao@gmail.com
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "André Almeida" <andrealmeid@igalia.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Danilo Krummrich <dakr@redhat.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: David Airlie <airlied@gmail.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: James Morris <jmorris@namei.org>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: Karol Herbst <kherbst@redhat.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Oded Gabbay <ogabbay@kernel.org>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Tvrtko Ursulin <tursulin@ursulin.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Yafang Shao and committed by
Andrew Morton
52cd5c4b b6dcdb06

+4 -6
+2 -3
arch/arc/kernel/unaligned.c
··· 200 200 struct callee_regs *cregs) 201 201 { 202 202 struct disasm_state state; 203 - char buf[TASK_COMM_LEN]; 204 203 205 204 /* handle user mode only and only if enabled by sysadmin */ 206 205 if (!user_mode(regs) || !unaligned_enabled) ··· 211 212 " performance significantly\n. To enable further" 212 213 " logging of such instances, please \n" 213 214 " echo 0 > /proc/sys/kernel/ignore-unaligned-usertrap\n", 214 - get_task_comm(buf, current), task_pid_nr(current)); 215 + current->comm, task_pid_nr(current)); 215 216 } else { 216 217 /* Add rate limiting if it gets down to it */ 217 218 pr_warn("%s(%d): unaligned access to/from 0x%lx by PC: 0x%lx\n", 218 - get_task_comm(buf, current), task_pid_nr(current), 219 + current->comm, task_pid_nr(current), 219 220 address, regs->ret); 220 221 221 222 }
+2 -3
arch/x86/kernel/vm86_32.c
··· 246 246 247 247 /* VM86_SCREEN_BITMAP had numerous bugs and appears to have no users. */ 248 248 if (v.flags & VM86_SCREEN_BITMAP) { 249 - char comm[TASK_COMM_LEN]; 250 - 251 - pr_info_once("vm86: '%s' uses VM86_SCREEN_BITMAP, which is no longer supported\n", get_task_comm(comm, current)); 249 + pr_info_once("vm86: '%s' uses VM86_SCREEN_BITMAP, which is no longer supported\n", 250 + current->comm); 252 251 return -EINVAL; 253 252 } 254 253