xen: Convert printks to pr_<level>
Convert printks to pr_<level> (excludes printk(KERN_DEBUG...) to be more consistent throughout the xen subsystem. Add pr_fmt with KBUILD_MODNAME or "xen:" KBUILD_MODNAME Coalesce formats and add missing word spaces Add missing newlines Align arguments and reflow to 80 columns Remove DRV_NAME from formats as pr_fmt adds the same content This does change some of the prefixes of these messages but it also does make them more consistent. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
committed by
Konrad Rzeszutek Wilk
parent
65e053a703
commit
283c0972d5
@@ -1,6 +1,8 @@
|
||||
#define DPRINTK(fmt, args...) \
|
||||
pr_debug("xenbus_probe (%s:%d) " fmt ".\n", \
|
||||
__func__, __LINE__, ##args)
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#define DPRINTK(fmt, ...) \
|
||||
pr_debug("(%s:%d) " fmt "\n", \
|
||||
__func__, __LINE__, ##__VA_ARGS__)
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/err.h>
|
||||
@@ -36,13 +38,13 @@ static int frontend_bus_id(char bus_id[XEN_BUS_ID_SIZE], const char *nodename)
|
||||
{
|
||||
nodename = strchr(nodename, '/');
|
||||
if (!nodename || strlen(nodename + 1) >= XEN_BUS_ID_SIZE) {
|
||||
printk(KERN_WARNING "XENBUS: bad frontend %s\n", nodename);
|
||||
pr_warn("bad frontend %s\n", nodename);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
strlcpy(bus_id, nodename + 1, XEN_BUS_ID_SIZE);
|
||||
if (!strchr(bus_id, '/')) {
|
||||
printk(KERN_WARNING "XENBUS: bus_id %s no slash\n", bus_id);
|
||||
pr_warn("bus_id %s no slash\n", bus_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
*strchr(bus_id, '/') = '-';
|
||||
@@ -234,15 +236,13 @@ static int print_device_status(struct device *dev, void *data)
|
||||
|
||||
if (!dev->driver) {
|
||||
/* Information only: is this too noisy? */
|
||||
printk(KERN_INFO "XENBUS: Device with no driver: %s\n",
|
||||
xendev->nodename);
|
||||
pr_info("Device with no driver: %s\n", xendev->nodename);
|
||||
} else if (xendev->state < XenbusStateConnected) {
|
||||
enum xenbus_state rstate = XenbusStateUnknown;
|
||||
if (xendev->otherend)
|
||||
rstate = xenbus_read_driver_state(xendev->otherend);
|
||||
printk(KERN_WARNING "XENBUS: Timeout connecting "
|
||||
"to device: %s (local state %d, remote state %d)\n",
|
||||
xendev->nodename, xendev->state, rstate);
|
||||
pr_warn("Timeout connecting to device: %s (local state %d, remote state %d)\n",
|
||||
xendev->nodename, xendev->state, rstate);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -256,12 +256,13 @@ static bool wait_loop(unsigned long start, unsigned int max_delay,
|
||||
{
|
||||
if (time_after(jiffies, start + (*seconds_waited+5)*HZ)) {
|
||||
if (!*seconds_waited)
|
||||
printk(KERN_WARNING "XENBUS: Waiting for "
|
||||
"devices to initialise: ");
|
||||
pr_warn("Waiting for devices to initialise: ");
|
||||
*seconds_waited += 5;
|
||||
printk("%us...", max_delay - *seconds_waited);
|
||||
if (*seconds_waited == max_delay)
|
||||
pr_cont("%us...", max_delay - *seconds_waited);
|
||||
if (*seconds_waited == max_delay) {
|
||||
pr_cont("\n");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
schedule_timeout_interruptible(HZ/10);
|
||||
@@ -342,7 +343,7 @@ static void xenbus_reset_wait_for_backend(char *be, int expected)
|
||||
timeout = wait_event_interruptible_timeout(backend_state_wq,
|
||||
backend_state == expected, 5 * HZ);
|
||||
if (timeout <= 0)
|
||||
printk(KERN_INFO "XENBUS: backend %s timed out.\n", be);
|
||||
pr_info("backend %s timed out\n", be);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -365,7 +366,7 @@ static void xenbus_reset_frontend(char *fe, char *be, int be_state)
|
||||
be_watch.callback = xenbus_reset_backend_state_changed;
|
||||
backend_state = XenbusStateUnknown;
|
||||
|
||||
printk(KERN_INFO "XENBUS: triggering reconnect on %s\n", be);
|
||||
pr_info("triggering reconnect on %s\n", be);
|
||||
register_xenbus_watch(&be_watch);
|
||||
|
||||
/* fall through to forward backend to state XenbusStateInitialising */
|
||||
@@ -384,7 +385,7 @@ static void xenbus_reset_frontend(char *fe, char *be, int be_state)
|
||||
}
|
||||
|
||||
unregister_xenbus_watch(&be_watch);
|
||||
printk(KERN_INFO "XENBUS: reconnect done on %s\n", be);
|
||||
pr_info("reconnect done on %s\n", be);
|
||||
kfree(be_watch.node);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user