]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/kexec: use pr_err() instead of kexec_dprintk() when an error occurs
authorYuntao Wang <ytcoode@gmail.com>
Wed, 20 Dec 2023 03:01:24 +0000 (11:01 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 Dec 2023 20:22:28 +0000 (12:22 -0800)
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>
arch/x86/kernel/kexec-bzimage64.c
mm/highmem.c

index e9ae0eac6bf95246ce3d0729f0a3e4733baacbd1..4a77d5dd4bcedcdeecedc3e3183d2c05ac9edb0f 100644 (file)
@@ -429,7 +429,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
         * command line. Make sure it does not overflow
         */
        if (cmdline_len + MAX_ELFCOREHDR_STR_LEN > header->cmdline_size) {
-               kexec_dprintk("Appending elfcorehdr=<addr> to command line exceeds maximum allowed length\n");
+               pr_err("Appending elfcorehdr=<addr> to command line exceeds maximum allowed length\n");
                return ERR_PTR(-EINVAL);
        }
 
index e19269093a93cf7e03a76d3dd27fb3110d44f89f..bd48ba445dd411d8f9adcc0dd1b0349ebdc0dd82 100644 (file)
@@ -799,8 +799,6 @@ void set_page_address(struct page *page, void *virtual)
                }
                spin_unlock_irqrestore(&pas->lock, flags);
        }
-
-       return;
 }
 
 void __init page_address_init(void)