Skip to content

Commit

Permalink
xen: Convert printks to pr_<level>
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Perches authored and Konrad Rzeszutek Wilk committed Jun 28, 2013
1 parent 65e053a commit 283c097
Show file tree
Hide file tree
Showing 34 changed files with 215 additions and 196 deletions.
6 changes: 4 additions & 2 deletions drivers/xen/balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
* IN THE SOFTWARE.
*/

#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/errno.h>
Expand Down Expand Up @@ -242,7 +244,7 @@ static enum bp_state reserve_additional_memory(long credit)
rc = add_memory(nid, hotplug_start_paddr, balloon_hotplug << PAGE_SHIFT);

if (rc) {
pr_info("xen_balloon: %s: add_memory() failed: %i\n", __func__, rc);
pr_info("%s: add_memory() failed: %i\n", __func__, rc);
return BP_EAGAIN;
}

Expand Down Expand Up @@ -591,7 +593,7 @@ static int __init balloon_init(void)
if (!xen_domain())
return -ENODEV;

pr_info("xen/balloon: Initialising balloon driver.\n");
pr_info("Initialising balloon driver\n");

balloon_stats.current_pages = xen_pv_domain()
? min(xen_start_info->nr_pages - xen_released_pages, max_pfn)
Expand Down
6 changes: 4 additions & 2 deletions drivers/xen/cpu_hotplug.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt

#include <linux/notifier.h>

#include <xen/xen.h>
Expand Down Expand Up @@ -31,7 +33,7 @@ static int vcpu_online(unsigned int cpu)
err = xenbus_scanf(XBT_NIL, dir, "availability", "%15s", state);
if (err != 1) {
if (!xen_initial_domain())
printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
pr_err("Unable to read cpu state\n");
return err;
}

Expand All @@ -40,7 +42,7 @@ static int vcpu_online(unsigned int cpu)
else if (strcmp(state, "offline") == 0)
return 0;

printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d\n", state, cpu);
pr_err("unknown state(%s) on CPU%d\n", state, cpu);
return -EINVAL;
}
static void vcpu_hotplug(unsigned int cpu)
Expand Down
23 changes: 11 additions & 12 deletions drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* Jeremy Fitzhardinge <jeremy@xensource.com>, XenSource Inc, 2007
*/

#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt

#include <linux/linkage.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
Expand Down Expand Up @@ -600,8 +602,7 @@ static unsigned int __startup_pirq(unsigned int irq)
rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq);
if (rc != 0) {
if (!probing_irq(irq))
printk(KERN_INFO "Failed to obtain physical IRQ %d\n",
irq);
pr_info("Failed to obtain physical IRQ %d\n", irq);
return 0;
}
evtchn = bind_pirq.port;
Expand Down Expand Up @@ -693,8 +694,8 @@ int xen_bind_pirq_gsi_to_irq(unsigned gsi,

irq = xen_irq_from_gsi(gsi);
if (irq != -1) {
printk(KERN_INFO "xen_map_pirq_gsi: returning irq %d for gsi %u\n",
irq, gsi);
pr_info("%s: returning irq %d for gsi %u\n",
__func__, irq, gsi);
goto out;
}

Expand Down Expand Up @@ -812,10 +813,10 @@ int xen_destroy_irq(int irq)
* (free_domain_pirqs).
*/
if ((rc == -ESRCH && info->u.pirq.domid != DOMID_SELF))
printk(KERN_INFO "domain %d does not have %d anymore\n",
pr_info("domain %d does not have %d anymore\n",
info->u.pirq.domid, info->u.pirq.pirq);
else if (rc) {
printk(KERN_WARNING "unmap irq failed %d\n", rc);
pr_warn("unmap irq failed %d\n", rc);
goto out;
}
}
Expand Down Expand Up @@ -1621,8 +1622,8 @@ static void restore_pirqs(void)

rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
if (rc) {
printk(KERN_WARNING "xen map irq failed gsi=%d irq=%d pirq=%d rc=%d\n",
gsi, irq, pirq, rc);
pr_warn("xen map irq failed gsi=%d irq=%d pirq=%d rc=%d\n",
gsi, irq, pirq, rc);
xen_free_irq(irq);
continue;
}
Expand Down Expand Up @@ -1844,13 +1845,11 @@ void xen_callback_vector(void)
callback_via = HVM_CALLBACK_VECTOR(HYPERVISOR_CALLBACK_VECTOR);
rc = xen_set_callback_via(callback_via);
if (rc) {
printk(KERN_ERR "Request for Xen HVM callback vector"
" failed.\n");
pr_err("Request for Xen HVM callback vector failed\n");
xen_have_vector_callback = 0;
return;
}
printk(KERN_INFO "Xen HVM callback vector for event delivery is "
"enabled\n");
pr_info("Xen HVM callback vector for event delivery is enabled\n");
/* in the restore case the vector has already been allocated */
if (!test_bit(HYPERVISOR_CALLBACK_VECTOR, used_vectors))
alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR,
Expand Down
6 changes: 4 additions & 2 deletions drivers/xen/evtchn.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
* IN THE SOFTWARE.
*/

#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
Expand Down Expand Up @@ -547,11 +549,11 @@ static int __init evtchn_init(void)
/* Create '/dev/xen/evtchn'. */
err = misc_register(&evtchn_miscdev);
if (err != 0) {
printk(KERN_ERR "Could not register /dev/xen/evtchn\n");
pr_err("Could not register /dev/xen/evtchn\n");
return err;
}

printk(KERN_INFO "Event-channel device installed.\n");
pr_info("Event-channel device installed\n");

return 0;
}
Expand Down
6 changes: 4 additions & 2 deletions drivers/xen/gntalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
* grant operation.
*/

