提交 1a0df28c 编写于 作者: Z zhaoxiao 提交者: Juergen Gross

x86: xen: platform-pci-unplug: use pr_err() and pr_warn() instead of raw printk()

Since we have the nice helpers pr_err() and pr_warn(), use them instead
of raw printk().

[jgross@suse.com] Move the "#define pr_fmt" above the #includes in
                  order to avoid build warnings due to redefinition.
Signed-off-by: Nzhaoxiao <zhaoxiao@uniontech.com>
Reviewed-by: NJuergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20210825114111.29009-1-zhaoxiao@uniontech.comSigned-off-by: NJuergen Gross <jgross@suse.com>
上级 bb70913d
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* Copyright (c) 2010, Citrix * Copyright (c) 2010, Citrix
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/export.h> #include <linux/export.h>
...@@ -30,13 +32,13 @@ static int check_platform_magic(void) ...@@ -30,13 +32,13 @@ static int check_platform_magic(void)
magic = inw(XEN_IOPORT_MAGIC); magic = inw(XEN_IOPORT_MAGIC);
if (magic != XEN_IOPORT_MAGIC_VAL) { if (magic != XEN_IOPORT_MAGIC_VAL) {
printk(KERN_ERR "Xen Platform PCI: unrecognised magic value\n"); pr_err("Xen Platform PCI: unrecognised magic value\n");
return XEN_PLATFORM_ERR_MAGIC; return XEN_PLATFORM_ERR_MAGIC;
} }
protocol = inb(XEN_IOPORT_PROTOVER); protocol = inb(XEN_IOPORT_PROTOVER);
printk(KERN_DEBUG "Xen Platform PCI: I/O protocol version %d\n", pr_debug("Xen Platform PCI: I/O protocol version %d\n",
protocol); protocol);
switch (protocol) { switch (protocol) {
...@@ -44,12 +46,12 @@ static int check_platform_magic(void) ...@@ -44,12 +46,12 @@ static int check_platform_magic(void)
outw(XEN_IOPORT_LINUX_PRODNUM, XEN_IOPORT_PRODNUM); outw(XEN_IOPORT_LINUX_PRODNUM, XEN_IOPORT_PRODNUM);
outl(XEN_IOPORT_LINUX_DRVVER, XEN_IOPORT_DRVVER); outl(XEN_IOPORT_LINUX_DRVVER, XEN_IOPORT_DRVVER);
if (inw(XEN_IOPORT_MAGIC) != XEN_IOPORT_MAGIC_VAL) { if (inw(XEN_IOPORT_MAGIC) != XEN_IOPORT_MAGIC_VAL) {
printk(KERN_ERR "Xen Platform: blacklisted by host\n"); pr_err("Xen Platform: blacklisted by host\n");
return XEN_PLATFORM_ERR_BLACKLIST; return XEN_PLATFORM_ERR_BLACKLIST;
} }
break; break;
default: default:
printk(KERN_WARNING "Xen Platform PCI: unknown I/O protocol version\n"); pr_warn("Xen Platform PCI: unknown I/O protocol version\n");
return XEN_PLATFORM_ERR_PROTOCOL; return XEN_PLATFORM_ERR_PROTOCOL;
} }
...@@ -155,12 +157,12 @@ void xen_unplug_emulated_devices(void) ...@@ -155,12 +157,12 @@ void xen_unplug_emulated_devices(void)
* been compiled for this kernel (modules or built-in are both OK). */ * been compiled for this kernel (modules or built-in are both OK). */
if (!xen_emul_unplug) { if (!xen_emul_unplug) {
if (xen_must_unplug_nics()) { if (xen_must_unplug_nics()) {
printk(KERN_INFO "Netfront and the Xen platform PCI driver have " pr_info("Netfront and the Xen platform PCI driver have "
"been compiled for this kernel: unplug emulated NICs.\n"); "been compiled for this kernel: unplug emulated NICs.\n");
xen_emul_unplug |= XEN_UNPLUG_ALL_NICS; xen_emul_unplug |= XEN_UNPLUG_ALL_NICS;
} }
if (xen_must_unplug_disks()) { if (xen_must_unplug_disks()) {
printk(KERN_INFO "Blkfront and the Xen platform PCI driver have " pr_info("Blkfront and the Xen platform PCI driver have "
"been compiled for this kernel: unplug emulated disks.\n" "been compiled for this kernel: unplug emulated disks.\n"
"You might have to change the root device\n" "You might have to change the root device\n"
"from /dev/hd[a-d] to /dev/xvd[a-d]\n" "from /dev/hd[a-d] to /dev/xvd[a-d]\n"
...@@ -200,7 +202,7 @@ static int __init parse_xen_emul_unplug(char *arg) ...@@ -200,7 +202,7 @@ static int __init parse_xen_emul_unplug(char *arg)
else if (!strncmp(p, "never", l)) else if (!strncmp(p, "never", l))
xen_emul_unplug |= XEN_UNPLUG_NEVER; xen_emul_unplug |= XEN_UNPLUG_NEVER;
else else
printk(KERN_WARNING "unrecognised option '%s' " pr_warn("unrecognised option '%s' "
"in parameter 'xen_emul_unplug'\n", p); "in parameter 'xen_emul_unplug'\n", p);
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册