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

x86/kexec: use pr_err() instead of kexec_dprintk() when an error occurs

When detecting an error, the current code uses kexec_dprintk() to output
log message. This is not quite appropriate as kexec_dprintk() is mainly
used for outputting debugging messages, rather than error messages.

Replace kexec_dprintk() with pr_err(). This also makes the output method
for this error log align with the output method for other error logs in
this function.

Additionally, the last return statement in set_page_address() is
unnecessary, remove it.

Link: https://lkml.kernel.org/r/20231220030124.149160-1-ytcoode@gmail.com
Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Yuntao Wang and committed by
Andrew Morton
43132282 5b130948

+1 -3
+1 -1
arch/x86/kernel/kexec-bzimage64.c
··· 429 429 * command line. Make sure it does not overflow 430 430 */ 431 431 if (cmdline_len + MAX_ELFCOREHDR_STR_LEN > header->cmdline_size) { 432 - kexec_dprintk("Appending elfcorehdr=<addr> to command line exceeds maximum allowed length\n"); 432 + pr_err("Appending elfcorehdr=<addr> to command line exceeds maximum allowed length\n"); 433 433 return ERR_PTR(-EINVAL); 434 434 } 435 435
-2
mm/highmem.c
··· 799 799 } 800 800 spin_unlock_irqrestore(&pas->lock, flags); 801 801 } 802 - 803 - return; 804 802 } 805 803 806 804 void __init page_address_init(void)