#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt

#include <linux/atomic.h>
#include <linux/module.h>
#include <linux/miscdevice.h>
Expand Down Expand Up @@ -507,7 +509,7 @@ static int gntalloc_mmap(struct file *filp, struct vm_area_struct *vma)
int rv, i;

if (!(vma->vm_flags & VM_SHARED)) {
printk(KERN_ERR "%s: Mapping must be shared.\n", __func__);
pr_err("%s: Mapping must be shared\n", __func__);
return -EINVAL;
}

Expand Down Expand Up @@ -584,7 +586,7 @@ static int __init gntalloc_init(void)

err = misc_register(&gntalloc_miscdev);
if (err != 0) {
printk(KERN_ERR "Could not register misc gntalloc device\n");
pr_err("Could not register misc gntalloc device\n");
return err;
}

Expand Down
8 changes: 5 additions & 3 deletions drivers/xen/gntdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#undef DEBUG

#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
Expand Down Expand Up @@ -760,7 +762,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
if (use_ptemod && map->vma)
goto unlock_out;
if (use_ptemod && priv->mm != vma->vm_mm) {
printk(KERN_WARNING "Huh? Other mm?\n");
pr_warn("Huh? Other mm?\n");
goto unlock_out;
}

Expand Down Expand Up @@ -795,7 +797,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
vma->vm_end - vma->vm_start,
find_grant_ptes, map);
if (err) {
printk(KERN_WARNING "find_grant_ptes() failure.\n");
pr_warn("find_grant_ptes() failure.\n");
goto out_put_map;
}
}
Expand Down Expand Up @@ -855,7 +857,7 @@ static int __init gntdev_init(void)

err = misc_register(&gntdev_miscdev);
if (err != 0) {
printk(KERN_ERR "Could not register gntdev device\n");
pr_err("Could not register gntdev device\n");
return err;
}
return 0;
Expand Down
17 changes: 8 additions & 9 deletions drivers/xen/grant-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
* IN THE SOFTWARE.
*/

#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/sched.h>
#include <linux/mm.h>
Expand Down Expand Up @@ -508,8 +510,7 @@ static void gnttab_handle_deferred(unsigned long unused)
entry = NULL;
} else {
if (!--entry->warn_delay)
pr_info("g.e. %#x still pending\n",
entry->ref);
pr_info("g.e. %#x still pending\n", entry->ref);
if (!first)
first = entry;
}
Expand Down Expand Up @@ -838,7 +839,7 @@ gnttab_retry_eagain_gop(unsigned int cmd, void *gop, int16_t *status,
} while ((*status == GNTST_eagain) && (delay < MAX_DELAY));

if (delay >= MAX_DELAY) {
printk(KERN_ERR "%s: %s eagain grant\n", func, current->comm);
pr_err("%s: %s eagain grant\n", func, current->comm);
*status = GNTST_bad_page;
}
}
Expand Down Expand Up @@ -1048,8 +1049,8 @@ static int gnttab_map(unsigned int start_idx, unsigned int end_idx)
xatp.gpfn = (xen_hvm_resume_frames >> PAGE_SHIFT) + i;
rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp);
if (rc != 0) {
printk(KERN_WARNING
"grant table add_to_physmap failed, err=%d\n", rc);
pr_warn("grant table add_to_physmap failed, err=%d\n",
rc);
break;
}
} while (i-- > start_idx);
Expand Down Expand Up @@ -1131,8 +1132,7 @@ static void gnttab_request_version(void)
grefs_per_grant_frame = PAGE_SIZE / sizeof(struct grant_entry_v1);
gnttab_interface = &gnttab_v1_ops;
}
printk(KERN_INFO "Grant tables using version %d layout.\n",
grant_table_version);
pr_info("Grant tables using version %d layout\n", grant_table_version);
}

static int gnttab_setup(void)
Expand All @@ -1150,8 +1150,7 @@ static int gnttab_setup(void)
gnttab_shared.addr = xen_remap(xen_hvm_resume_frames,
PAGE_SIZE * max_nr_gframes);
if (gnttab_shared.addr == NULL) {
printk(KERN_WARNING
"Failed to ioremap gnttab share frames!");
pr_warn("Failed to ioremap gnttab share frames!\n");
return -ENOMEM;
}
}
Expand Down
23 changes: 12 additions & 11 deletions drivers/xen/manage.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/*
* Handle extern requests for shutdown, reboot and sysrq
*/

#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -73,8 +76,7 @@ static int xen_suspend(void *data)

err = syscore_suspend();
if (err) {
printk(KERN_ERR "xen_suspend: system core suspend failed: %d\n",
err);
pr_err("%s: system core suspend failed: %d\n", __func__, err);
return err;
}

Expand Down Expand Up @@ -115,14 +117,14 @@ static void do_suspend(void)
during suspend. */
err = freeze_processes();
if (err) {
printk(KERN_ERR "xen suspend: freeze failed %d\n", err);
pr_err("%s: freeze failed %d\n", __func__, err);
goto out;
}
#endif

err = dpm_suspend_start(PMSG_FREEZE);
if (err) {
printk(KERN_ERR "xen suspend: dpm_suspend_start %d\n", err);
pr_err("%s: dpm_suspend_start %d\n", __func__, err);
goto out_thaw;
}

Expand All @@ -131,7 +133,7 @@ static void do_suspend(void)

err = dpm_suspend_end(PMSG_FREEZE);
if (err) {
printk(KERN_ERR "dpm_suspend_end failed: %d\n", err);
pr_err("dpm_suspend_end failed: %d\n", err);
si.cancelled = 0;
goto out_resume;
}
Expand All @@ -153,7 +155,7 @@ static void do_suspend(void)
dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE);

if (err) {
printk(KERN_ERR "failed to start xen_suspend: %d\n", err);
pr_err("failed to start xen_suspend: %d\n", err);
si.cancelled = 1;
}

Expand Down Expand Up @@ -245,7 +247,7 @@ static void shutdown_handler(struct xenbus_watch *watch,
if (handler->cb) {
handler->cb();
} else {
printk(KERN_INFO "Ignoring shutdown request: %s\n", str);
pr_info("Ignoring shutdown request: %s\n", str);
shutting_down = SHUTDOWN_INVALID;
}

Expand All @@ -265,8 +267,7 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec,
if (err)
return;
if (!xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key)) {
printk(KERN_ERR "Unable to read sysrq code in "
"control/sysrq\n");
pr_err("Unable to read sysrq code in control/sysrq\n");
xenbus_transaction_end(xbt, 1);
return;
}
Expand Down Expand Up @@ -299,14 +300,14 @@ static int setup_shutdown_watcher(void)

err = register_xenbus_watch(&shutdown_watch);
if (err) {
printk(KERN_ERR "Failed to set shutdown watcher\n");
pr_err("Failed to set shutdown watcher\n");
return err;
}

#ifdef CONFIG_MAGIC_SYSRQ
err = register_xenbus_watch(&sysrq_watch);
if (err) {
printk(KERN_ERR "Failed to set sysrq watcher\n");
pr_err("Failed to set sysrq watcher\n");
return err;
}
#endif
Expand Down
Loading

0 comments on commit 283c097

Please sign in to comment.