pr_dbg, pr_fmt
Subsystems (22)
cover pr_dbg, pr_fmt
One possible long term goal is to stop adding
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
to source files to prefix modulename to logging output.
It might be useful to eventually have kernel.h
use a standard #define pr_fmt which includes KBUILD_MODNAME instead of a blank or empty define.
Perhaps over time, the source modules that use pr_<level> with prefixes can be converted to use pr_fmt.
If all modules are converted, that will allow the printk routine to add module/filename/line/offset to the logging lines using some function similar to dynamic_debug and substantially reduct object string use by removing the repeated prefixes.
This patchset does not get to that result. The patches right now uses _more_ string space because all logging messages have unshared prefixes but it may be a useful start.
The patchset strips prefixes from printks and adds pr_fmt to arch/x86, crypto, kernel, and a few drivers.
It also converts printk(KERN_<level> to pr_<level> in a few files that already had some pr_<level> uses.
The conversion also generally used long length format strings in the place of multiple short strings to ease any grep/search.
Joe Perches (21):
include/linux/ dynamic_debug.h kernel.h: Remove KBUILD_MODNAME from dynamic_pr_debug, add #define pr_dbg ftrace.c: Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
mtrr: use pr_<level> and pr_fmt
microcode: use pr_<level> and add pr_fmt
amd_iommu.c: use pr_<level> and add pr_fmt(fmt)
es7000_32.c: use pr_<level> and add pr_fmt(fmt)
arch/x86/kernel/apic/: use pr_<level> and add pr_fmt(fmt)
mcheck/: use pr_<level> and add pr_fmt(fmt)
arch/x86/kernel/setup_percpu.c: use pr_<level> and add pr_fmt(fmt) arch/x86/kernel/cpu/: use pr_<level> and add pr_fmt(fmt)
i8254.c: Add pr_fmt(fmt)
kmmio.c: Add and use pr_fmt(fmt)
testmmiotrace.c: Add and use pr_fmt(fmt)
crypto/: use pr_<level> and add pr_fmt(fmt)
kernel/power/: use pr_<level> and add pr_fmt(fmt)
kernel/kexec.c: use pr_<level> and add pr_fmt(fmt)
crypto/async_tx/raid6test.c: use pr_<level> and add pr_fmt(fmt)
arch/x86/mm/mmio-mod.c: use pr_fmt
drivers/net/bonding/: : use pr_fmt
drivers/net/tlan: use pr_<level> and add pr_fmt(fmt)
drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg(
arch/x86/kernel/amd_iommu.c | 71 ++-- arch/x86/kernel/apic/apic.c | 48 ++-- arch/x86/kernel/apic/apic_flat_64.c | 5 +- arch/x86/kernel/apic/bigsmp_32.c | 8 +- arch/x86/kernel/apic/es7000_32.c | 12 +- arch/x86/kernel/apic/io_apic.c | 239 ++++++------ arch/x86/kernel/apic/nmi.c | 29 +- arch/x86/kernel/apic/numaq_32.c | 53 ++-- arch/x86/kernel/apic/probe_32.c | 18 +- arch/x86/kernel/apic/probe_64.c | 8 +- arch/x86/kernel/apic/summit_32.c | 23 +- arch/x86/kernel/apic/x2apic_uv_x.c | 26 +- arch/x86/kernel/cpu/addon_cpuid_features.c | 9 +- arch/x86/kernel/cpu/amd.c | 26 +- arch/x86/kernel/cpu/bugs.c | 23 +- arch/x86/kernel/cpu/bugs_64.c | 4 +- arch/x86/kernel/cpu/centaur.c | 12 +- arch/x86/kernel/cpu/common.c | 54 ++-- arch/x86/kernel/cpu/cpu_debug.c | 4 +- arch/x86/kernel/cpu/cyrix.c | 12 +- arch/x86/kernel/cpu/intel.c | 14 +- arch/x86/kernel/cpu/intel_cacheinfo.c | 14 +- arch/x86/kernel/cpu/mcheck/mce-inject.c | 20 +- arch/x86/kernel/cpu/mcheck/mce.c | 59 ++-- arch/x86/kernel/cpu/mcheck/mce_intel.c | 8 +- arch/x86/kernel/cpu/mcheck/p5.c | 21 +- arch/x86/kernel/cpu/mcheck/therm_throt.c | 21 +- arch/x86/kernel/cpu/mcheck/threshold.c | 7 +- arch/x86/kernel/cpu/mcheck/winchip.c | 8 +- arch/x86/kernel/cpu/mtrr/centaur.c | 4 +- arch/x86/kernel/cpu/mtrr/cleanup.c | 59 ++-- arch/x86/kernel/cpu/mtrr/generic.c | 39 +- arch/x86/kernel/cpu/mtrr/main.c | 32 +- arch/x86/kernel/cpu/perf_event.c | 10 +- arch/x86/kernel/cpu/perfctr-watchdog.c | 11 +- arch/x86/kernel/cpu/transmeta.c | 20 +- arch/x86/kernel/cpu/vmware.c | 11 +- arch/x86/kernel/ftrace.c | 8 +- arch/x86/kernel/microcode_amd.c | 5 +- arch/x86/kernel/microcode_core.c | 23 +- arch/x86/kernel/microcode_intel.c | 47 +-- arch/x86/kernel/setup_percpu.c | 13 +- arch/x86/kvm/i8254.c | 12 +- arch/x86/mm/kmmio.c | 40 +- arch/x86/mm/mmio-mod.c | 71 ++-- arch/x86/mm/testmmiotrace.c | 29 +- crypto/algapi.c | 4 +- crypto/ansi_cprng.c | 39 +- crypto/async_tx/async_tx.c | 5 +- crypto/async_tx/raid6test.c | 30 +- crypto/fips.c | 4 +- crypto/tcrypt.c | 75 ++-- crypto/testmgr.c | 286 ++++++-------- crypto/xor.c | 17 +- drivers/net/bonding/bond_3ad.c | 171 +++++---- drivers/net/bonding/bond_alb.c | 38 +-- drivers/net/bonding/bond_ipv6.c | 12 +- drivers/net/bonding/bond_main.c | 608 +++++++++++----------------- drivers/net/bonding/bond_sysfs.c | 322 ++++++--------- drivers/net/tlan.c | 135 +++--- drivers/net/tlan.h | 2 +- include/linux/dynamic_debug.h | 13 +- include/linux/kernel.h | 7 +- kernel/kexec.c | 21 +- kernel/power/hibernate.c | 46 +-- kernel/power/hibernate_nvs.c | 6 +- kernel/power/process.c | 29 +- kernel/power/snapshot.c | 36 +- kernel/power/suspend.c | 18 +- kernel/power/suspend_test.c | 18 +- kernel/power/swap.c | 42 +- kernel/power/swsusp.c | 10 +- kernel/power/user.c | 8 +- 73 files changed, 1543 insertions(+), 1749 deletions(-)
PATCH 11/21 i8254.c: Add pr_fmt(fmt)
Add pr_fmt(fmt) "pit: " fmt
Strip pit: prefixes from pr_debug
--- arch/x86/kvm/i8254.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)
arch/x86/kvm/i8254.c +7 -5
@@ -29,6 +29,8 @@* Based on QEMU and Xen. */ +#define pr_fmt (fmt) "pit: " fmt +#include <linux/kvm_host.h> #include "irq.h"
@@ -262,7 +264,7 @@ void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu)static void destroy_pit_timer (struct kvm_timer *pt) { -pr_debug ("pit: execute del timer!\n" ); +pr_debug ("execute del timer!\n" );hrtimer_cancel (&pt->timer); }
@@ -284,7 +286,7 @@ static void create_pit_timer(struct kvm_kpit_state *ps, u32 val, int is_period) interval =muldiv64 (val,NSEC_PER_SEC ,KVM_PIT_FREQ ); -pr_debug ("pit: create pit timer, interval is %llu nsec\n" , interval); +pr_debug ("create pit timer, interval is %llu nsec\n" , interval);/* TODO The new value only affected after the retriggered */ hrtimer_cancel (&pt->timer);
@@ -309,7 +311,7 @@ static void pit_load_count(struct kvm *kvm, int channel, u32 val)WARN_ON (!mutex_is_locked (&ps->lock)); -pr_debug ("pit: load_count val is %d, channel is %d\n" , val, channel); +pr_debug ("load_count val is %d, channel is %d\n" , val, channel);/* * The largest possible initial count is 0; this is equivalent
@@ -395,8 +397,8 @@ static int pit_ioport_write(struct kvm_io_device *this,mutex_lock (&pit_state->lock);if (val !=0 ) -pr_debug ("pit: write addr is 0x%x, len is %d, val is 0x%x\n" , - (unsigned int )addr, len, val); +pr_debug ("write addr is 0x%x, len is %d, val is 0x%x\n" , + (unsigned int )addr, len, val);if (addr ==3 ) { channel = val >>6 ;
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 15/21 kernel/power/: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) "PM: " fmt Converted printk(KERN_<level> to pr_<level>( Removed "PM: " prefix
Added pr_fmt() to __initdata strings
--- kernel/power/hibernate.c | 46 ++++++++++++++++++++--------------------- kernel/power/hibernate_nvs.c | 6 +++- kernel/power/process.c | 29 +++++++++++++------------ kernel/power/snapshot.c | 36 +++++++++++++++++--------------- kernel/power/suspend.c | 18 +++++++++------- kernel/power/suspend_test.c | 18 +++++++++------- kernel/power/swap.c | 42 +++++++++++++++++++------------------- kernel/power/swsusp.c | 10 +++++--- kernel/power/user.c | 8 ++++-- 9 files changed, 112 insertions(+), 101 deletions(-)
kernel/power/hibernate.c +22 -24
@@ -9,6 +9,8 @@* This file is released under the GPLv2. */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/suspend.h> #include <linux/syscalls.h> #include <linux/reboot.h>
@@ -84,7 +86,7 @@ EXPORT_SYMBOL(system_entering_hibernation);#ifdef CONFIG_PM_DEBUG static void hibernation_debug_sleep (void ) { -printk (KERN_INFO "hibernation debug: Waiting for 5 seconds.\n" ); +pr_info ("hibernation debug: Waiting for 5 seconds.\n" );mdelay (5000 ); }
@@ -223,8 +225,7 @@ static int create_image(int platform_mode)*/ error =dpm_suspend_noirq (PMSG_FREEZE );if (error) { -printk (KERN_ERR "PM: Some devices failed to power down, " -"aborting hibernation\n" ); +pr_err ("Some devices failed to power down, aborting hibernation\n" );return error; }
@@ -241,8 +242,7 @@ static int create_image(int platform_mode) error =sysdev_suspend (PMSG_FREEZE );if (error) { -printk (KERN_ERR "PM: Some system devices failed to power down, " -"aborting hibernation\n" ); +pr_err ("Some system devices failed to power down, aborting hibernation\n" ); goto Enable_irqs; }
@@ -253,8 +253,7 @@ static int create_image(int platform_mode)save_processor_state (); error =swsusp_arch_suspend ();if (error) -printk (KERN_ERR "PM: Error %d creating hibernation image\n" , - error); +pr_err ("Error %d creating hibernation image\n" , error);/* Restore control flow magically appears here */ restore_processor_state ();if (!in_suspend)
@@ -345,8 +344,7 @@ static int resume_target_kernel(bool platform_mode) error =dpm_suspend_noirq (PMSG_QUIESCE );if (error) { -printk (KERN_ERR "PM: Some devices failed to power down, " -"aborting resume\n" ); +pr_err ("Some devices failed to power down, aborting resume\n" );return error; }
@@ -523,7 +521,7 @@ static void power_down(void)* Valid image is on the disk, if we continue we risk serious data * corruption after resume. */ -printk (KERN_CRIT "PM: Please power down manually\n" ); +pr_crit ("Please power down manually\n" );while (1 ); }
@@ -567,9 +565,9 @@ int hibernate(void)if (error) goto Exit; -printk (KERN_INFO "PM: Syncing filesystems ... " ); +pr_info ("Syncing filesystems ... " );sys_sync (); -printk ("done.\n" ); +pr_cont ("done.\n" ); error =prepare_processes ();if (error)
@@ -590,13 +588,13 @@ int hibernate(void)if (hibernation_mode ==HIBERNATION_PLATFORM ) flags |=SF_PLATFORM_MODE ; -pr_debug ("PM: writing image.\n" ); +pr_debug ("writing image.\n" ); error =swsusp_write (flags);swsusp_free ();if (!error)power_down (); }else { -pr_debug ("PM: Image restored successfully.\n" ); +pr_debug ("Image restored successfully.\n" ); } Thaw:
@@ -657,7 +655,7 @@ static int software_resume(void) goto Unlock; } -pr_debug ("PM: Checking image partition %s\n" , resume_file); +pr_debug ("Checking image partition %s\n" , resume_file);/* Check if the device is there */ swsusp_resume_device =name_to_dev_t (resume_file);
@@ -682,10 +680,10 @@ static int software_resume(void) } Check_image: -pr_debug ("PM: Resume from partition %d:%d\n" , -MAJOR (swsusp_resume_device),MINOR (swsusp_resume_device)); +pr_debug ("Resume from partition %d:%d\n" , +MAJOR (swsusp_resume_device),MINOR (swsusp_resume_device)); -pr_debug ("PM: Checking hibernation image.\n" ); +pr_debug ("Checking hibernation image.\n" ); error =swsusp_check ();if (error) goto Unlock;
@@ -709,20 +707,20 @@ static int software_resume(void)if (error) goto Finish; -pr_debug ("PM: Preparing processes for restore.\n" ); +pr_debug ("Preparing processes for restore.\n" ); error =prepare_processes ();if (error) {swsusp_close (FMODE_READ ); goto Done; } -pr_debug ("PM: Reading hibernation image.\n" ); +pr_debug ("Reading hibernation image.\n" ); error =swsusp_read (&flags);if (!error)hibernation_restore (flags &SF_PLATFORM_MODE ); -printk (KERN_ERR "PM: Restore failed, recovering.\n" ); +pr_err ("Restore failed, recovering.\n" );swsusp_free ();thaw_processes (); Done:
@@ -735,7 +733,7 @@ static int software_resume(void)/* For success case, the suspend path will release the lock */ Unlock:mutex_unlock (&pm_mutex); -pr_debug ("PM: Resume from disk failed.\n" ); +pr_debug ("Resume from disk failed.\n" );return error; }
@@ -845,7 +843,7 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr, error = -EINVAL ;if (!error) -pr_debug ("PM: Hibernation mode set to '%s'\n" , +pr_debug ("Hibernation mode set to '%s'\n" , hibernation_modes[mode]);mutex_unlock (&pm_mutex);return error ? error : n;
@@ -877,7 +875,7 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,mutex_lock (&pm_mutex); swsusp_resume_device = res;mutex_unlock (&pm_mutex); -printk (KERN_INFO "PM: Starting manual resume from disk\n" ); +pr_info ("Starting manual resume from disk\n" ); noresume =0 ;software_resume (); ret = n;
kernel/power/hibernate_nvs.c +4 -2
@@ -6,6 +6,8 @@* This file is released under the GPLv2. */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/io.h> #include <linux/kernel.h> #include <linux/list.h>
@@ -108,7 +110,7 @@ void hibernate_nvs_save(void) {struct nvs_page *entry; -printk (KERN_INFO "PM: Saving platform NVS memory\n" ); +pr_info ("Saving platform NVS memory\n" );list_for_each_entry (entry, &nvs_list, node)if (entry->data) {
@@ -127,7 +129,7 @@ void hibernate_nvs_restore(void) {struct nvs_page *entry; -printk (KERN_INFO "PM: Restoring platform NVS memory\n" ); +pr_info ("Restoring platform NVS memory\n" );list_for_each_entry (entry, &nvs_list, node)if (entry->data)
kernel/power/process.c +15 -14
@@ -5,6 +5,7 @@* Originally from swsusp. */ +#define pr_fmt (fmt) "PM: " fmt#undef DEBUG
@@ -78,23 +79,23 @@ static int try_to_freeze_tasks(bool sig_only)* and caller must call thaw_processes() if something fails), * but it cleans up leftover PF_FREEZE requests. */ -printk ("\n" ); -printk (KERN_ERR "Freezing of tasks failed after %d.%02d seconds " -"(%d tasks refusing to freeze):\n" , - elapsed_csecs /100 , elapsed_csecs %100 , todo); +pr_cont ("\n" ); +pr_err ("Freezing of tasks failed after %d.%02d seconds " +"(%d tasks refusing to freeze):\n" , + elapsed_csecs /100 , elapsed_csecs %100 , todo);show_state ();read_lock (&tasklist_lock); do_each_thread(g, p) {task_lock (p);if (freezing (p) && !freezer_should_skip (p)) -printk (KERN_ERR " %s\n" , p->comm); +pr_err (" %s\n" , p->comm);cancel_freezing (p);task_unlock (p); }while_each_thread (g, p);read_unlock (&tasklist_lock); }else { -printk ("(elapsed %d.%02d seconds) " , elapsed_csecs /100 , - elapsed_csecs %100 ); +pr_cont ("(elapsed %d.%02d seconds) " , + elapsed_csecs /100 , elapsed_csecs %100 ); }return todo ? -EBUSY :0 ;
@@ -107,22 +108,22 @@ int freeze_processes(void) {int error; -printk ("Freezing user space processes ... " ); +pr_info ("Freezing user space processes ... " ); error =try_to_freeze_tasks (true);if (error) goto Exit; -printk ("done.\n" ); +pr_cont ("done.\n" ); -printk ("Freezing remaining freezable tasks ... " ); +pr_info ("Freezing remaining freezable tasks ... " ); error =try_to_freeze_tasks (false);if (error) goto Exit; -printk ("done." ); +pr_cont ("done." );oom_killer_disable (); Exit:BUG_ON (in_atomic ()); -printk ("\n" ); +pr_cont ("\n" );return error; }
@@ -151,10 +152,10 @@ void thaw_processes(void) {oom_killer_enable (); -printk ("Restarting tasks ... " ); +pr_info ("Restarting tasks ... " );thaw_tasks (true);thaw_tasks (false);schedule (); -printk ("done.\n" ); +pr_cont ("done.\n" ); }
kernel/power/snapshot.c +19 -17
@@ -10,6 +10,8 @@* */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/version.h> #include <linux/module.h> #include <linux/mm.h>
@@ -624,7 +626,7 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn, region->end_pfn = end_pfn;list_add_tail (®ion->list, &nosave_regions); Report: -printk (KERN_INFO "PM: Registered nosave memory: %016lx - %016lx\n" , +pr_info ("Registered nosave memory: %016lx - %016lx\n" , start_pfn <<PAGE_SHIFT , end_pfn <<PAGE_SHIFT ); }
@@ -693,9 +695,9 @@ static void mark_nosave_pages(struct memory_bitmap *bm)list_for_each_entry (region, &nosave_regions, list) {unsigned long pfn; -pr_debug ("PM: Marking nosave pages: %016lx - %016lx\n" , - region->start_pfn <<PAGE_SHIFT , - region->end_pfn <<PAGE_SHIFT ); +pr_debug ("Marking nosave pages: %016lx - %016lx\n" , + region->start_pfn <<PAGE_SHIFT , + region->end_pfn <<PAGE_SHIFT );for (pfn = region->start_pfn; pfn < region->end_pfn; pfn++)if (pfn_valid (pfn)) {
@@ -745,7 +747,7 @@ int create_basic_memory_bitmaps(void) free_pages_map = bm2;mark_nosave_pages (forbidden_pages_map); -pr_debug ("PM: Basic memory bitmaps created\n" ); +pr_debug ("Basic memory bitmaps created\n" );return 0 ;
@@ -780,7 +782,7 @@ void free_basic_memory_bitmaps(void)memory_bm_free (bm2,PG_UNSAFE_CLEAR );kfree (bm2); -pr_debug ("PM: Basic memory bitmaps freed\n" ); +pr_debug ("Basic memory bitmaps freed\n" ); }/**
@@ -1261,7 +1263,7 @@ int hibernate_preallocate_memory(void)struct timeval start, stop;int error; -printk (KERN_INFO "PM: Preallocating image memory... " ); +pr_info ("Preallocating image memory... " );do_gettimeofday (&start); error =memory_bm_create (&orig_bm,GFP_IMAGE ,PG_ANY );
@@ -1354,13 +1356,13 @@ int hibernate_preallocate_memory(void) out:do_gettimeofday (&stop); -printk (KERN_CONT "done (allocated %lu pages)\n" , pages); +pr_cont ("done (allocated %lu pages)\n" , pages);swsusp_show_speed (&start, &stop, pages,"Allocated" );return 0 ; err_out: -printk (KERN_CONT "\n" ); +pr_cont ("\n" );swsusp_free ();return -ENOMEM ; }
@@ -1402,8 +1404,8 @@ static int enough_free_mem(unsigned int nr_pages, unsigned int nr_highmem) free +=zone_page_state (zone,NR_FREE_PAGES ); nr_pages +=count_pages_for_highmem (nr_highmem); -pr_debug ("PM: Normal pages needed: %u + %u, available pages: %u\n" , - nr_pages,PAGES_FOR_IO , free); +pr_debug ("Normal pages needed: %u + %u, available pages: %u\n" , + nr_pages,PAGES_FOR_IO , free);return free > nr_pages +PAGES_FOR_IO ; }
@@ -1500,20 +1502,20 @@ asmlinkage int swsusp_save(void) {unsigned int nr_pages, nr_highmem; -printk (KERN_INFO "PM: Creating hibernation image: \n" ); +pr_info ("Creating hibernation image: \n" );drain_local_pages (NULL ); nr_pages =count_data_pages (); nr_highmem =count_highmem_pages (); -printk (KERN_INFO "PM: Need to copy %u pages\n" , nr_pages + nr_highmem); +pr_info ("Need to copy %u pages\n" , nr_pages + nr_highmem);if (!enough_free_mem (nr_pages, nr_highmem)) { -printk (KERN_ERR "PM: Not enough free memory\n" ); +pr_err ("Not enough free memory\n" );return -ENOMEM ; }if (swsusp_alloc (&orig_bm, ©_bm, nr_pages, nr_highmem)) { -printk (KERN_ERR "PM: Memory allocation failed\n" ); +pr_err ("Memory allocation failed\n" );return -ENOMEM ; }
@@ -1533,7 +1535,7 @@ asmlinkage int swsusp_save(void) nr_copy_pages = nr_pages; nr_meta_pages =DIV_ROUND_UP (nr_pages *sizeof (long ),PAGE_SIZE ); -printk (KERN_INFO "PM: Hibernation image created (%d pages copied)\n" , +pr_info ("Hibernation image created (%d pages copied)\n" , nr_pages);return 0 ;
@@ -1733,7 +1735,7 @@ static int check_header(struct swsusp_info *info)if (!reason && info->num_physpages != num_physpages) reason ="memory size" ;if (reason) { -printk (KERN_ERR "PM: Image mismatch: %s\n" , reason); +pr_err ("Image mismatch: %s\n" , reason);return -EPERM ; }return 0 ;
kernel/power/suspend.c +10 -8
@@ -8,6 +8,8 @@* This file is released under the GPLv2. */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/string.h> #include <linux/delay.h> #include <linux/errno.h>
@@ -61,7 +63,7 @@ static int suspend_test(int level) {#ifdef CONFIG_PM_DEBUG if (pm_test_level == level) { -printk (KERN_INFO "suspend debug: Waiting for 5 seconds.\n" ); +pr_info ("suspend debug: Waiting for 5 seconds.\n" );mdelay (5000 );return 1 ; }
@@ -134,7 +136,7 @@ static int suspend_enter(suspend_state_t state) error =dpm_suspend_noirq (PMSG_SUSPEND );if (error) { -printk (KERN_ERR "PM: Some devices failed to power down\n" ); +pr_err ("Some devices failed to power down\n" ); goto Platfrom_finish; }
@@ -202,7 +204,7 @@ int suspend_devices_and_enter(suspend_state_t state)suspend_test_start (); error =dpm_suspend_start (PMSG_SUSPEND );if (error) { -printk (KERN_ERR "PM: Some devices failed to suspend\n" ); +pr_err ("Some devices failed to suspend\n" ); goto Recover_platform; }suspend_test_finish ("suspend devices" );
@@ -261,11 +263,11 @@ int enter_state(suspend_state_t state)if (!mutex_trylock (&pm_mutex))return -EBUSY ; -printk (KERN_INFO "PM: Syncing filesystems ... " ); +pr_info ("Syncing filesystems ... " );sys_sync (); -printk ("done.\n" ); +pr_cont ("done.\n" ); -pr_debug ("PM: Preparing system for %s sleep\n" , pm_states[state]); +pr_debug ("Preparing system for %s sleep\n" , pm_states[state]); error =suspend_prepare ();if (error) goto Unlock;
@@ -273,11 +275,11 @@ int enter_state(suspend_state_t state)if (suspend_test (TEST_FREEZER )) goto Finish; -pr_debug ("PM: Entering %s sleep\n" , pm_states[state]); +pr_debug ("Entering %s sleep\n" , pm_states[state]); error =suspend_devices_and_enter (state); Finish: -pr_debug ("PM: Finishing wakeup.\n" ); +pr_debug ("Finishing wakeup.\n" );suspend_finish (); Unlock:mutex_unlock (&pm_mutex);
kernel/power/suspend_test.c +10 -8
@@ -6,6 +6,8 @@* This file is released under the GPLv2. */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/init.h> #include <linux/rtc.h>
@@ -38,8 +40,8 @@ void suspend_test_finish(const char *label)unsigned msec; msec =jiffies_to_msecs (abs (nj)); -pr_info ("PM: %s took %d.%03d seconds\n" , label, - msec /1000 , msec %1000 ); +pr_info ("%s took %d.%03d seconds\n" , + label, msec /1000 , msec %1000 );/* Warning on suspend means the RTC alarm period needs to be * larger -- the system was sooo slooowwww to suspend that the
@@ -60,13 +62,13 @@ void suspend_test_finish(const char *label)static void __init test_wakealarm (struct rtc_device *rtc,suspend_state_t state) {static char err_readtime[]__initdata = -KERN_ERR "PM: can't read %s time, err %d\n" ; + KERN_ERR pr_fmt("can't read %s time, err %d\n");static char err_wakealarm []__initdata = -KERN_ERR "PM: can't set %s wakealarm, err %d\n" ; + KERN_ERR pr_fmt("can't set %s wakealarm, err %d\n");static char err_suspend[]__initdata = -KERN_ERR "PM: suspend test failed, error %d\n" ; + KERN_ERR pr_fmt("suspend test failed, error %d\n");static char info_test[]__initdata = -KERN_INFO "PM: test RTC wakeup from '%s' suspend\n" ; + KERN_INFO pr_fmt("test RTC wakeup from '%s' suspend\n");unsigned long now;struct rtc_wkalrm alm;
@@ -132,7 +134,7 @@ static int __init has_wakealarm(struct device *dev, void *name_ptr)static suspend_state_t test_state__initdata =PM_SUSPEND_ON ;static char warn_bad_state[]__initdata = -KERN_WARNING "PM: can't test '%s' suspend state\n" ; + KERN_WARNING pr_fmt("can't test '%s' suspend state\n");static int __init setup_test_suspend (char *value) {
@@ -156,7 +158,7 @@ __setup("test_suspend", setup_test_suspend);static int __init test_suspend (void ) {static char warn_no_rtc[]__initdata = -KERN_WARNING "PM: no wakealarm-capable RTC driver is ready\n" ; + KERN_WARNING pr_fmt("no wakealarm-capable RTC driver is ready\n");char *pony =NULL ;struct rtc_device *rtc =NULL ;
kernel/power/swap.c +21 -21
151 lines not on this page · raw message
kernel/power/swsusp.c +6 -4
@@ -38,6 +38,8 @@* For TODOs,FIXMEs also look in Documentation/power/swsusp.txt */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/mm.h> #include <linux/suspend.h> #include <linux/spinlock.h>
@@ -181,8 +183,8 @@ void swsusp_show_speed(struct timeval *start, struct timeval *stop, centisecs =1 ;/* avoid div-by-zero */ k = nr_pages * (PAGE_SIZE /1024 ); kps = (k *100 ) / centisecs; -printk (KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n" , - msg, k, - centisecs /100 , centisecs %100 , - kps /1000 , (kps %1000 ) /10 ); +pr_info ("%s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n" , + msg, k, + centisecs /100 , centisecs %100 , + kps /1000 , (kps %1000 ) /10 ); }
kernel/power/user.c +5 -3
@@ -9,6 +9,8 @@* */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/suspend.h> #include <linux/syscalls.h> #include <linux/reboot.h>
@@ -221,9 +223,9 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,if (data->frozen)break ; -printk ("Syncing filesystems ... " ); +pr_info ("Syncing filesystems ... " );sys_sync (); -printk ("done.\n" ); +pr_cont ("done.\n" ); error =usermodehelper_disable ();if (error)
@@ -382,7 +384,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,break ;default : -printk (KERN_ERR "SNAPSHOT_PMOPS: invalid argument %ld\n" , arg); +pr_err ("SNAPSHOT_PMOPS: invalid argument %ld\n" , arg); }break ;
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 20/21 drivers/net/tlan: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Converted printk(KERN_<level> to pr_<level>(
Removed "TLAN: " prefixes
--- drivers/net/tlan.c | 135 ++++++++++++++++++++++++++-------------------------- 1 files changed, 68 insertions(+), 67 deletions(-)
drivers/net/tlan.c +68 -67
@@ -170,6 +170,8 @@* *******************************************************************************/ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/ioport.h>
@@ -468,7 +470,7 @@ static int __init tlan_probe(void) {int rc = -ENODEV ; -printk (KERN_INFO "%s" , tlan_banner); +pr_info ("%s" , tlan_banner);TLAN_DBG (TLAN_DEBUG_PROBE ,"Starting PCI Probe....\n" );
@@ -477,16 +479,16 @@ static int __init tlan_probe(void) rc =pci_register_driver (&tlan_driver);if (rc !=0 ) { -printk (KERN_ERR "TLAN: Could not register pci driver.\n" ); +pr_err ("Could not register pci driver.\n" ); goto err_out_pci_free; }TLAN_DBG (TLAN_DEBUG_PROBE ,"Starting EISA Probe....\n" );TLan_EisaProbe (); -printk (KERN_INFO "TLAN: %d device%s installed, PCI: %d EISA: %d\n" , - TLanDevicesInstalled, TLanDevicesInstalled ==1 ?"" :"s" , - tlan_have_pci, tlan_have_eisa); +pr_info ("%d device%s installed, PCI: %d EISA: %d\n" , + TLanDevicesInstalled, TLanDevicesInstalled ==1 ?"" :"s" , + tlan_have_pci, tlan_have_eisa);if (TLanDevicesInstalled ==0 ) { rc = -ENODEV ;
@@ -545,7 +547,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, rc =pci_request_regions (pdev, TLanSignature);if (rc) { -printk (KERN_ERR "TLAN: Could not reserve IO regions\n" ); +pr_err ("Could not reserve IO regions\n" ); goto err_out; } }
@@ -553,7 +555,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, dev =alloc_etherdev (sizeof (TLanPrivateInfo));if (dev ==NULL ) { -printk (KERN_ERR "TLAN: Could not allocate memory for device.\n" ); +pr_err ("Could not allocate memory for device.\n" ); rc = -ENOMEM ; goto err_out_regions; }
@@ -572,7 +574,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, rc =pci_set_dma_mask (pdev,DMA_BIT_MASK (32 ));if (rc) { -printk (KERN_ERR "TLAN: No suitable PCI mapping available.\n" ); +pr_err ("No suitable PCI mapping available.\n" ); goto err_out_free_dev; }
@@ -585,7 +587,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, } }if (!pci_io_base) { -printk (KERN_ERR "TLAN: No IO mappings available\n" ); +pr_err ("No IO mappings available\n" ); rc = -EIO ; goto err_out_free_dev; }
@@ -641,13 +643,13 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, rc =TLan_Init (dev);if (rc) { -printk (KERN_ERR "TLAN: Could not set up device.\n" ); +pr_err ("Could not set up device.\n" ); goto err_out_free_dev; } rc =register_netdev (dev);if (rc) { -printk (KERN_ERR "TLAN: Could not register device.\n" ); +pr_err ("Could not register device.\n" ); goto err_out_uninit; }
@@ -664,12 +666,12 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, tlan_have_eisa++; } -printk (KERN_INFO "TLAN: %s irq=%2d, io=%04x, %s, Rev. %d\n" , - dev->name, - (int ) dev->irq, - (int ) dev->base_addr, - priv->adapter->deviceLabel, - priv->adapterRev); +pr_info ("%s irq=%2d, io=%04x, %s, Rev. %d\n" , + dev->name, + (int )dev->irq, + (int )dev->base_addr, + priv->adapter->deviceLabel, + priv->adapterRev);return 0 ; err_out_uninit:
@@ -882,8 +884,8 @@ static int TLan_Init( struct net_device *dev ) priv->dmaSize = dma_size;if ( priv->dmaStorage ==NULL ) { -printk (KERN_ERR "TLAN: Could not allocate lists and buffers for %s.\n" , - dev->name ); +pr_err ("Could not allocate lists and buffers for %s.\n" , + dev->name);return -ENOMEM ; }memset ( priv->dmaStorage,0 , dma_size );
@@ -898,9 +900,8 @@ static int TLan_Init( struct net_device *dev ) (u8 ) priv->adapter->addrOfs + i, (u8 *) &dev->dev_addr[i] );if ( err ) { -printk (KERN_ERR "TLAN: %s: Error reading MAC from eeprom: %d\n" , - dev->name, - err ); +pr_err ("%s: Error reading MAC from eeprom: %d\n" , + dev->name, err); } dev->addr_len =6 ;
@@ -944,8 +945,8 @@ static int TLan_Open( struct net_device *dev ) dev->name, dev );if ( err ) { -pr_err ("TLAN: Cannot open %s because IRQ %d is already in use.\n" , - dev->name, dev->irq ); +pr_err ("Cannot open %s because IRQ %d is already in use.\n" , + dev->name, dev->irq);return err; }
@@ -1433,7 +1434,7 @@ static u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int ) }if (!ack) -printk (KERN_INFO "TLAN: Received interrupt for uncompleted TX frame.\n" ); +pr_info ("Received interrupt for uncompleted TX frame.\n" );if ( eoc ) { TLAN_DBG( TLAN_DEBUG_TX,
@@ -1583,7 +1584,7 @@ drop_and_reuse: }if (!ack) -printk (KERN_INFO "TLAN: Received interrupt for uncompleted RX frame.\n" ); +pr_info ("Received interrupt for uncompleted RX frame.\n" );if ( eoc ) {
@@ -1638,7 +1639,7 @@ drop_and_reuse:static u32 TLan_HandleDummy (struct net_device *dev,u16 host_int ) { -printk ("TLAN: Test interrupt on %s.\n" , dev->name ); +pr_info ("Test interrupt on %s.\n" , dev->name);return 1 ; }/* TLan_HandleDummy */
@@ -1730,7 +1731,7 @@ static u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int )if ( host_int &TLAN_HI_IV_MASK ) {netif_stop_queue ( dev ); error =inl ( dev->base_addr +TLAN_CH_PARM ); -printk ("TLAN: %s: Adaptor Error = 0x%x\n" , dev->name, error ); +pr_info ("%s: Adaptor Error = 0x%x\n" , dev->name, error);TLan_ReadAndClearStats ( dev,TLAN_RECORD );outl (TLAN_HC_AD_RST , dev->base_addr +TLAN_HOST_CMD );
@@ -1969,7 +1970,7 @@ static void TLan_ResetLists( struct net_device *dev ) list->buffer[0 ].count =TLAN_MAX_FRAME_SIZE |TLAN_LAST_BUFFER ; skb =netdev_alloc_skb (dev,TLAN_MAX_FRAME_SIZE +7 );if ( !skb ) { -pr_err ("TLAN: out of memory for received data.\n" ); +pr_err ("out of memory for received data.\n" );break ; }
@@ -2054,13 +2055,13 @@ static void TLan_PrintDio( u16 io_base )u32 data0, data1;int i; -printk ("TLAN: Contents of internal registers for io base 0x%04hx.\n" , - io_base ); -printk ("TLAN: Off. +0 +4\n" ); +pr_info ("Contents of internal registers for io base 0x%04hx.\n" , + io_base); +pr_info (" Off. +0 +4\n" );for ( i =0 ; i <0x4C ; i+=8 ) { data0 =TLan_DioRead32 ( io_base, i ); data1 =TLan_DioRead32 ( io_base, i +0x4 ); -printk ("TLAN: 0x%02x 0x%08x 0x%08x\n" , i, data0, data1 ); +pr_info (" 0x%02x 0x%08x 0x%08x\n" , i, data0, data1); } }/* TLan_PrintDio */
@@ -2089,14 +2090,14 @@ static void TLan_PrintList( TLanList *list, char *type, int num) {int i; -printk ("TLAN: %s List %d at %p\n" , type, num, list ); -printk ("TLAN: Forward = 0x%08x\n" , list->forward ); -printk ("TLAN: CSTAT = 0x%04hx\n" , list->cStat ); -printk ("TLAN: Frame Size = 0x%04hx\n" , list->frameSize ); +pr_info ("%s List %d at %p\n" , type, num, list); +pr_info (" Forward = 0x%08x\n" , list->forward); +pr_info (" CSTAT = 0x%04hx\n" , list->cStat); +pr_info (" Frame Size = 0x%04hx\n" , list->frameSize);/* for ( i = 0; i < 10; i++ ) { */ for ( i =0 ; i <2 ; i++ ) { -printk ("TLAN: Buffer[%d].count, addr = 0x%08x, 0x%08x\n" , - i, list->buffer[i].count, list->buffer[i].address ); +pr_info (" Buffer[%d].count, addr = 0x%08x, 0x%08x\n" , + i, list->buffer[i].count, list->buffer[i].address); } }/* TLan_PrintList */
@@ -2315,7 +2316,7 @@ TLan_FinishReset( struct net_device *dev )if ( ( priv->adapter->flags &TLAN_ADAPTER_UNMANAGED_PHY ) || ( priv->aui ) ) { status =MII_GS_LINK ; -printk ("TLAN: %s: Link forced.\n" , dev->name ); +pr_info ("%s: Link forced.\n" , dev->name); }else {TLan_MiiReadReg ( dev, phy,MII_GEN_STS , &status );udelay (1000 );
@@ -2327,7 +2328,7 @@ TLan_FinishReset( struct net_device *dev )TLan_MiiReadReg ( dev, phy,MII_AN_LPA , &partner );TLan_MiiReadReg ( dev, phy,TLAN_TLPHY_PAR , &tlphy_par ); -printk ("TLAN: %s: Link active with " , dev->name ); +pr_info ("%s: Link active with " , dev->name);if (!(tlphy_par &TLAN_PHY_AN_EN_STAT )) { printk( "forced 10%sMbps %s-Duplex\n", tlphy_par & TLAN_PHY_SPEED_100 ? "" : "0",
@@ -2336,7 +2337,7 @@ TLan_FinishReset( struct net_device *dev )printk ("AutoNegotiation enabled, at 10%sMbps %s-Duplex\n" , tlphy_par &TLAN_PHY_SPEED_100 ?"" :"0" , tlphy_par &TLAN_PHY_DUPLEX_FULL ?"Full" :"Half" ); -printk ("TLAN: Partner capability: " ); +printk ("Partner capability: " );for (i =5 ; i <=10 ; i++)if (partner & (1 <<i))printk ("%s" ,media[i-5 ]);
@@ -2351,7 +2352,7 @@ TLan_FinishReset( struct net_device *dev )TLan_SetTimer ( dev, (10 *HZ ),TLAN_TIMER_LINK_BEAT );#endif }else if (status &MII_GS_LINK ) { -printk ("TLAN: %s: Link active\n" , dev->name ); +pr_info ("%s: Link active\n" , dev->name);TLan_DioWrite8 ( dev->base_addr,TLAN_LED_REG ,TLAN_LED_LINK ); } }
@@ -2376,8 +2377,8 @@ TLan_FinishReset( struct net_device *dev )outl (TLAN_HC_GO |TLAN_HC_RT , dev->base_addr +TLAN_HOST_CMD );netif_carrier_on (dev); }else { -printk ("TLAN: %s: Link inactive, will retry in 10 secs...\n" , - dev->name ); +pr_info ("%s: Link inactive, will retry in 10 secs...\n" , + dev->name);TLan_SetTimer ( dev, (10 *HZ ),TLAN_TIMER_FINISH_RESET );return ; }
@@ -2461,23 +2462,23 @@ static void TLan_PhyPrint( struct net_device *dev ) phy = priv->phy[priv->phyNum];if ( priv->adapter->flags &TLAN_ADAPTER_UNMANAGED_PHY ) { -printk ("TLAN: Device %s, Unmanaged PHY.\n" , dev->name ); +pr_info ("Device %s, Unmanaged PHY.\n" , dev->name); }else if ( phy <=TLAN_PHY_MAX_ADDR ) { -printk ("TLAN: Device %s, PHY 0x%02x.\n" , dev->name, phy ); -printk ("TLAN: Off. +0 +1 +2 +3 \n" ); +pr_info ("Device %s, PHY 0x%02x.\n" , dev->name, phy); +pr_info (" Off. +0 +1 +2 +3 \n" );for ( i =0 ; i <0x20 ; i+=4 ) { -printk ("TLAN: 0x%02x" , i ); +pr_info (" 0x%02x" , i);TLan_MiiReadReg ( dev, phy, i, &data0 ); -printk (" 0x%04hx" , data0 ); +pr_cont (" 0x%04hx" , data0);TLan_MiiReadReg ( dev, phy, i +1 , &data1 ); -printk (" 0x%04hx" , data1 ); +pr_cont (" 0x%04hx" , data1);TLan_MiiReadReg ( dev, phy, i +2 , &data2 ); -printk (" 0x%04hx" , data2 ); +pr_cont (" 0x%04hx" , data2);TLan_MiiReadReg ( dev, phy, i +3 , &data3 ); -printk (" 0x%04hx\n" , data3 ); +pr_cont (" 0x%04hx\n" , data3); } }else { -printk ("TLAN: Device %s, Invalid PHY.\n" , dev->name ); +pr_info ("Device %s, Invalid PHY.\n" , dev->name); } }/* TLan_PhyPrint */
@@ -2545,7 +2546,7 @@ static void TLan_PhyDetect( struct net_device *dev ) }else if ( priv->phy[0 ] !=TLAN_PHY_NONE ) { priv->phyNum =0 ; }else { -printk ("TLAN: Cannot initialize device, no PHY was found!\n" ); +pr_info ("Cannot initialize device, no PHY was found!\n" ); } }/* TLan_PhyDetect */
@@ -2674,7 +2675,7 @@ static void TLan_PhyStartLink( struct net_device *dev )* but the card need additional time to start AN. * .5 sec should be plenty extra. */ -printk ("TLAN: %s: Starting autonegotiation.\n" , dev->name ); +pr_info ("%s: Starting autonegotiation.\n" , dev->name);TLan_SetTimer ( dev, (2 *HZ ),TLAN_TIMER_PHY_FINISH_AN );return ; }
@@ -2736,17 +2737,17 @@ static void TLan_PhyFinishAutoNeg( struct net_device *dev )/* Wait for 8 sec to give the process * more time. Perhaps we should fail after a while. */ -if (!priv->neg_be_verbose++) { -pr_info ("TLAN: Giving autonegotiation more time.\n" ); -pr_info ("TLAN: Please check that your adapter has\n" ); -pr_info ("TLAN: been properly connected to a HUB or Switch.\n" ); -pr_info ("TLAN: Trying to establish link in the background...\n" ); - } +if (!priv->neg_be_verbose++) { +pr_info ("Giving autonegotiation more time.\n" ); +pr_info ("Please check that your adapter has\n" ); +pr_info ("been properly connected to a HUB or Switch.\n" ); +pr_info ("Trying to establish link in the background...\n" ); + }TLan_SetTimer ( dev, (8 *HZ ),TLAN_TIMER_PHY_FINISH_AN );return ; } -printk ("TLAN: %s: Autonegotiation complete.\n" , dev->name ); +pr_info ("%s: Autonegotiation complete.\n" , dev->name);TLan_MiiReadReg ( dev, phy,MII_AN_ADV , &an_adv );TLan_MiiReadReg ( dev, phy,MII_AN_LPA , &an_lpa ); mode = an_adv & an_lpa &0x03E0 ;
@@ -2771,10 +2772,10 @@ static void TLan_PhyFinishAutoNeg( struct net_device *dev ) ( an_adv & an_lpa & 0x0040 ) ) { TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, MII_GC_AUTOENB | MII_GC_DUPLEX ); - pr_info("TLAN: Starting internal PHY with FULL-DUPLEX\n" ); + pr_info("Starting internal PHY with FULL-DUPLEX\n"); } else {TLan_MiiWriteReg ( dev, phy,MII_GEN_CTL ,MII_GC_AUTOENB ); -pr_info ("TLAN: Starting internal PHY with HALF-DUPLEX\n" ); +pr_info ("Starting internal PHY with HALF-DUPLEX\n" ); } }
@@ -2819,7 +2820,7 @@ void TLan_PhyMonitor( struct net_device *dev )if (!(phy_status &MII_GS_LINK )) {if (priv->link) { priv->link =0 ; -printk (KERN_DEBUG "TLAN: %s has lost link\n" , dev->name); +pr_dbg ("%s has lost link\n" , dev->name);netif_carrier_off (dev);TLan_SetTimer ( dev, (2 *HZ ),TLAN_TIMER_LINK_BEAT );return ;
@@ -2829,7 +2830,7 @@ void TLan_PhyMonitor( struct net_device *dev )/* Link restablished? */ if ((phy_status &MII_GS_LINK ) && !priv->link) { priv->link =1 ; -printk (KERN_DEBUG "TLAN: %s has reestablished link\n" , dev->name); +pr_dbg ("%s has reestablished link\n" , dev->name);netif_carrier_on (dev); }
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 16/21 kernel/kexec.c: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Converted printk(KERN_<level> to pr_<level>(
Added KERN_ERR to allocation failure message
--- kernel/kexec.c | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-)
kernel/kexec.c +10 -11
@@ -6,6 +6,8 @@* Version 2. See the file COPYING for more details. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/capability.h> #include <linux/mm.h> #include <linux/file.h>
@@ -245,13 +247,13 @@ static int kimage_normal_alloc(struct kimage **rimage, unsigned long entry, image->control_code_page =kimage_alloc_control_pages (image,get_order (KEXEC_CONTROL_PAGE_SIZE ));if (!image->control_code_page) { -printk (KERN_ERR "Could not allocate control_code_buffer\n" ); +pr_err ("Could not allocate control_code_buffer\n" ); goto out; } image->swap_page =kimage_alloc_control_pages (image,0 );if (!image->swap_page) { -printk (KERN_ERR "Could not allocate swap buffer\n" ); +pr_err ("Could not allocate swap buffer\n" ); goto out; }
@@ -320,7 +322,7 @@ static int kimage_crash_alloc(struct kimage **rimage, unsigned long entry, image->control_code_page =kimage_alloc_control_pages (image,get_order (KEXEC_CONTROL_PAGE_SIZE ));if (!image->control_code_page) { -printk (KERN_ERR "Could not allocate control_code_buffer\n" ); +pr_err ("Could not allocate control_code_buffer\n" ); goto out; }
@@ -1141,8 +1143,7 @@ static int __init crash_notes_memory_init(void)/* Allocate memory for saving cpu registers. */ crash_notes =alloc_percpu (note_buf_t);if (!crash_notes) { -printk ("Kexec: Memory allocation for saving cpu register" -" states failed\n" ); +pr_err ("Memory allocation for saving cpu register states failed\n" );return -ENOMEM ; }return 0 ;
@@ -1192,8 +1193,7 @@ static int __init parse_crashkernel_mem(char *cmdline,if (*cur !=':' ) { end =memparse (cur, &tmp);if (cur == tmp) { -pr_warning ("crashkernel: Memory " -"value expected\n" ); +pr_warning ("crashkernel: Memory value expected\n" );return -EINVAL ; } cur = tmp;
@@ -1211,7 +1211,7 @@ static int __init parse_crashkernel_mem(char *cmdline, size =memparse (cur, &tmp);if (cur == tmp) { -pr_warning ("Memory value expected\n" ); +pr_warning ("crashkernel: Memory value expected\n" );return -EINVAL ; } cur = tmp;
@@ -1234,8 +1234,7 @@ static int __init parse_crashkernel_mem(char *cmdline, cur++; *crash_base =memparse (cur, &tmp);if (cur == tmp) { -pr_warning ("Memory value expected " -"after '@'\n" ); +pr_warning ("crashkernel: Memory value expected after '@'\n" );return -EINVAL ; } }
@@ -1473,7 +1472,7 @@ int kernel_kexec(void)#endif {kernel_restart_prepare (NULL ); -printk (KERN_EMERG "Starting new kernel\n" ); +pr_emerg ("Starting new kernel\n" );machine_shutdown (); }
Signature · 7 lines
1.6.3.1.10.g659a0.dirty _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
PATCH 1/21 include/linux/ dynamic_debug.h kernel.h: Remove KBUILD_MODNAME from dynamic_pr_debug, add pr_dbg
In reply to Joe PerchesIf CONFIG_DYNAMIC_DEBUG is enabled and a source file has:
dynamic_debug.h will duplicate KBUILD_MODNAME in the output string.
Remove the use of KBUILD_MODNAME from the output format string generated by dynamic_debug.h
If CONFIG_DYNAMIC_DEBUG is not enabled, no compile-time check is done to printk/dev_printk arguments, add it.
Add a not compile-time optimized away, always printed macro #define pr_dbg(fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) which uses KERN_DEBUG.
pr_debug can be optimized away if DEBUG is not defined, pr_dbg will always print.
--- include/linux/dynamic_debug.h | 13 ++++++------- include/linux/kernel.h | 7 ++++--- 2 files changed, 10 insertions(+), 10 deletions(-)
include/linux/dynamic_debug.h +6 -7
@@ -57,8 +57,7 @@ extern int ddebug_remove_module(char *mod_name); {KBUILD_MODNAME , __func__, __FILE__, fmt,DEBUG_HASH , \ DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \if (__dynamic_dbg_enabled (descriptor)) \ - printk(KERN_DEBUG KBUILD_MODNAME ":" pr_fmt(fmt), \ - ##__VA_ARGS__); \ + printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ }while (0 )
@@ -69,9 +68,7 @@ extern int ddebug_remove_module(char *mod_name); {KBUILD_MODNAME , __func__, __FILE__, fmt,DEBUG_HASH , \ DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \if (__dynamic_dbg_enabled (descriptor)) \ -dev_printk (KERN_DEBUG , dev, \ -KBUILD_MODNAME ": " fmt, \ - ##__VA_ARGS__); \ + dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ }while (0 ) #else
@@ -81,8 +78,10 @@ static inline int ddebug_remove_module(char *mod)return 0 ; } -#define dynamic_pr_debug (fmt, ...) do { } while (0) -#define dynamic_dev_dbg (dev, format, ...) do { } while (0) +#define dynamic_pr_debug (fmt, ...) \ + do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0) +#define dynamic_dev_dbg (dev, format, ...) \ + do { if (0) dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); } while (0)#endif #endif
include/linux/kernel.h +4 -3
@@ -380,6 +380,8 @@ static inline char *pack_hex_byte(char *buf, u8 byte) printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define pr_dbg(fmt, ...) \ + printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #define pr_cont(fmt, ...) \ printk(KERN_CONT fmt, ##__VA_ARGS__)
@@ -398,9 +400,8 @@ static inline char *pack_hex_byte(char *buf, u8 byte) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #elif defined(CONFIG_DYNAMIC_DEBUG) /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ -#define pr_debug(fmt, ...) do { \ - dynamic_pr_debug(fmt, ##__VA_ARGS__); \ - } while (0) +#define pr_debug(fmt, ...) \ + dynamic_pr_debug(fmt, ##__VA_ARGS__) #else #define pr_debug(fmt, ...) \ ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 4/21 microcode: use pr_<level> and add pr_fmt
In reply to Joe PerchesAdded #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Converted a few printks to pr_<level>
Added a space after an exclamation point
--- arch/x86/kernel/microcode_amd.c | 5 +++- arch/x86/kernel/microcode_core.c | 23 ++++++++++-------- arch/x86/kernel/microcode_intel.c | 47 +++++++++++++++--------------------- 3 files changed, 37 insertions(+), 38 deletions(-)
arch/x86/kernel/microcode_amd.c +4 -1
@@ -13,6 +13,9 @@* Licensed under the terms of the GNU General Public * License version 2. See file COPYING for details. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/firmware.h> #include <linux/pci_ids.h> #include <linux/uaccess.h>
@@ -291,7 +294,7 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)if (!leftover) {vfree (uci->mc); uci->mc = new_mc; -pr_debug ("microcode: CPU%d found a matching microcode " +pr_debug ("CPU%d found a matching microcode " "update with version 0x%x (current=0x%x)\n" , cpu, new_rev, uci->cpu_sig.rev); }else {
arch/x86/kernel/microcode_core.c +13 -10
@@ -70,6 +70,9 @@* Fix sigmatch() macro to handle old CPUs with pf == 0. * Thanks to Stuart Swales for pointing out this bug. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/platform_device.h> #include <linux/miscdevice.h> #include <linux/capability.h>
@@ -211,7 +214,7 @@ static ssize_t microcode_write(struct file *file, const char __user *buf,ssize_t ret = -EINVAL ;if ((len >>PAGE_SHIFT ) > totalram_pages) { -pr_err ("microcode: too much data (max %ld pages)\n" , totalram_pages); +pr_err ("too much data (max %ld pages)\n" , totalram_pages);return ret; }
@@ -246,7 +249,7 @@ static int __init microcode_dev_init(void) error =misc_register (µcode_dev);if (error) { -pr_err ("microcode: can't misc_register on minor=%d\n" ,MICROCODE_MINOR ); +pr_err ("can't misc_register on minor=%d\n" ,MICROCODE_MINOR );return error; }
@@ -361,7 +364,7 @@ static enum ucode_state microcode_resume_cpu(int cpu)if (!uci->mc)return UCODE_NFOUND ; -pr_debug ("microcode: CPU%d updated upon resume\n" , cpu); +pr_debug ("CPU%d updated upon resume\n" , cpu);apply_microcode_on_target (cpu);return UCODE_OK ;
@@ -381,7 +384,7 @@ static enum ucode_state microcode_init_cpu(int cpu) ustate = microcode_ops->request_microcode_fw (cpu, µcode_pdev->dev);if (ustate ==UCODE_OK ) { -pr_debug ("microcode: CPU%d updated upon init\n" , cpu); +pr_debug ("CPU%d updated upon init\n" , cpu);apply_microcode_on_target (cpu); }
@@ -408,7 +411,7 @@ static int mc_sysdev_add(struct sys_device *sys_dev)if (!cpu_online (cpu))return 0 ; -pr_debug ("microcode: CPU%d added\n" , cpu); +pr_debug ("CPU%d added\n" , cpu); err =sysfs_create_group (&sys_dev->kobj, &mc_attr_group);if (err)
@@ -427,7 +430,7 @@ static int mc_sysdev_remove(struct sys_device *sys_dev)if (!cpu_online (cpu))return 0 ; -pr_debug ("microcode: CPU%d removed\n" , cpu); +pr_debug ("CPU%d removed\n" , cpu);microcode_fini_cpu (cpu);sysfs_remove_group (&sys_dev->kobj, &mc_attr_group);return 0 ;
@@ -475,15 +478,15 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)microcode_update_cpu (cpu);case CPU_DOWN_FAILED :case CPU_DOWN_FAILED_FROZEN : -pr_debug ("microcode: CPU%d added\n" , cpu); +pr_debug ("CPU%d added\n" , cpu);if (sysfs_create_group (&sys_dev->kobj, &mc_attr_group)) -pr_err ("microcode: Failed to create group for CPU%d\n" , cpu); +pr_err ("Failed to create group for CPU%d\n" , cpu);break ;case CPU_DOWN_PREPARE :case CPU_DOWN_PREPARE_FROZEN :/* Suspend is in progress, only remove the interface */ sysfs_remove_group (&sys_dev->kobj, &mc_attr_group); -pr_debug ("microcode: CPU%d removed\n" , cpu); +pr_debug ("CPU%d removed\n" , cpu);break ;case CPU_DEAD :case CPU_UP_CANCELED_FROZEN :
@@ -509,7 +512,7 @@ static int __init microcode_init(void) microcode_ops =init_amd_microcode ();if (!microcode_ops) { -pr_err ("microcode: no support for this CPU vendor\n" ); +pr_err ("no support for this CPU vendor\n" );return -ENODEV ; }
arch/x86/kernel/microcode_intel.c +20 -27
129 lines not on this page · raw message
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 2/21 ftrace.c: Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
In reply to Joe PerchesRemove prefixes from pr_<level>, use pr_fmt(fmt)
No change in output.
--- arch/x86/kernel/ftrace.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
arch/x86/kernel/ftrace.c +5 -3
@@ -9,6 +9,8 @@* the dangers of modifying code on the run. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/spinlock.h> #include <linux/hardirq.h> #include <linux/uaccess.h>
@@ -336,15 +338,15 @@ int __init ftrace_dyn_arch_init(void *data)switch (faulted) {case 0 : -pr_info ("ftrace: converting mcount calls to 0f 1f 44 00 00\n" ); +pr_info ("converting mcount calls to 0f 1f 44 00 00\n" );memcpy (ftrace_nop, ftrace_test_p6nop,MCOUNT_INSN_SIZE );break ;case 1 : -pr_info ("ftrace: converting mcount calls to 66 66 66 66 90\n" ); +pr_info ("converting mcount calls to 66 66 66 66 90\n" );memcpy (ftrace_nop, ftrace_test_nop5,MCOUNT_INSN_SIZE );break ;case 2 : -pr_info ("ftrace: converting mcount calls to jmp . + 5\n" ); +pr_info ("converting mcount calls to jmp . + 5\n" );memcpy (ftrace_nop, ftrace_test_jmp,MCOUNT_INSN_SIZE );break ; }
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 3/21 mtrr: use pr_<level> and pr_fmt
In reply to Joe PerchesAdded #define pr_fmt(fmt) "mtrr: " fmt Converted a few printks to pr_<level>
Used pr_dbg for non-optimized-away KERN_DEBUG levels [FW_WARN] now is printed after "mtrr: ", was before Fixed a spelling error
--- arch/x86/kernel/cpu/mtrr/centaur.c | 4 ++- arch/x86/kernel/cpu/mtrr/cleanup.c | 59 +++++++++++++++++++----------------- arch/x86/kernel/cpu/mtrr/generic.c | 39 +++++++++++++----------- arch/x86/kernel/cpu/mtrr/main.c | 32 ++++++++++--------- 4 files changed, 72 insertions(+), 62 deletions(-)
arch/x86/kernel/cpu/mtrr/centaur.c +3 -1
@@ -1,3 +1,5 @@ +#define pr_fmt (fmt) "mtrr: " fmt +#include <linux/init.h> #include <linux/mm.h>
@@ -103,7 +105,7 @@ centaur_validate_add_page(unsigned long base, unsigned long size, unsigned int t*/ if (type !=MTRR_TYPE_WRCOMB && (centaur_mcr_type ==0 || type !=MTRR_TYPE_UNCACHABLE )) { -pr_warning ("mtrr: only write-combining%s supported\n" , +pr_warning ("only write-combining%s supported\n" , centaur_mcr_type ?" and uncacheable are" :" is" );return -EINVAL ; }
arch/x86/kernel/cpu/mtrr/cleanup.c +31 -28
166 lines not on this page · raw message
arch/x86/kernel/cpu/mtrr/generic.c +21 -18
@@ -2,6 +2,9 @@* This only handles 32bit MTRR on 32bit hosts. This is strictly wrong * because MTRRs can span upto 40 bits (36bits on most modern x86) */ + +#define pr_fmt (fmt) "mtrr: " fmt +#define DEBUG #include <linux/module.h>
@@ -57,7 +60,7 @@ static inline void k8_check_syscfg_dram_mod_en(void)rdmsr (MSR_K8_SYSCFG , lo, hi);if (lo &K8_MTRRFIXRANGE_DRAM_MODIFY ) { - printk(KERN_ERR FW_WARN "MTRR: CPU %u: SYSCFG[MtrrFixDramModEn]" +pr_err (FW_WARN "CPU %u: SYSCFG[MtrrFixDramModEn]" " not cleared by BIOS, clearing this bit\n" ,smp_processor_id ()); lo &= ~K8_MTRRFIXRANGE_DRAM_MODIFY ;
@@ -261,10 +264,10 @@ static void __init print_mtrr_state(void)unsigned int i;int high_width; -pr_debug ("MTRR default type: %s\n" , +pr_debug ("default type: %s\n" ,mtrr_attrib_to_str (mtrr_state.def_type));if (mtrr_state.have_fixed) { -pr_debug ("MTRR fixed ranges %sabled:\n" , +pr_debug ("fixed ranges %sabled:\n" , mtrr_state.enabled &1 ?"en" :"dis" );print_fixed (0x00000 ,0x10000 , mtrr_state.fixed_ranges +0 );for (i =0 ; i <2 ; ++i)
@@ -277,7 +280,7 @@ static void __init print_mtrr_state(void)/* tail */ print_fixed_last (); } -pr_debug ("MTRR variable ranges %sabled:\n" , +pr_debug ("variable ranges %sabled:\n" , mtrr_state.enabled &2 ?"en" :"dis" );if (size_or_mask &0xffffffffUL ) high_width =ffs (size_or_mask &0xffffffffUL ) -1 ;
@@ -358,14 +361,14 @@ void __init mtrr_state_warn(void)if (!mask)return ;if (mask &MTRR_CHANGE_MASK_FIXED ) -pr_warning ("mtrr: your CPUs had inconsistent fixed MTRR settings\n" ); +pr_warning ("your CPUs had inconsistent fixed MTRR settings\n" );if (mask &MTRR_CHANGE_MASK_VARIABLE ) -pr_warning ("mtrr: your CPUs had inconsistent variable MTRR settings\n" ); +pr_warning ("your CPUs had inconsistent variable MTRR settings\n" );if (mask &MTRR_CHANGE_MASK_DEFTYPE ) -pr_warning ("mtrr: your CPUs had inconsistent MTRRdefType settings\n" ); +pr_warning ("your CPUs had inconsistent MTRRdefType settings\n" ); -printk (KERN_INFO "mtrr: probably your BIOS does not setup all CPUs.\n" ); -printk (KERN_INFO "mtrr: corrected configuration.\n" ); +pr_info ("probably your BIOS does not setup all CPUs.\n" ); +pr_info ("corrected configuration.\n" ); }/*
@@ -375,11 +378,9 @@ void __init mtrr_state_warn(void)*/ void mtrr_wrmsr (unsigned msr,unsigned a,unsigned b) { -if (wrmsr_safe (msr, a, b) <0 ) { -printk (KERN_ERR -"MTRR: CPU %u: Writing MSR %x to %x:%x failed\n" , -smp_processor_id (), msr, a, b); - } +if (wrmsr_safe (msr, a, b) <0 ) +pr_err ("CPU %u: Writing MSR %x to %x:%x failed\n" , +smp_processor_id (), msr, a, b); }/**
@@ -464,7 +465,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base, tmp |= ~((1 <<(hi -1 )) -1 );if (tmp != mask_lo) { -WARN_ONCE (1 ,KERN_INFO "mtrr: your BIOS has set up an incorrect mask, fixing it up.\n" ); + WARN_ONCE(1, KERN_INFO pr_fmt("your BIOS has set up an incorrect mask, fixing it up.\n")); mask_lo = tmp; } }
@@ -711,13 +712,14 @@ int generic_validate_add_page(unsigned long base, unsigned long size, boot_cpu_data.x86_model == 1 && boot_cpu_data.x86_mask <= 7) {if (base & ((1 << (22 -PAGE_SHIFT )) -1 )) { -pr_warning ("mtrr: base(0x%lx000) is not 4 MiB aligned\n" , base); +pr_warning ("base(0x%lx000) is not 4 MiB aligned\n" , + base);return -EINVAL ; }if (!(base + size <0x70000 || base >0x7003F ) && (type ==MTRR_TYPE_WRCOMB || type ==MTRR_TYPE_WRBACK )) { -pr_warning ("mtrr: writable mtrr between 0x70000000 and 0x7003FFFF may hang the CPU.\n" ); +pr_warning ("writable mtrr between 0x70000000 and 0x7003FFFF may hang the CPU.\n" );return -EINVAL ; } }
@@ -731,7 +733,8 @@ int generic_validate_add_page(unsigned long base, unsigned long size, lbase = lbase >> 1, last = last >> 1) ;if (lbase != last) { -pr_warning ("mtrr: base(0x%lx000) is not aligned on a size(0x%lx000) boundary\n" , base, size); +pr_warning ("base(0x%lx000) is not aligned on a size(0x%lx000) boundary\n" , + base, size);return -EINVAL ; }return 0 ;
arch/x86/kernel/cpu/mtrr/main.c +17 -15
@@ -31,6 +31,8 @@System Programming Guide; Section 9.11. (1997 edition - PPro). */ +#define pr_fmt (fmt) "mtrr: " fmt +#define DEBUG #include <linux/types.h> /* FIXME: kvm_para.h needs this */
@@ -90,7 +92,7 @@ static int have_wrcomb(void) dev->device == PCI_DEVICE_ID_SERVERWORKS_LE) {pci_read_config_byte (dev,PCI_CLASS_REVISION , &rev);if (rev <=5 ) { -pr_info ("mtrr: Serverworks LE rev < 6 detected. Write-combining disabled.\n" ); +pr_info ("Serverworks LE rev < 6 detected. Write-combining disabled.\n" );pci_dev_put (dev);return 0 ; }
@@ -101,7 +103,7 @@ static int have_wrcomb(void)*/ if (dev->vendor ==PCI_VENDOR_ID_INTEL && dev->device ==PCI_DEVICE_ID_INTEL_82451NX ) { -pr_info ("mtrr: Intel 450NX MMC detected. Write-combining disabled.\n" ); +pr_info ("Intel 450NX MMC detected. Write-combining disabled.\n" );pci_dev_put (dev);return 0 ; }
@@ -340,23 +342,23 @@ int mtrr_add_page(unsigned long base, unsigned long size,return error;if (type >=MTRR_NUM_TYPES ) { -pr_warning ("mtrr: type: %u invalid\n" , type); +pr_warning ("type: %u invalid\n" , type);return -EINVAL ; }/* If the type is WC, check that this processor supports it */ if ((type ==MTRR_TYPE_WRCOMB ) && !have_wrcomb ()) { -pr_warning ("mtrr: your processor doesn't support write-combining\n" ); +pr_warning ("your processor doesn't support write-combining\n" );return -ENOSYS ; }if (!size) { -pr_warning ("mtrr: zero sized request\n" ); +pr_warning ("zero sized request\n" );return -EINVAL ; }if (base & size_or_mask || size & size_or_mask) { -pr_warning ("mtrr: base or size exceeds the MTRR width\n" ); +pr_warning ("base or size exceeds the MTRR width\n" );return -EINVAL ; }
@@ -387,7 +389,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, }else if (types_compatible (type, ltype))continue ; } -pr_warning ("mtrr: 0x%lx000,0x%lx000 overlaps existing" +pr_warning ("0x%lx000,0x%lx000 overlaps existing" " 0x%lx000,0x%lx000\n" , base, size, lbase, lsize); goto out;
@@ -396,7 +398,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,if (ltype != type) {if (types_compatible (type, ltype))continue ; -pr_warning ("mtrr: type mismatch for %lx000,%lx000 old: %s new: %s\n" , +pr_warning ("type mismatch for %lx000,%lx000 old: %s new: %s\n" , base, size,mtrr_attrib_to_str (ltype),mtrr_attrib_to_str (type)); goto out;
@@ -422,7 +424,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, } } }else { -pr_info ("mtrr: no more MTRRs available\n" ); +pr_info ("no more MTRRs available\n" ); } error = i; out:
@@ -434,8 +436,8 @@ int mtrr_add_page(unsigned long base, unsigned long size,static int mtrr_check (unsigned long base,unsigned long size) {if ((base & (PAGE_SIZE -1 )) || (size & (PAGE_SIZE -1 ))) { -pr_warning ("mtrr: size and base must be multiples of 4 kiB\n" ); -pr_debug ("mtrr: size: 0x%lx base: 0x%lx\n" , size, base); +pr_warning ("size and base must be multiples of 4 kiB\n" ); +pr_debug ("size: 0x%lx base: 0x%lx\n" , size, base);dump_stack ();return -1 ; }
@@ -525,22 +527,22 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) } }if (reg <0 ) { -pr_debug ("mtrr: no MTRR for %lx000,%lx000 found\n" , +pr_debug ("no MTRR for %lx000,%lx000 found\n" , base, size); goto out; } }if (reg >= max) { -pr_warning ("mtrr: register: %d too big\n" , reg); +pr_warning ("register: %d too big\n" , reg); goto out; } mtrr_if->get (reg, &lbase, &lsize, <ype);if (lsize <1 ) { -pr_warning ("mtrr: MTRR %d not used\n" , reg); +pr_warning ("MTRR %d not used\n" , reg); goto out; }if (mtrr_usage_table[reg] <1 ) { -pr_warning ("mtrr: reg: %d has count=0\n" , reg); +pr_warning ("reg: %d has count=0\n" , reg); goto out; }if (--mtrr_usage_table[reg] <1 )
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 14/21 crypto/: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) as "alg: ", "PRNG: " and KBUILD_MODNAME ": " fmt Converted printk(KERN_<level> to pr_<level>(
Removed "alg: " and "PRNG: " prefixes
Some files now use KBUILD_MODNAMEprint_hex_dump now uses KERN_CRIT instead of KERN_CONT
--- crypto/algapi.c | 4 +- crypto/ansi_cprng.c | 39 +++---- crypto/async_tx/async_tx.c | 5 +- crypto/fips.c | 4 +- crypto/tcrypt.c | 75 ++++++------ crypto/testmgr.c | 286 +++++++++++++++++++------------------------- crypto/xor.c | 17 ++-- 7 files changed, 198 insertions(+), 232 deletions(-)
crypto/algapi.c +3 -1
@@ -10,6 +10,8 @@* */ +#define pr_fmt (fmt) "alg: " fmt +#include <linux/err.h> #include <linux/errno.h> #include <linux/init.h>
@@ -258,7 +260,7 @@ void crypto_alg_tested(const char *name, int err) goto found; } -printk (KERN_ERR "alg: Unexpected test result for %s: %d\n" , name, err); +pr_err ("Unexpected test result for %s: %d\n" , name, err); goto unlock; found:
crypto/ansi_cprng.c +17 -22
@@ -13,6 +13,8 @@* */ +#define pr_fmt (fmt) "PRNG: " fmt +#include <crypto/internal/rng.h> #include <linux/err.h> #include <linux/init.h>
@@ -57,20 +59,18 @@ struct prng_context {static int dbg; -static void hexdump (char *note,unsigned char *buf,unsigned int len) +static void hexdump (const char *note,const unsigned char *buf, +unsigned int len) {if (dbg) { -printk (KERN_CRIT "%s" , note); -print_hex_dump (KERN_CONT ,"" ,DUMP_PREFIX_OFFSET , -16 ,1 , - buf, len, false); +print_hex_dump (KERN_CRIT , note,DUMP_PREFIX_OFFSET , +16 ,1 , + buf, len, false); } } -#define dbgprint(format, args...) do {\ -if (dbg)\ - printk(format, ##args);\ -} while (0) +#define dbgprint(format, args...) \ + do { if (dbg) pr_crit(format, ##args); } while (0)static void xor_vectors (unsigned char *in1,unsigned char *in2,unsigned char *out,unsigned int size)
@@ -92,8 +92,7 @@ static int _get_more_prng_bytes(struct prng_context *ctx)unsigned char *output =NULL ; -dbgprint (KERN_CRIT "Calling _get_more_prng_bytes for context %p\n" , - ctx); +dbgprint ("Calling _get_more_prng_bytes for context %p\n" , ctx);hexdump ("Input DT: " , ctx->DT,DEFAULT_BLK_SZ );hexdump ("Input I: " , ctx->I,DEFAULT_BLK_SZ );
@@ -137,9 +136,8 @@ static int _get_more_prng_bytes(struct prng_context *ctx) ctx); } -printk (KERN_ERR -"ctx %p Failed repetition check!\n" , - ctx); +pr_err ("ctx %p Failed repetition check!\n" , + ctx); ctx->flags |=PRNG_NEED_RESET ;return -EINVAL ;
@@ -214,8 +212,7 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx) err = byte_count; -dbgprint (KERN_CRIT "getting %d random bytes for context %p\n" , - byte_count, ctx); +dbgprint ("getting %d random bytes for context %p\n" , byte_count, ctx); remainder:
@@ -268,8 +265,7 @@ empty_rbuf: done:spin_unlock_bh (&ctx->prng_lock); -dbgprint (KERN_CRIT "returning %d from get_prng_bytes in context %p\n" , - err, ctx); +dbgprint ("returning %d from get_prng_bytes in context %p\n" , err, ctx);return err; }
@@ -310,8 +306,8 @@ static int reset_prng_context(struct prng_context *ctx, ret =crypto_cipher_setkey (ctx->tfm, prng_key, klen);if (ret) { -dbgprint (KERN_CRIT "PRNG: setkey() failed flags=%x\n" , -crypto_cipher_get_flags (ctx->tfm)); +dbgprint ("setkey() failed flags=%x\n" , +crypto_cipher_get_flags (ctx->tfm)); goto out; }
@@ -329,8 +325,7 @@ static int cprng_init(struct crypto_tfm *tfm)spin_lock_init (&ctx->prng_lock); ctx->tfm =crypto_alloc_cipher ("aes" ,0 ,0 );if (IS_ERR (ctx->tfm)) { -dbgprint (KERN_CRIT "Failed to alloc tfm for context %p\n" , - ctx); +dbgprint ("Failed to alloc tfm for context %p\n" , ctx);return PTR_ERR (ctx->tfm); }
crypto/async_tx/async_tx.c +4 -1
@@ -23,6 +23,9 @@* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/rculist.h> #include <linux/kernel.h> #include <linux/async_tx.h>
@@ -32,7 +35,7 @@ static int __init async_tx_init(void) {async_dmaengine_get (); -printk (KERN_INFO "async_tx: api initialized (async)\n" ); +pr_info ("api initialized (async)\n" );return 0 ; }
crypto/fips.c +3 -1
@@ -10,6 +10,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include "internal.h" int fips_enabled;
@@ -19,7 +21,7 @@ EXPORT_SYMBOL_GPL(fips_enabled);static int fips_enable (char *str) { fips_enabled = !!simple_strtol (str,NULL ,0 ); -printk (KERN_INFO "fips mode: %s\n" , +pr_info ("fips mode: %s\n" , fips_enabled ?"enabled" :"disabled" );return 1 ; }
crypto/tcrypt.c +38 -37
192 lines not on this page · raw message
crypto/testmgr.c +124 -162
674 lines not on this page · raw message
crypto/xor.c +9 -8
@@ -16,6 +16,8 @@* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define BH_TRACE 0#include <linux/module.h> #include <linux/raid/xor.h>
@@ -91,8 +93,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) speed = max * (HZ *BENCH_SIZE /1024 ); tmpl->speed = speed; -printk (KERN_INFO " %-10s: %5d.%03d MB/sec\n" , tmpl->name, - speed /1000 , speed %1000 ); +pr_info (" %-10s: %5d.%03d MB/sec\n" , tmpl->name, + speed /1000 , speed %1000 ); } static int __init
@@ -108,7 +110,7 @@ calibrate_xor_blocks(void)*/ b1 = (void *)__get_free_pages (GFP_KERNEL | __GFP_NOTRACK,2 );if (!b1) { -printk (KERN_WARNING "xor: Yikes! No memory available.\n" ); +pr_warning ("Yikes! No memory available.\n" );return -ENOMEM ; } b2 = b1 +2 *PAGE_SIZE +BENCH_SIZE ;
@@ -127,12 +129,11 @@ calibrate_xor_blocks(void)#define xor_speed (templ) do_xor_speed((templ), b1, b2)if (fastest) { -printk (KERN_INFO "xor: automatically using best " -"checksumming function: %s\n" , +pr_info ("automatically using best checksumming function: %s\n" , fastest->name);xor_speed (fastest); }else { -printk (KERN_INFO "xor: measuring software checksum speed\n" ); +pr_info ("measuring software checksum speed\n" );XOR_TRY_TEMPLATES ; fastest = template_list;for (f = fastest; f; f = f->next)
@@ -140,8 +141,8 @@ calibrate_xor_blocks(void) fastest = f; } -printk (KERN_INFO "xor: using function: %s (%d.%03d MB/sec)\n" , - fastest->name, fastest->speed /1000 , fastest->speed %1000 ); +pr_info ("using function: %s (%d.%03d MB/sec)\n" , + fastest->name, fastest->speed /1000 , fastest->speed %1000 );#undef xor_speed
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 8/21 mcheck/: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Converted printk(KERN_<level> to pr_<level>(
--- arch/x86/kernel/cpu/mcheck/mce-inject.c | 20 ++++++----- arch/x86/kernel/cpu/mcheck/mce.c | 59 +++++++++++++++--------------- arch/x86/kernel/cpu/mcheck/mce_intel.c | 8 +++-- arch/x86/kernel/cpu/mcheck/p5.c | 21 +++++------ arch/x86/kernel/cpu/mcheck/therm_throt.c | 21 ++++++----- arch/x86/kernel/cpu/mcheck/threshold.c | 7 +++- arch/x86/kernel/cpu/mcheck/winchip.c | 8 +++-- 7 files changed, 76 insertions(+), 68 deletions(-)
arch/x86/kernel/cpu/mcheck/mce-inject.c +11 -9
@@ -11,6 +11,9 @@* Andi Kleen * Ying Huang */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/uaccess.h> #include <linux/module.h> #include <linux/timer.h>
@@ -106,7 +109,7 @@ static int raise_local(void)int cpu = m->extcpu;if (m->inject_flags &MCJ_EXCEPTION ) { -printk (KERN_INFO "Triggering MCE exception on CPU %d\n" , cpu); +pr_info ("Triggering MCE exception on CPU %d\n" , cpu);switch (context) {case MCJ_CTX_IRQ :/*
@@ -119,15 +122,15 @@ static int raise_local(void)raise_exception (m,NULL );break ;default : -printk (KERN_INFO "Invalid MCE context\n" ); +pr_info ("Invalid MCE context\n" ); ret = -EINVAL ; } -printk (KERN_INFO "MCE exception done on CPU %d\n" , cpu); +pr_info ("MCE exception done on CPU %d\n" , cpu); }else if (m->status) { -printk (KERN_INFO "Starting machine check poll CPU %d\n" , cpu); +pr_info ("Starting machine check poll CPU %d\n" , cpu);raise_poll (m);mce_notify_irq (); -printk (KERN_INFO "Machine check poll done on CPU %d\n" , cpu); +pr_info ("Machine check poll done on CPU %d\n" , cpu); }else m->finished =0 ;
@@ -161,9 +164,8 @@ static void raise_mce(struct mce *m) start = jiffies;while (!cpus_empty (mce_inject_cpumask)) {if (!time_before (jiffies, start +2 *HZ )) { -printk (KERN_ERR -"Timeout waiting for mce inject NMI %lx\n" , - *cpus_addr (mce_inject_cpumask)); +pr_err ("Timeout waiting for mce inject NMI %lx\n" , + *cpus_addr (mce_inject_cpumask));break ; }cpu_relax ();
@@ -210,7 +212,7 @@ static ssize_t mce_write(struct file *filp, const char __user *ubuf,static int inject_init (void ) { -printk (KERN_INFO "Machine check injector initialized\n" ); +pr_info ("Machine check injector initialized\n" ); mce_chrdev_ops.write = mce_write;register_die_notifier (&mce_raise_nb);return 0 ;
arch/x86/kernel/cpu/mcheck/mce.c +29 -30
138 lines not on this page · raw message
arch/x86/kernel/cpu/mcheck/mce_intel.c +5 -3
@@ -5,6 +5,8 @@* Author: Andi Kleen */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/interrupt.h> #include <linux/percpu.h>
@@ -66,9 +68,9 @@ static void intel_threshold_interrupt(void)static void print_update (char *type,int *hdr,int num) {if (*hdr ==0 ) -printk (KERN_INFO "CPU %d MCA banks" ,smp_processor_id ()); +pr_info ("CPU %d MCA banks" ,smp_processor_id ()); *hdr =1 ; -printk (KERN_CONT " %s:%d" , type, num); +pr_cont (" %s:%d" , type, num); }/*
@@ -115,7 +117,7 @@ static void cmci_discover(int banks, int boot) }spin_unlock_irqrestore (&cmci_discover_lock, flags);if (hdr) -printk (KERN_CONT "\n" ); +pr_cont ("\n" ); }/*
arch/x86/kernel/cpu/mcheck/p5.c +10 -11
@@ -2,6 +2,9 @@* P5 specific Machine Check Exception Reporting * (C) Copyright 2002 Alan Cox <[email protected]> */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/types.h>
@@ -24,14 +27,12 @@ static void pentium_machine_check(struct pt_regs *regs, long error_code)rdmsr (MSR_IA32_P5_MC_ADDR , loaddr, hi);rdmsr (MSR_IA32_P5_MC_TYPE , lotype, hi); -printk (KERN_EMERG -"CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n" , -smp_processor_id (), loaddr, lotype); +pr_emerg ("CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n" , +smp_processor_id (), loaddr, lotype);if (lotype & (1 <<5 )) { -printk (KERN_EMERG -"CPU#%d: Possible thermal failure (CPU on fire ?).\n" , -smp_processor_id ()); +pr_emerg ("CPU#%d: Possible thermal failure (CPU on fire ?).\n" , +smp_processor_id ()); }add_taint (TAINT_MACHINE_CHECK );
@@ -57,12 +58,10 @@ void intel_p5_mcheck_init(struct cpuinfo_x86 *c)/* Read registers before enabling: */ rdmsr (MSR_IA32_P5_MC_ADDR , l, h);rdmsr (MSR_IA32_P5_MC_TYPE , l, h); -printk (KERN_INFO -"Intel old style machine check architecture supported.\n" ); +pr_info ("Intel old style machine check architecture supported.\n" );/* Enable MCE: */ set_in_cr4 (X86_CR4_MCE ); -printk (KERN_INFO -"Intel old style machine check reporting enabled on CPU#%d.\n" , -smp_processor_id ()); +pr_info ("Intel old style machine check reporting enabled on CPU#%d.\n" , +smp_processor_id ()); }
arch/x86/kernel/cpu/mcheck/therm_throt.c +11 -10
@@ -13,6 +13,9 @@* Credits: Adapted from Zwane Mwaikambo's original code in mce_intel.c. * Inspired by Ross Biro's and Al Borchers' counter code. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/interrupt.h> #include <linux/notifier.h> #include <linux/jiffies.h>
@@ -130,13 +133,14 @@ static int therm_throt_process(bool is_throttled)/* if we just entered the thermal event */ if (is_throttled) { -printk (KERN_CRIT "CPU%d: Temperature above threshold, cpu clock throttled (total events = %lu)\n" , this_cpu, state->throttle_count); +pr_crit ("CPU%d: Temperature above threshold, cpu clock throttled (total events = %lu)\n" , + this_cpu, state->throttle_count);add_taint (TAINT_MACHINE_CHECK );return 1 ; }if (was_throttled) { -printk (KERN_INFO "CPU%d: Temperature/speed normal\n" , this_cpu); +pr_info ("CPU%d: Temperature/speed normal\n" , this_cpu);return 1 ; }
@@ -236,8 +240,7 @@ static void intel_thermal_interrupt(void)static void unexpected_thermal_interrupt (void ) { -printk (KERN_ERR "CPU%d: Unexpected LVT TMR interrupt!\n" , -smp_processor_id ()); +pr_err ("CPU%d: Unexpected LVT TMR interrupt!\n" ,smp_processor_id ());add_taint (TAINT_MACHINE_CHECK ); }
@@ -272,15 +275,13 @@ void intel_init_thermal(struct cpuinfo_x86 *c)rdmsr (MSR_IA32_MISC_ENABLE , l, h); h =apic_read (APIC_LVTTHMR );if ((l &MSR_IA32_MISC_ENABLE_TM1 ) && (h &APIC_DM_SMI )) { -printk (KERN_DEBUG -"CPU%d: Thermal monitoring handled by SMI\n" , cpu); +pr_dbg ("CPU%d: Thermal monitoring handled by SMI\n" , cpu);return ; }/* Check whether a vector already exists */ if (h &APIC_VECTOR_MASK ) { -printk (KERN_DEBUG -"CPU%d: Thermal LVT vector (%#x) already installed\n" , +pr_dbg ("CPU%d: Thermal LVT vector (%#x) already installed\n" , cpu, (h &APIC_VECTOR_MASK ));return ; }
@@ -312,8 +313,8 @@ void intel_init_thermal(struct cpuinfo_x86 *c) l =apic_read (APIC_LVTTHMR );apic_write (APIC_LVTTHMR , l & ~APIC_LVT_MASKED ); -printk (KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n" , - cpu, tm2 ?"TM2" :"TM1" ); +pr_info ("CPU%d: Thermal monitoring enabled (%s)\n" , + cpu, tm2 ?"TM2" :"TM1" );/* enable thermal throttle processing */ atomic_set (&therm_throt_en,1 );
arch/x86/kernel/cpu/mcheck/threshold.c +5 -2
@@ -1,6 +1,9 @@/* * Common corrected MCE threshold handler code: */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/interrupt.h> #include <linux/kernel.h>
@@ -11,8 +14,8 @@static void default_threshold_interrupt (void ) { -printk (KERN_ERR "Unexpected threshold interrupt at vector %x\n" , -THRESHOLD_APIC_VECTOR ); +pr_err ("Unexpected threshold interrupt at vector %x\n" , +THRESHOLD_APIC_VECTOR ); }void (*mce_threshold_vector)(void ) = default_threshold_interrupt;
arch/x86/kernel/cpu/mcheck/winchip.c +5 -3
@@ -2,6 +2,9 @@* IDT Winchip specific Machine Check Exception Reporting * (C) Copyright 2002 Alan Cox <[email protected]> */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/types.h>
@@ -15,7 +18,7 @@/* Machine check handler for WinChip C6: */ static void winchip_machine_check (struct pt_regs *regs,long error_code) { -printk (KERN_EMERG "CPU0: Machine Check Exception.\n" ); +pr_emerg ("CPU0: Machine Check Exception.\n" );add_taint (TAINT_MACHINE_CHECK ); }
@@ -35,6 +38,5 @@ void winchip_mcheck_init(struct cpuinfo_x86 *c)set_in_cr4 (X86_CR4_MCE ); -printk (KERN_INFO -"Winchip machine check reporting enabled on CPU#0.\n" ); +pr_info ("Winchip machine check reporting enabled on CPU#0.\n" ); }
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 9/21 arch/x86/kernel/setup_percpu.c: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Stripped PERCPU: from a pr_warning
--- arch/x86/kernel/setup_percpu.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-)
arch/x86/kernel/setup_percpu.c +7 -6
@@ -1,3 +1,5 @@ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
@@ -20,9 +22,9 @@#include <asm/stackprotector.h> #ifdef CONFIG_DEBUG_PER_CPU_MAPS -# define DBG(x...) printk(KERN_DEBUG x) +# define DBG (fmt, ...) pr_dbg(fmt, ##__VA_ARGS__)#else -# define DBG(x...) +# define DBG (fmt, ...) do { if (0) pr_dbg(fmt, ##__VA_ARGS__); } while (0)#endif DEFINE_PER_CPU (int, cpu_number);
@@ -116,8 +118,8 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size, } else { ptr =__alloc_bootmem_node_nopanic (NODE_DATA (node), size, align, goal); -pr_debug ("per cpu data for cpu%d %lu bytes on node%d at " -"%016lx\n" , cpu, size, node,__pa (ptr)); +pr_debug ("per cpu data for cpu%d %lu bytes on node%d at %016lx\n" , + cpu, size, node,__pa (ptr)); }return ptr;#else
@@ -198,8 +200,7 @@ void __init setup_per_cpu_areas(void) pcpu_cpu_distance, pcpu_fc_alloc, pcpu_fc_free);if (rc <0 ) -pr_warning ("PERCPU: %s allocator failed (%d), " -"falling back to page size\n" , +pr_warning ("%s allocator failed (%d), falling back to page size\n" , pcpu_fc_names[pcpu_chosen_fc], rc); }if (rc <0 )
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 5/21 amd_iommu.c: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Converted a few bare printks to pr_cont
--- arch/x86/kernel/amd_iommu.c | 71 ++++++++++++++++++++++-------------------- 1 files changed, 37 insertions(+), 34 deletions(-)
arch/x86/kernel/amd_iommu.c +37 -34
@@ -17,6 +17,8 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define pr_fmt (fmt) "AMD-Vi: " fmt +#include <linux/pci.h> #include <linux/gfp.h> #include <linux/bitops.h>
@@ -147,7 +149,7 @@ static void dump_dte_entry(u16 devid)int i;for (i =0 ; i <8 ; ++i) -pr_err ("AMD-Vi: DTE[%d]: %08x\n" , i, +pr_err ("DTE[%d]: %08x\n" , i, amd_iommu_dev_table[devid].data[i]); }
@@ -157,7 +159,7 @@ static void dump_command(unsigned long phys_addr)int i;for (i =0 ; i <4 ; ++i) -pr_err ("AMD-Vi: CMD[%d]: %08x\n" , i, cmd->data[i]); +pr_err ("CMD[%d]: %08x\n" , i, cmd->data[i]); }static void iommu_print_event (struct amd_iommu *iommu,void *__evt)
@@ -169,57 +171,58 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)int flags = (event[1 ] >>EVENT_FLAGS_SHIFT ) &EVENT_FLAGS_MASK ;u64 address = (u64)(((u64 )event[3 ]) <<32 ) | event[2 ]; -printk (KERN_ERR "AMD-Vi: Event logged [" ); +pr_err ("Event logged [" );switch (type) {case EVENT_TYPE_ILL_DEV : -printk ("ILLEGAL_DEV_TABLE_ENTRY device=%02x:%02x.%x " -"address=0x%016llx flags=0x%04x]\n" , -PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), - address, flags); +pr_cont ("ILLEGAL_DEV_TABLE_ENTRY device=%02x:%02x.%x " +"address=0x%016llx flags=0x%04x]\n" , +PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), + address, flags);dump_dte_entry (devid);break ;case EVENT_TYPE_IO_FAULT : -printk ("IO_PAGE_FAULT device=%02x:%02x.%x " -"domain=0x%04x address=0x%016llx flags=0x%04x]\n" , -PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), - domid, address, flags); +pr_cont ("IO_PAGE_FAULT device=%02x:%02x.%x " +"domain=0x%04x address=0x%016llx flags=0x%04x]\n" , +PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), + domid, address, flags);break ;case EVENT_TYPE_DEV_TAB_ERR : -printk ("DEV_TAB_HARDWARE_ERROR device=%02x:%02x.%x " -"address=0x%016llx flags=0x%04x]\n" , -PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), - address, flags); +pr_cont ("DEV_TAB_HARDWARE_ERROR device=%02x:%02x.%x " +"address=0x%016llx flags=0x%04x]\n" , +PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), + address, flags);break ;case EVENT_TYPE_PAGE_TAB_ERR : -printk ("PAGE_TAB_HARDWARE_ERROR device=%02x:%02x.%x " -"domain=0x%04x address=0x%016llx flags=0x%04x]\n" , -PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), - domid, address, flags); +pr_cont ("PAGE_TAB_HARDWARE_ERROR device=%02x:%02x.%x " +"domain=0x%04x address=0x%016llx flags=0x%04x]\n" , +PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), + domid, address, flags);break ;case EVENT_TYPE_ILL_CMD : -printk ("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n" , address); +pr_cont ("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n" , address);reset_iommu_command_buffer (iommu);dump_command (address);break ;case EVENT_TYPE_CMD_HARD_ERR : -printk ("COMMAND_HARDWARE_ERROR address=0x%016llx " -"flags=0x%04x]\n" , address, flags); +pr_cont ("COMMAND_HARDWARE_ERROR address=0x%016llx " +"flags=0x%04x]\n" , address, flags);break ;case EVENT_TYPE_IOTLB_INV_TO : -printk ("IOTLB_INV_TIMEOUT device=%02x:%02x.%x " -"address=0x%016llx]\n" , -PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), - address); +pr_cont ("IOTLB_INV_TIMEOUT device=%02x:%02x.%x " +"address=0x%016llx]\n" , +PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), + address);break ;case EVENT_TYPE_INV_DEV_REQ : -printk ("INVALID_DEVICE_REQUEST device=%02x:%02x.%x " -"address=0x%016llx flags=0x%04x]\n" , -PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), - address, flags); +pr_cont ("INVALID_DEVICE_REQUEST device=%02x:%02x.%x " +"address=0x%016llx flags=0x%04x]\n" , +PCI_BUS (devid),PCI_SLOT (devid),PCI_FUNC (devid), + address, flags);break ;default : -printk (KERN_ERR "UNKNOWN type=0x%02x]\n" , type); +pr_cont ("\n" ); +pr_err ("UNKNOWN type=0x%02x]\n" , type); } }
@@ -558,10 +561,10 @@ static void flush_devices_by_domain(struct protection_domain *domain)static void reset_iommu_command_buffer (struct amd_iommu *iommu) { -pr_err ("AMD-Vi: Resetting IOMMU command buffer\n" ); +pr_err ("Resetting IOMMU command buffer\n" );if (iommu->reset_in_progress) -panic ("AMD-Vi: ILLEGAL_COMMAND_ERROR while resetting command buffer\n" ); +panic (pr_fmt ("ILLEGAL_COMMAND_ERROR while resetting command buffer\n" )); iommu->reset_in_progress = true;
@@ -2418,7 +2421,7 @@ int __init amd_iommu_init_passthrough(void)__attach_device (iommu, pt_domain, devid2); } -pr_info ("AMD-Vi: Initialized for Passthrough Mode\n" ); +pr_info ("Initialized for Passthrough Mode\n" );return 0 ; }
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 13/21 testmmiotrace.c: Add and use pr_fmt(fmt)
In reply to Joe PerchesAdd #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Strip MODULE_NAME from pr_<level>s
Remove MODULE_NAME definition
--- arch/x86/mm/testmmiotrace.c | 29 ++++++++++++++--------------- 1 files changed, 14 insertions(+), 15 deletions(-)
arch/x86/mm/testmmiotrace.c +14 -15
@@ -1,12 +1,13 @@/* * Written by Pekka Paalanen, 2008-2009 <[email protected]> */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/io.h> #include <linux/mmiotrace.h> -#define MODULE_NAME "testmmiotrace" -static unsigned long mmio_address;module_param (mmio_address, ulong,0 ); MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB "
@@ -30,7 +31,7 @@ static unsigned v32(unsigned i)static void do_write_test (void __iomem *p) {unsigned int i; -pr_info (MODULE_NAME ": write test.\n" ); +pr_info ("write test.\n" );mmiotrace_printk ("Write test.\n" );for (i =0 ; i <256 ; i++)
@@ -47,7 +48,7 @@ static void do_read_test(void __iomem *p) {unsigned int i;unsigned errs[3 ] = {0 }; -pr_info (MODULE_NAME ": read test.\n" ); +pr_info ("read test.\n" );mmiotrace_printk ("Read test.\n" );for (i =0 ; i <256 ; i++)
@@ -68,7 +69,7 @@ static void do_read_test(void __iomem *p)static void do_read_far_test (void __iomem *p) { -pr_info (MODULE_NAME ": read far test.\n" ); +pr_info ("read far test.\n" );mmiotrace_printk ("Read far test.\n" );ioread32 (p + read_far);
@@ -78,7 +79,7 @@ static void do_test(unsigned long size) {void __iomem *p =ioremap_nocache (mmio_address, size);if (!p) { -pr_err (MODULE_NAME ": could not ioremap, aborting.\n" ); +pr_err ("could not ioremap, aborting.\n" );return ; }mmiotrace_printk ("ioremap returned %p.\n" , p);
@@ -94,24 +95,22 @@ static int __init init(void)unsigned long size = (read_far) ? (8 <<20 ) : (16 <<10 );if (mmio_address ==0 ) { -pr_err (MODULE_NAME ": you have to use the module argument " -"mmio_address.\n" ); -pr_err (MODULE_NAME ": DO NOT LOAD THIS MODULE UNLESS" -" YOU REALLY KNOW WHAT YOU ARE DOING!\n" ); +pr_err ("you have to use the module argument mmio_address.\n" ); +pr_err ("DO NOT LOAD THIS MODULE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!\n" );return -ENXIO ; } -pr_warning (MODULE_NAME ": WARNING: mapping %lu kB @ 0x%08lx in PCI " -"address space, and writing 16 kB of rubbish in there.\n" , - size >>10 , mmio_address); +pr_warning ("WARNING: mapping %lu kB @ 0x%08lx in PCI address space, " +"and writing 16 kB of rubbish in there.\n" , + size >>10 , mmio_address);do_test (size); -pr_info (MODULE_NAME ": All done.\n" ); +pr_info ("All done.\n" );return 0 ; } static void __exit cleanup(void) { -pr_debug (MODULE_NAME ": unloaded.\n" ); +pr_debug ("unloaded.\n" ); }module_init (init);
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 19/21 drivers/net/bonding/: : use pr_fmt
In reply to Joe PerchesAdd #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Remove DRV_NAME from pr_<level>s
Consolidate long format strings
Remove some extra tab indents
Remove some unnecessary ()s from pr_<level>s arguments Align pr_<level> arguments
--- drivers/net/bonding/bond_3ad.c | 171 ++++++----- drivers/net/bonding/bond_alb.c | 38 +-- drivers/net/bonding/bond_ipv6.c | 12 +- drivers/net/bonding/bond_main.c | 608 ++++++++++++++------------------------ drivers/net/bonding/bond_sysfs.c | 322 ++++++++------------ 5 files changed, 464 insertions(+), 687 deletions(-)
drivers/net/bonding/bond_3ad.c +94 -77
@@ -20,6 +20,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/skbuff.h> #include <linux/if_ether.h> #include <linux/netdevice.h>
@@ -352,7 +354,8 @@ static u16 __get_link_speed(struct port *port) } } -pr_debug ("Port %d Received link speed %d update from adapter\n" , port->actor_port_number, speed); +pr_debug ("Port %d Received link speed %d update from adapter\n" , + port->actor_port_number, speed);return speed; }
@@ -378,12 +381,14 @@ static u8 __get_duplex(struct port *port)switch (slave->duplex) {case DUPLEX_FULL : retval=0x1 ; -pr_debug ("Port %d Received status full duplex update from adapter\n" , port->actor_port_number); +pr_debug ("Port %d Received status full duplex update from adapter\n" , + port->actor_port_number);break ;case DUPLEX_HALF :default : retval=0x0 ; -pr_debug ("Port %d Received status NOT full duplex update from adapter\n" , port->actor_port_number); +pr_debug ("Port %d Received status NOT full duplex update from adapter\n" , + port->actor_port_number);break ; } }
@@ -978,7 +983,9 @@ static void ad_mux_machine(struct port *port)// check if the state machine was changed if (port->sm_mux_state != last_state) { -pr_debug ("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n" , port->actor_port_number, last_state, port->sm_mux_state); +pr_debug ("Mux Machine: Port=%d, Last State=%d, Curr State=%d\n" , + port->actor_port_number, last_state, + port->sm_mux_state);switch (port->sm_mux_state) {case AD_MUX_DETACHED :__detach_bond_from_agg (port);
@@ -1077,7 +1084,9 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)// check if the State machine was changed or new lacpdu arrived if ((port->sm_rx_state != last_state) || (lacpdu)) { -pr_debug ("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n" , port->actor_port_number, last_state, port->sm_rx_state); +pr_debug ("Rx Machine: Port=%d, Last State=%d, Curr State=%d\n" , + port->actor_port_number, last_state, + port->sm_rx_state);switch (port->sm_rx_state) {case AD_RX_INITIALIZE :if (!(port->actor_oper_port_key &AD_DUPLEX_KEY_BITS )) {
@@ -1124,9 +1133,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)// detect loopback situation if (!MAC_ADDRESS_COMPARE (&(lacpdu->actor_system), &(port->actor_system))) {// INFO_RECEIVED_LOOPBACK_FRAMES -pr_err (DRV_NAME ": %s: An illegal loopback occurred on " -"adapter (%s). Check the configuration to verify that all " -"Adapters are connected to 802.3ad compliant switch ports\n" , +pr_err ("%s: An illegal loopback occurred on adapter (%s).\n" +"Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n" , port->slave->dev->master->name, port->slave->dev->name);__release_rx_machine_lock (port);return ;
@@ -1165,7 +1173,8 @@ static void ad_tx_machine(struct port *port)__update_lacpdu_from_port (port);if (ad_lacpdu_send (port) >=0 ) { -pr_debug ("Sent LACPDU on port %d\n" , port->actor_port_number); +pr_debug ("Sent LACPDU on port %d\n" , + port->actor_port_number);/* mark ntt as false, so it will not be sent again until demanded */
@@ -1240,7 +1249,9 @@ static void ad_periodic_machine(struct port *port)// check if the state machine was changed if (port->sm_periodic_state != last_state) { -pr_debug ("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n" , port->actor_port_number, last_state, port->sm_periodic_state); +pr_debug ("Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n" , + port->actor_port_number, last_state, + port->sm_periodic_state);switch (port->sm_periodic_state) {case AD_NO_PERIODIC : port->sm_periodic_timer_counter =0 ;// zero timer
@@ -1297,7 +1308,9 @@ static void ad_port_selection_logic(struct port *port) port->next_port_in_aggregator=NULL ; port->actor_port_aggregator_identifier=0 ; -pr_debug ("Port %d left LAG %d\n" , port->actor_port_number, temp_aggregator->aggregator_identifier); +pr_debug ("Port %d left LAG %d\n" , + port->actor_port_number, + temp_aggregator->aggregator_identifier);// if the aggregator is empty, clear its parameters, and set it ready to be attached if (!temp_aggregator->lag_ports) {ad_clear_agg (temp_aggregator);
@@ -1306,9 +1319,7 @@ static void ad_port_selection_logic(struct port *port) } }if (!curr_port) {// meaning: the port was related to an aggregator but was not on the aggregator port list - pr_warning(DRV_NAME ": %s: Warning: Port %d (on %s) " - "was related to aggregator %d but was not " - "on its port list\n", + pr_warning("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n", port->slave->dev->master->name, port->actor_port_number, port->slave->dev->name,
@@ -1342,7 +1353,9 @@ static void ad_port_selection_logic(struct port *port) port->next_port_in_aggregator=aggregator->lag_ports; port->aggregator->num_of_ports++; aggregator->lag_ports=port; -pr_debug ("Port %d joined LAG %d(existing LAG)\n" , port->actor_port_number, port->aggregator->aggregator_identifier); +pr_debug ("Port %d joined LAG %d(existing LAG)\n" , + port->actor_port_number, + port->aggregator->aggregator_identifier);// mark this port as selected port->sm_vars |=AD_PORT_SELECTED ;
@@ -1379,10 +1392,11 @@ static void ad_port_selection_logic(struct port *port)// mark this port as selected port->sm_vars |=AD_PORT_SELECTED ; -pr_debug ("Port %d joined LAG %d(new LAG)\n" , port->actor_port_number, port->aggregator->aggregator_identifier); +pr_debug ("Port %d joined LAG %d(new LAG)\n" , + port->actor_port_number, + port->aggregator->aggregator_identifier); }else { -pr_err (DRV_NAME ": %s: Port %d (on %s) did not find " -"a suitable aggregator\n" , +pr_err ("%s: Port %d (on %s) did not find a suitable aggregator\n" , port->slave->dev->master->name, port->actor_port_number, port->slave->dev->name); }
@@ -1459,8 +1473,7 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,break ;default : -pr_warning (DRV_NAME -": %s: Impossible agg select mode %d\n" , +pr_warning ("%s: Impossible agg select mode %d\n" , curr->slave->dev->master->name,__get_agg_selection_mode (curr->lag_ports));break ;
@@ -1545,40 +1558,38 @@ static void ad_agg_selection_logic(struct aggregator *agg)// if there is new best aggregator, activate it if (best) {pr_debug ("best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n" , - best->aggregator_identifier, best->num_of_ports, - best->actor_oper_aggregator_key, - best->partner_oper_aggregator_key, - best->is_individual, best->is_active); + best->aggregator_identifier, best->num_of_ports, + best->actor_oper_aggregator_key, + best->partner_oper_aggregator_key, + best->is_individual, best->is_active);pr_debug ("best ports %p slave %p %s\n" , - best->lag_ports, best->slave, - best->slave ? best->slave->dev->name :"NULL" ); + best->lag_ports, best->slave, + best->slave ? best->slave->dev->name :"NULL" );for (agg =__get_first_agg (best->lag_ports); agg; agg =__get_next_agg (agg)) {pr_debug ("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n" , - agg->aggregator_identifier, agg->num_of_ports, - agg->actor_oper_aggregator_key, - agg->partner_oper_aggregator_key, - agg->is_individual, agg->is_active); + agg->aggregator_identifier, agg->num_of_ports, + agg->actor_oper_aggregator_key, + agg->partner_oper_aggregator_key, + agg->is_individual, agg->is_active); }// check if any partner replys if (best->is_individual) { -pr_warning (DRV_NAME ": %s: Warning: No 802.3ad" -" response from the link partner for any" -" adapters in the bond\n" , - best->slave->dev->master->name); +pr_warning ("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n" , + best->slave->dev->master->name); } best->is_active =1 ;pr_debug ("LAG %d chosen as the active LAG\n" , - best->aggregator_identifier); + best->aggregator_identifier);pr_debug ("Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n" , - best->aggregator_identifier, best->num_of_ports, - best->actor_oper_aggregator_key, - best->partner_oper_aggregator_key, - best->is_individual, best->is_active); + best->aggregator_identifier, best->num_of_ports, + best->actor_oper_aggregator_key, + best->partner_oper_aggregator_key, + best->is_individual, best->is_active);// disable the ports that were related to the former active_aggregator if (active) {
@@ -1632,7 +1643,8 @@ static void ad_clear_agg(struct aggregator *aggregator) aggregator->lag_ports =NULL ; aggregator->is_active =0 ; aggregator->num_of_ports =0 ; -pr_debug ("LAG %d was cleared\n" , aggregator->aggregator_identifier); +pr_debug ("LAG %d was cleared\n" , + aggregator->aggregator_identifier); } }
@@ -1727,7 +1739,9 @@ static void ad_initialize_port(struct port *port, int lacp_fast)static void ad_enable_collecting_distributing (struct port *port) {if (port->aggregator->is_active) { -pr_debug ("Enabling port %d(LAG %d)\n" , port->actor_port_number, port->aggregator->aggregator_identifier); +pr_debug ("Enabling port %d(LAG %d)\n" , + port->actor_port_number, + port->aggregator->aggregator_identifier);__enable_port (port); } }
@@ -1740,7 +1754,9 @@ static void ad_enable_collecting_distributing(struct port *port)static void ad_disable_collecting_distributing (struct port *port) {if (port->aggregator &&MAC_ADDRESS_COMPARE (&(port->aggregator->partner_system), &(null_mac_addr))) { -pr_debug ("Disabling port %d(LAG %d)\n" , port->actor_port_number, port->aggregator->aggregator_identifier); +pr_debug ("Disabling port %d(LAG %d)\n" , + port->actor_port_number, + port->aggregator->aggregator_identifier);__disable_port (port); } }
@@ -1778,7 +1794,8 @@ static void ad_marker_info_send(struct port *port)// send the marker information if (ad_marker_send (port, &marker) >=0 ) { -pr_debug ("Sent Marker Information on port %d\n" , port->actor_port_number); +pr_debug ("Sent Marker Information on port %d\n" , + port->actor_port_number); } }#endif
@@ -1802,7 +1819,8 @@ static void ad_marker_info_received(struct bond_marker *marker_info,// send the marker response if (ad_marker_send (port, &marker) >=0 ) { -pr_debug ("Sent Marker Response on port %d\n" , port->actor_port_number); +pr_debug ("Sent Marker Response on port %d\n" , + port->actor_port_number); } }
@@ -1888,8 +1906,7 @@ int bond_3ad_bind_slave(struct slave *slave)struct aggregator *aggregator;if (bond ==NULL ) { -pr_err (DRV_NAME ": %s: The slave %s is not attached to " -"its bond\n" , +pr_err ("%s: The slave %s is not attached to its bond\n" , slave->dev->master->name, slave->dev->name);return -1 ; }
@@ -1965,13 +1982,13 @@ void bond_3ad_unbind_slave(struct slave *slave)// if slave is null, the whole port is not initialized if (!port->slave) { -pr_warning (DRV_NAME ": Warning: %s: Trying to " -"unbind an uninitialized port on %s\n" , +pr_warning ("Warning: %s: Trying to unbind an uninitialized port on %s\n" , slave->dev->master->name, slave->dev->name);return ; } -pr_debug ("Unbinding Link Aggregation Group %d\n" , aggregator->aggregator_identifier); +pr_debug ("Unbinding Link Aggregation Group %d\n" , + aggregator->aggregator_identifier);/* Tell the partner that this port is not suitable for aggregation */ port->actor_oper_port_state &= ~AD_STATE_AGGREGATION ;
@@ -1995,10 +2012,12 @@ void bond_3ad_unbind_slave(struct slave *slave)// if new aggregator found, copy the aggregator's parameters // and connect the related lag_ports to the new aggregator if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { -pr_debug ("Some port(s) related to LAG %d - replaceing with LAG %d\n" , aggregator->aggregator_identifier, new_aggregator->aggregator_identifier); +pr_debug ("Some port(s) related to LAG %d - replaceing with LAG %d\n" , + aggregator->aggregator_identifier, + new_aggregator->aggregator_identifier);if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) { -pr_info (DRV_NAME ": %s: Removing an active aggregator\n" , +pr_info ("%s: Removing an active aggregator\n" , aggregator->slave->dev->master->name);// select new active aggregator select_new_active_agg =1 ;
@@ -2029,8 +2048,7 @@ void bond_3ad_unbind_slave(struct slave *slave)ad_agg_selection_logic (__get_first_agg (port)); } }else { -pr_warning (DRV_NAME ": %s: Warning: unbinding aggregator, " -"and could not find a new aggregator for its ports\n" , +pr_warning ("%s: Warning: unbinding aggregator, and could not find a new aggregator for its ports\n" , slave->dev->master->name); } }else {// in case that the only port related to this aggregator is the one we want to remove
@@ -2038,7 +2056,7 @@ void bond_3ad_unbind_slave(struct slave *slave)// clear the aggregator ad_clear_agg (aggregator);if (select_new_active_agg) { -pr_info (DRV_NAME ": %s: Removing an active aggregator\n" , +pr_info ("%s: Removing an active aggregator\n" , slave->dev->master->name);// select new active aggregator ad_agg_selection_logic (__get_first_agg (port));
@@ -2065,7 +2083,7 @@ void bond_3ad_unbind_slave(struct slave *slave)// clear the aggregator ad_clear_agg (temp_aggregator);if (select_new_active_agg) { -pr_info (DRV_NAME ": %s: Removing an active aggregator\n" , +pr_info ("%s: Removing an active aggregator\n" , slave->dev->master->name);// select new active aggregator ad_agg_selection_logic (__get_first_agg (port));
@@ -2114,8 +2132,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work)// select the active aggregator for the bond if ((port =__get_first_port (bond))) {if (!port->slave) { -pr_warning (DRV_NAME ": %s: Warning: bond's first port is " -"uninitialized\n" , bond->dev->name); +pr_warning ("%s: Warning: bond's first port is uninitialized\n" , + bond->dev->name); goto re_arm; }
@@ -2128,8 +2146,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work)// for each port run the state machines for (port =__get_first_port (bond); port; port =__get_next_port (port)) {if (!port->slave) { -pr_warning (DRV_NAME ": %s: Warning: Found an uninitialized " -"port\n" , bond->dev->name); +pr_warning ("%s: Warning: Found an uninitialized port\n" , + bond->dev->name); goto re_arm; }
@@ -2170,15 +2188,15 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u port = &(SLAVE_AD_INFO (slave).port);if (!port->slave) { -pr_warning (DRV_NAME ": %s: Warning: port of slave %s " -"is uninitialized\n" , +pr_warning ("%s: Warning: port of slave %s is uninitialized\n" , slave->dev->name, slave->dev->master->name);return ; }switch (lacpdu->subtype) {case AD_TYPE_LACPDU : -pr_debug ("Received LACPDU on port %d\n" , port->actor_port_number); +pr_debug ("Received LACPDU on port %d\n" , + port->actor_port_number);ad_rx_machine (lacpdu, port);break ;
@@ -2187,17 +2205,20 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, uswitch (((struct bond_marker *)lacpdu)->tlv_type) {case AD_MARKER_INFORMATION_SUBTYPE : -pr_debug ("Received Marker Information on port %d\n" , port->actor_port_number); +pr_debug ("Received Marker Information on port %d\n" , + port->actor_port_number);ad_marker_info_received ((struct bond_marker *)lacpdu, port);break ;case AD_MARKER_RESPONSE_SUBTYPE : -pr_debug ("Received Marker Response on port %d\n" , port->actor_port_number); +pr_debug ("Received Marker Response on port %d\n" , + port->actor_port_number);ad_marker_response_received ((struct bond_marker *)lacpdu, port);break ;default : -pr_debug ("Received an unknown Marker subtype on slot %d\n" , port->actor_port_number); +pr_debug ("Received an unknown Marker subtype on slot %d\n" , + port->actor_port_number); } } }
@@ -2217,8 +2238,7 @@ void bond_3ad_adapter_speed_changed(struct slave *slave)// if slave is null, the whole port is not initialized if (!port->slave) { -pr_warning (DRV_NAME ": Warning: %s: speed " -"changed for uninitialized port on %s\n" , +pr_warning ("Warning: %s: speed changed for uninitialized port on %s\n" , slave->dev->master->name, slave->dev->name);return ; }
@@ -2245,8 +2265,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave)// if slave is null, the whole port is not initialized if (!port->slave) { -pr_warning (DRV_NAME ": %s: Warning: duplex changed " -"for uninitialized port on %s\n" , +pr_warning ("%s: Warning: duplex changed for uninitialized port on %s\n" , slave->dev->master->name, slave->dev->name);return ; }
@@ -2274,8 +2293,7 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)// if slave is null, the whole port is not initialized if (!port->slave) { -pr_warning (DRV_NAME ": Warning: %s: link status changed for " -"uninitialized port on %s\n" , +pr_warning ("Warning: %s: link status changed for uninitialized port on %s\n" , slave->dev->master->name, slave->dev->name);return ; }
@@ -2380,8 +2398,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) }if (bond_3ad_get_active_agg_info (bond, &ad_info)) { -pr_debug (DRV_NAME ": %s: Error: " -"bond_3ad_get_active_agg_info failed\n" , dev->name); +pr_debug ("%s: Error: bond_3ad_get_active_agg_info failed\n" , + dev->name); goto out; }
@@ -2390,8 +2408,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)if (slaves_in_agg ==0 ) {/*the aggregator is empty*/ -pr_debug (DRV_NAME ": %s: Error: active aggregator is empty\n" , - dev->name); +pr_debug ("%s: Error: active aggregator is empty\n" , dev->name); goto out; }
@@ -2409,8 +2426,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) }if (slave_agg_no >=0 ) { -pr_err (DRV_NAME ": %s: Error: Couldn't find a slave to tx on " -"for aggregator ID %d\n" , dev->name, agg_id); +pr_err ("%s: Error: Couldn't find a slave to tx on for aggregator ID %d\n" , + dev->name, agg_id); goto out; }
drivers/net/bonding/bond_alb.c +12 -26
@@ -20,6 +20,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/skbuff.h> #include <linux/netdevice.h> #include <linux/etherdevice.h>
@@ -201,8 +203,7 @@ static int tlb_initialize(struct bonding *bond) new_hashtbl =kzalloc (size,GFP_KERNEL );if (!new_hashtbl) { -pr_err (DRV_NAME -": %s: Error: Failed to allocate TLB hash table\n" , +pr_err ("%s: Error: Failed to allocate TLB hash table\n" , bond->dev->name);return -1 ; }
@@ -517,8 +518,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) client_info->slave->dev->dev_addr, client_info->mac_dst);if (!skb) { -pr_err (DRV_NAME -": %s: Error: failed to create an ARP packet\n" , +pr_err ("%s: Error: failed to create an ARP packet\n" , client_info->slave->dev->master->name);continue ; }
@@ -528,8 +528,7 @@ static void rlb_update_client(struct rlb_client_info *client_info)if (client_info->tag) { skb =vlan_put_tag (skb, client_info->vlan_id);if (!skb) { -pr_err (DRV_NAME -": %s: Error: failed to insert VLAN tag\n" , +pr_err ("%s: Error: failed to insert VLAN tag\n" , client_info->slave->dev->master->name);continue ; }
@@ -612,9 +611,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) client_info = &(bond_info->rx_hashtbl[hash_index]);if (!client_info->slave) { -pr_err (DRV_NAME -": %s: Error: found a client with no channel in " -"the client's hash table\n" , +pr_err ("%s: Error: found a client with no channel in the client's hash table\n" , bond->dev->name);continue ; }
@@ -809,8 +806,7 @@ static int rlb_initialize(struct bonding *bond) new_hashtbl =kmalloc (size,GFP_KERNEL );if (!new_hashtbl) { -pr_err (DRV_NAME -": %s: Error: Failed to allocate RLB hash table\n" , +pr_err ("%s: Error: Failed to allocate RLB hash table\n" , bond->dev->name);return -1 ; }
@@ -931,8 +927,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) skb =vlan_put_tag (skb, vlan->vlan_id);if (!skb) { -pr_err (DRV_NAME -": %s: Error: failed to insert VLAN tag\n" , +pr_err ("%s: Error: failed to insert VLAN tag\n" , bond->dev->name);continue ; }
@@ -961,11 +956,8 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw)memcpy (s_addr.sa_data, addr, dev->addr_len); s_addr.sa_family = dev->type;if (dev_set_mac_address (dev, &s_addr)) { -pr_err (DRV_NAME -": %s: Error: dev_set_mac_address of dev %s failed! ALB " -"mode requires that the base driver support setting " -"the hw address also when the network device's " -"interface is open\n" , +pr_err ("%s: Error: dev_set_mac_address of dev %s failed!\n" +"ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n" , dev->master->name, dev->name);return -EOPNOTSUPP ; }
@@ -1172,18 +1164,12 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slavalb_set_slave_mac_addr (slave, free_mac_slave->perm_hwaddr, bond->alb_info.rlb_enabled); -pr_warning (DRV_NAME -": %s: Warning: the hw address of slave %s is " -"in use by the bond; giving it the hw address " -"of %s\n" , +pr_warning ("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n" , bond->dev->name, slave->dev->name, free_mac_slave->dev->name); }else if (has_bond_addr) { -pr_err (DRV_NAME -": %s: Error: the hw address of slave %s is in use by the " -"bond; couldn't find a slave with a free hw address to " -"give it (this should not have happened)\n" , +pr_err ("%s: Error: the hw address of slave %s is in use by the bond; couldn't find a slave with a free hw address to give it (this should not have happened)\n" , bond->dev->name, slave->dev->name);return -EFAULT ; }
drivers/net/bonding/bond_ipv6.c +7 -5
@@ -20,6 +20,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/types.h> #include <linux/if_vlan.h> #include <net/ipv6.h>
@@ -73,20 +75,20 @@ static void bond_na_send(struct net_device *slave_dev,addrconf_addr_solict_mult (daddr, &mcaddr);pr_debug ("ipv6 na on slave %s: dest %pI6, src %pI6\n" , - slave_dev->name, &mcaddr, daddr); + slave_dev->name, &mcaddr, daddr); skb =ndisc_build_skb (slave_dev, &mcaddr, daddr, &icmp6h, daddr,ND_OPT_TARGET_LL_ADDR );if (!skb) { -pr_err (DRV_NAME ": NA packet allocation failed\n" ); +pr_err ("NA packet allocation failed\n" );return ; }if (vlan_id) { skb =vlan_put_tag (skb, vlan_id);if (!skb) { -pr_err (DRV_NAME ": failed to insert VLAN tag\n" ); +pr_err ("failed to insert VLAN tag\n" );return ; } }
@@ -108,8 +110,8 @@ void bond_send_unsolicited_na(struct bonding *bond)struct inet6_dev *idev;int is_router; -pr_debug ("bond_send_unsol_na: bond %s slave %s\n" , bond->dev->name, - slave ? slave->dev->name :"NULL" ); +pr_debug ("%s: bond %s slave %s\n" , bond->dev->name, + __func__, slave ? slave->dev->name :"NULL" );if (!slave || !bond->send_unsol_na ||test_bit (__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state))
drivers/net/bonding/bond_main.c +226 -382
1,209 lines not on this page · raw message
drivers/net/bonding/bond_sysfs.c +125 -197
734 lines not on this page · raw message
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 17/21 crypto/async_tx/raid6test.c: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Converted pr( to pr_info(
Removed #define pr pr_info("raid6test: "
--- crypto/async_tx/raid6test.c | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-)
crypto/async_tx/raid6test.c +15 -15
@@ -19,12 +19,12 @@* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/async_tx.h> #include <linux/random.h> -#undef pr -#define pr(fmt, args...) pr_info("raid6test: " fmt, ##args) -#define NDISKS 16/* Including P and Q */ static struct page *dataptrs[NDISKS ];
@@ -121,12 +121,12 @@ static void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, struasync_tx_issue_pending (tx);if (wait_for_completion_timeout (&cmp,msecs_to_jiffies (3000 )) ==0 ) -pr ("%s: timeout! (faila: %d failb: %d disks: %d)\n" , - __func__, faila, failb, disks); +pr_info ("%s: timeout! (faila: %d failb: %d disks: %d)\n" , + __func__, faila, failb, disks);if (result !=0 ) -pr ("%s: validation failure! faila: %d failb: %d sum_check_flags: %x\n" , - __func__, faila, failb, result); +pr_info ("%s: validation failure! faila: %d failb: %d sum_check_flags: %x\n" , + __func__, faila, failb, result); }static int test_disks (int i,int j,int disks)
@@ -144,9 +144,9 @@ static int test_disks(int i, int j, int disks) erra =memcmp (page_address (data[i]),page_address (recovi),PAGE_SIZE ); errb =memcmp (page_address (data[j]),page_address (recovj),PAGE_SIZE ); -pr ("%s(%d, %d): faila=%3d(%c) failb=%3d(%c) %s\n" , - __func__, i, j, i,disk_type (i, disks), j,disk_type (j, disks), - (!erra && !errb) ?"OK" : !erra ?"ERRB" : !errb ?"ERRA" :"ERRAB" ); +pr_info ("%s(%d, %d): faila=%3d(%c) failb=%3d(%c) %s\n" , + __func__, i, j, i,disk_type (i, disks), j,disk_type (j, disks), + (!erra && !errb) ?"OK" : !erra ?"ERRB" : !errb ?"ERRA" :"ERRAB" ); dataptrs[i] = data[i]; dataptrs[j] = data[j];
@@ -179,11 +179,11 @@ static int test(int disks, int *tests)async_tx_issue_pending (tx);if (wait_for_completion_timeout (&cmp,msecs_to_jiffies (3000 )) ==0 ) { -pr ("error: initial gen_syndrome(%d) timed out\n" , disks); +pr_info ("error: initial gen_syndrome(%d) timed out\n" , disks);return 1 ; } -pr ("testing the %d-disk case...\n" , disks); +pr_info ("testing the %d-disk case...\n" , disks);for (i =0 ; i < disks-1 ; i++)for (j = i+1 ; j < disks; j++) { (*tests)++;
@@ -216,9 +216,9 @@ static int raid6_test(void) err +=test (5 , &tests); err +=test (NDISKS , &tests); -pr ("\n" ); -pr ("complete (%d tests, %d failure%s)\n" , - tests, err, err ==1 ?"" :"s" ); +pr_info ("\n" ); +pr_info ("complete (%d tests, %d failure%s)\n" , + tests, err, err ==1 ?"" :"s" );for (i =0 ; i <NDISKS +3 ; i++)put_page (data[i]);
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 21/21 drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg(
In reply to Joe PerchesRemoved "TLAN: " prefix from debug printks, it's added by pr_fmt
--- drivers/net/tlan.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/tlan.h +1 -1
@@ -44,7 +44,7 @@#define TLAN_RECORD 1 #define TLAN_DBG(lvl, format, args...) \ - do { if (debug&lvl) printk(KERN_DEBUG "TLAN: " format, ##args ); } while(0) + do { if (debug & lvl) pr_dbg(format, ##args); } while (0)#define TLAN_DEBUG_GNRL 0x0001#define TLAN_DEBUG_TX 0x0002
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 18/21 arch/x86/mm/mmio-mod.c: use pr_fmt
In reply to Joe PerchesAdd #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove #define NAME
Remove NAME from pr_<level>
--- arch/x86/mm/mmio-mod.c | 71 +++++++++++++++++++++++------------------------ 1 files changed, 35 insertions(+), 36 deletions(-)
arch/x86/mm/mmio-mod.c +35 -36
@@ -19,6 +19,9 @@* * Derived from the read-mod example from relay-examples by Tom Zanussi. */ + +#define pr_fmt (fmt) "mmiotrace: " +#define DEBUG 1#include <linux/module.h>
@@ -36,8 +39,6 @@#include "pf_in.h" -#define NAME "mmiotrace: " -struct trap_reason {unsigned long addr;unsigned long ip;
@@ -96,17 +97,18 @@ static void print_pte(unsigned long address)pte_t *pte =lookup_address (address, &level);if (!pte) { -pr_err (NAME "Error in %s: no pte for page 0x%08lx\n" , - __func__, address); +pr_err ("Error in %s: no pte for page 0x%08lx\n" , + __func__, address);return ; }if (level ==PG_LEVEL_2M ) { -pr_emerg (NAME "4MB pages are not currently supported: " -"0x%08lx\n" , address); +pr_emerg ("4MB pages are not currently supported: 0x%08lx\n" , + address);BUG (); } -pr_info (NAME "pte for 0x%lx: 0x%llx 0x%llx\n" , address, +pr_info ("pte for 0x%lx: 0x%llx 0x%llx\n" , + address, (unsigned long long )pte_val (*pte), (unsigned long long )pte_val (*pte) & _PAGE_PRESENT); }
@@ -118,22 +120,21 @@ static void print_pte(unsigned long address)static void die_kmmio_nesting_error (struct pt_regs *regs,unsigned long addr) {const struct trap_reason *my_reason = &get_cpu_var (pf_reason); -pr_emerg (NAME "unexpected fault for address: 0x%08lx, " -"last fault for address: 0x%08lx\n" , - addr, my_reason->addr); +pr_emerg ("unexpected fault for address: 0x%08lx, last fault for address: 0x%08lx\n" , + addr, my_reason->addr);print_pte (addr);print_symbol (KERN_EMERG "faulting IP is at %s\n" , regs->ip);print_symbol (KERN_EMERG "last faulting IP was at %s\n" , my_reason->ip);#ifdef __i386__pr_emerg ("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n" , - regs->ax, regs->bx, regs->cx, regs->dx); + regs->ax, regs->bx, regs->cx, regs->dx);pr_emerg ("esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n" , - regs->si, regs->di, regs->bp, regs->sp); + regs->si, regs->di, regs->bp, regs->sp);#else pr_emerg ("rax: %016lx rcx: %016lx rdx: %016lx\n" , - regs->ax, regs->cx, regs->dx); + regs->ax, regs->cx, regs->dx);pr_emerg ("rsi: %016lx rdi: %016lx rbp: %016lx rsp: %016lx\n" , - regs->si, regs->di, regs->bp, regs->sp); + regs->si, regs->di, regs->bp, regs->sp);#endif put_cpu_var (pf_reason);BUG ();
@@ -213,7 +214,7 @@ static void post(struct kmmio_probe *p, unsigned long condition,/* this should always return the active_trace count to 0 */ my_reason->active_traces--;if (my_reason->active_traces) { -pr_emerg (NAME "unexpected post handler" ); +pr_emerg ("unexpected post handler" );BUG (); }
@@ -244,7 +245,7 @@ static void ioremap_trace_core(resource_size_t offset, unsigned long size, };if (!trace) { -pr_err (NAME "kmalloc failed in ioremap\n" ); +pr_err ("kmalloc failed in ioremap\n" );return ; }
@@ -282,8 +283,8 @@ void mmiotrace_ioremap(resource_size_t offset, unsigned long size,if (!is_enabled ())/* recheck and proper locking in *_core() */ return ; -pr_debug (NAME "ioremap_*(0x%llx, 0x%lx) = %p\n" , - (unsigned long long )offset, size, addr); +pr_debug ("ioremap_*(0x%llx, 0x%lx) = %p\n" , + (unsigned long long )offset, size, addr);if ((filter_offset) && (offset != filter_offset))return ;ioremap_trace_core (offset, size, addr);
@@ -301,7 +302,7 @@ static void iounmap_trace_core(volatile void __iomem *addr)struct remap_trace *tmp;struct remap_trace *found_trace =NULL ; -pr_debug (NAME "Unmapping %p.\n" , addr); +pr_debug ("Unmapping %p.\n" , addr);spin_lock_irq (&trace_lock);if (!is_enabled ())
@@ -363,9 +364,8 @@ static void clear_trace_list(void)* Caller also ensures is_enabled() cannot change. */ list_for_each_entry (trace, &trace_list, list) { -pr_notice (NAME "purging non-iounmapped " -"trace @0x%08lx, size 0x%lx.\n" , - trace->probe.addr, trace->probe.len); +pr_notice ("purging non-iounmapped trace @0x%08lx, size 0x%lx.\n" , + trace->probe.addr, trace->probe.len);if (!nommiotrace)unregister_kmmio_probe (&trace->probe); }
@@ -387,7 +387,7 @@ static void enter_uniprocessor(void)if (downed_cpus ==NULL && !alloc_cpumask_var (&downed_cpus,GFP_KERNEL )) { -pr_notice (NAME "Failed to allocate mask\n" ); +pr_notice ("Failed to allocate mask\n" ); goto out; }
@@ -395,20 +395,19 @@ static void enter_uniprocessor(void)cpumask_copy (downed_cpus, cpu_online_mask);cpumask_clear_cpu (cpumask_first (cpu_online_mask), downed_cpus);if (num_online_cpus () >1 ) -pr_notice (NAME "Disabling non-boot CPUs...\n" ); +pr_notice ("Disabling non-boot CPUs...\n" );put_online_cpus ();for_each_cpu (cpu, downed_cpus) { err =cpu_down (cpu);if (!err) -pr_info (NAME "CPU%d is down.\n" , cpu); +pr_info ("CPU%d is down.\n" , cpu);else -pr_err (NAME "Error taking CPU%d down: %d\n" , cpu, err); +pr_err ("Error taking CPU%d down: %d\n" , cpu, err); } out:if (num_online_cpus () >1 ) -pr_warning (NAME "multiple CPUs still online, " -"may miss events.\n" ); +pr_warning ("multiple CPUs still online, may miss events.\n" ); }/* __ref because leave_uniprocessor calls cpu_up which is __cpuinit,
@@ -420,13 +419,13 @@ static void __ref leave_uniprocessor(void)if (downed_cpus ==NULL ||cpumask_weight (downed_cpus) ==0 )return ; -pr_notice (NAME "Re-enabling CPUs...\n" ); +pr_notice ("Re-enabling CPUs...\n" );for_each_cpu (cpu, downed_cpus) { err =cpu_up (cpu);if (!err) -pr_info (NAME "enabled CPU%d.\n" , cpu); +pr_info ("enabled CPU%d.\n" , cpu);else -pr_err (NAME "cannot re-enable CPU%d: %d\n" , cpu, err); +pr_err ("cannot re-enable CPU%d: %d\n" , cpu, err); } }
@@ -434,8 +433,8 @@ static void __ref leave_uniprocessor(void)static void enter_uniprocessor (void ) {if (num_online_cpus () >1 ) -pr_warning (NAME "multiple CPUs are online, may miss events. " -"Suggest booting with maxcpus=1 kernel argument.\n" ); +pr_warning ("multiple CPUs are online, may miss events. " +"Suggest booting with maxcpus=1 kernel argument.\n" ); }static void leave_uniprocessor (void )
@@ -450,13 +449,13 @@ void enable_mmiotrace(void) goto out;if (nommiotrace) -pr_info (NAME "MMIO tracing disabled.\n" ); +pr_info ("MMIO tracing disabled.\n" );kmmio_init ();enter_uniprocessor ();spin_lock_irq (&trace_lock);atomic_inc (&mmiotrace_enabled);spin_unlock_irq (&trace_lock); -pr_info (NAME "enabled.\n" ); +pr_info ("enabled.\n" ); out:mutex_unlock (&mmiotrace_mutex); }
@@ -475,7 +474,7 @@ void disable_mmiotrace(void)clear_trace_list ();/* guarantees: no more kmmio callbacks */ leave_uniprocessor ();kmmio_cleanup (); -pr_info (NAME "disabled.\n" ); +pr_info ("disabled.\n" ); out:mutex_unlock (&mmiotrace_mutex); }
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 6/21 es7000_32.c: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Converted a few printk(KERN_INFO to pr_info(
Stripped "es7000_mipcfg" from pr_debug
--- arch/x86/kernel/apic/es7000_32.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)
arch/x86/kernel/apic/es7000_32.c +7 -5
@@ -27,6 +27,9 @@* * http://www.unisys.com */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/notifier.h> #include <linux/spinlock.h> #include <linux/cpumask.h>
@@ -223,9 +226,9 @@ static int parse_unisys_oem(char *oemptr) mip_addr = val; mip = (struct mip_reg *)val; mip_reg =__va (mip); -pr_debug ("es7000_mipcfg: host_reg = 0x%lx \n" , +pr_debug ("host_reg = 0x%lx\n" , (unsigned long )host_reg); -pr_debug ("es7000_mipcfg: mip_reg = 0x%lx \n" , +pr_debug ("mip_reg = 0x%lx\n" , (unsigned long )mip_reg); success++;break ;
@@ -401,7 +404,7 @@ static void es7000_enable_apic_mode(void)if (!es7000_plat)return ; -printk (KERN_INFO "ES7000: Enabling APIC mode.\n" ); +pr_info ("Enabling APIC mode.\n" );memset (&es7000_mip_reg,0 ,sizeof (struct mip_reg )); es7000_mip_reg.off_0x00 =MIP_SW_APIC ; es7000_mip_reg.off_0x38 =MIP_VALID ;
@@ -514,8 +517,7 @@ static void es7000_setup_apic_routing(void) {int apic =per_cpu (x86_bios_cpu_apicid,smp_processor_id ()); -printk (KERN_INFO -"Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n" , +pr_info ("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n" , (apic_version[apic] ==0x14 ) ?"Physical Cluster" :"Logical Cluster" , nr_ioapics,cpumask_bits (es7000_target_cpus ())[0 ]);
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 10/21 arch/x86/kernel/cpu/: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Converted printk(KERN_<level> to pr_<level>( Removed "CPU: " prefixes
Some file now use KBUILD_MODNAME instead of "CPU: "
--- arch/x86/kernel/cpu/addon_cpuid_features.c | 9 +++-- arch/x86/kernel/cpu/amd.c | 26 +++++++------- arch/x86/kernel/cpu/bugs.c | 23 +++++++----- arch/x86/kernel/cpu/bugs_64.c | 4 ++- arch/x86/kernel/cpu/centaur.c | 12 ++++--- arch/x86/kernel/cpu/common.c | 54 +++++++++++++-------------- arch/x86/kernel/cpu/cpu_debug.c | 4 ++- arch/x86/kernel/cpu/cyrix.c | 12 ++++--- arch/x86/kernel/cpu/intel.c | 14 ++++--- arch/x86/kernel/cpu/intel_cacheinfo.c | 14 ++++--- arch/x86/kernel/cpu/perf_event.c | 10 ++++-- arch/x86/kernel/cpu/perfctr-watchdog.c | 11 +++--- arch/x86/kernel/cpu/transmeta.c | 20 ++++++----- arch/x86/kernel/cpu/vmware.c | 11 +++--- 14 files changed, 123 insertions(+), 101 deletions(-)
arch/x86/kernel/cpu/addon_cpuid_features.c +5 -4
@@ -2,6 +2,9 @@* Routines to indentify additional cpu features that are scattered in * cpuid space. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/cpu.h> #include <asm/pat.h>
@@ -128,11 +131,9 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) c->x86_max_cores = (core_level_siblings / smp_num_siblings); -printk (KERN_INFO "CPU: Physical Processor ID: %d\n" , - c->phys_proc_id); +pr_info ("Physical Processor ID: %d\n" , c->phys_proc_id);if (c->x86_max_cores >1 ) -printk (KERN_INFO "CPU: Processor Core ID: %d\n" , - c->cpu_core_id); +pr_info ("Processor Core ID: %d\n" , c->cpu_core_id);return ;#endif }
arch/x86/kernel/cpu/amd.c +13 -13
@@ -1,3 +1,5 @@ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/bitops.h> #include <linux/mm.h>
@@ -71,7 +73,7 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c)void (*f_vide)(void );unsigned long d, d2; -printk (KERN_INFO "AMD K6 stepping B detected - " ); +pr_info ("AMD K6 stepping B detected - " );/* * It looks like AMD fixed the 2.6.2 bug and improved indirect
@@ -87,11 +89,10 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c) d = d2-d;if (d >20 *K6_BUG_LOOP ) -printk (KERN_CONT -"system stability may be impaired when more than 32 MB are used.\n" ); +pr_cont ("system stability may be impaired when more than 32 MB are used.\n" );else -printk (KERN_CONT "probably OK (after B9730xxxx).\n" ); -printk (KERN_INFO "Please see http://membres.lycos.fr/poulot/k6bug.html\n" ); +pr_cont ("probably OK (after B9730xxxx).\n" ); +pr_info ("Please see http://membres.lycos.fr/poulot/k6bug.html\n" ); }/* K6 with old style WHCR */
@@ -109,7 +110,7 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c)wbinvd ();wrmsr (MSR_K6_WHCR , l, h);local_irq_restore (flags); -printk (KERN_INFO "Enabling old style K6 write allocation for %d Mb\n" , +pr_info ("Enabling old style K6 write allocation for %d Mb\n" , mbytes); }return ;
@@ -130,7 +131,7 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c)wbinvd ();wrmsr (MSR_K6_WHCR , l, h);local_irq_restore (flags); -printk (KERN_INFO "Enabling new style K6 write allocation for %d Mb\n" , +pr_info ("Enabling new style K6 write allocation for %d Mb\n" , mbytes); }
@@ -204,7 +205,7 @@ static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c)*/ if (c->x86_model >=6 && c->x86_model <=10 ) {if (!cpu_has (c,X86_FEATURE_XMM )) { -printk (KERN_INFO "Enabling disabled K7/SSE Support.\n" ); +pr_info ("Enabling disabled K7/SSE Support.\n" );rdmsr (MSR_K7_HWCR , l, h); l &= ~0x00008000 ;wrmsr (MSR_K7_HWCR , l, h);
@@ -220,9 +221,8 @@ static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c)if ((c->x86_model ==8 && c->x86_mask >=1 ) || (c->x86_model >8 )) {rdmsr (MSR_K7_CLK_CTL , l, h);if ((l &0xfff00000 ) !=0x20000000 ) { -printk (KERN_INFO -"CPU: CLK_CTL MSR was %x. Reprogramming to %x\n" , - l, ((l &0x000fffff )|0x20000000 )); +pr_info ("CLK_CTL MSR was %x. Reprogramming to %x\n" , + l, ((l &0x000fffff )|0x20000000 ));wrmsr (MSR_K7_CLK_CTL , (l &0x000fffff )|0x20000000 , h); } }
@@ -376,7 +376,7 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) }numa_set_node (cpu, node); -printk (KERN_INFO "CPU %d/0x%x -> Node %d\n" , cpu, apicid, node); +pr_info ("CPU %d/0x%x -> Node %d\n" , cpu, apicid, node);#endif }
@@ -580,7 +580,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)* benefit in doing so. */ if (!rdmsrl_safe (MSR_K8_TSEG_ADDR , &tseg)) { -printk (KERN_DEBUG "tseg: %010llx\n" , tseg); +pr_dbg ("tseg: %010llx\n" , tseg); if ((tseg>>PMD_SHIFT) < (max_low_pfn_mapped>>(PMD_SHIFT-PAGE_SHIFT)) || ((tseg>>PMD_SHIFT) <
arch/x86/kernel/cpu/bugs.c +13 -10
@@ -7,6 +7,9 @@* - Channing Corn (tests & fixes), * - Andrew D. Balsa (code cleanup). */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/utsname.h> #include <asm/bugs.h>
@@ -54,8 +57,8 @@ static void __init check_fpu(void)if (!boot_cpu_data.hard_math) {#ifndef CONFIG_MATH_EMULATION -printk (KERN_EMERG "No coprocessor found and no math emulation present.\n" ); -printk (KERN_EMERG "Giving up.\n" ); +pr_emerg ("No coprocessor found and no math emulation present.\n" ); +pr_emerg ("Giving up.\n" );for (;;) ;#endif return ;
@@ -81,7 +84,7 @@ static void __init check_fpu(void) boot_cpu_data.fdiv_bug = fdiv_bug;if (boot_cpu_data.fdiv_bug) -printk (KERN_WARNING "Hmm, FPU with FDIV bug.\n" ); +pr_warning ("Hmm, FPU with FDIV bug.\n" ); }static void __init check_hlt (void )
@@ -89,16 +92,16 @@ static void __init check_hlt(void)if (paravirt_enabled ())return ; -printk (KERN_INFO "Checking 'hlt' instruction... " ); +pr_info ("Checking 'hlt' instruction... " );if (!boot_cpu_data.hlt_works_ok) { -printk ("disabled\n" ); +pr_cont ("disabled\n" );return ; }halt ();halt ();halt ();halt (); -printk (KERN_CONT "OK.\n" ); +pr_cont ("OK.\n" ); }/*
@@ -111,7 +114,7 @@ static void __init check_popad(void)#ifndef CONFIG_X86_POPAD_OK int res, inp = (int ) &res; -printk (KERN_INFO "Checking for popad bug... " ); +pr_info ("Checking for popad bug... " ); __asm__ __volatile__("movl $12345678,%%eax; movl $0,%%edi; pusha; popa; movl (%%edx,%%edi),%%ecx " : "=&a" (res)
@@ -122,9 +125,9 @@ static void __init check_popad(void)* CPU hard. Too bad. */ if (res !=12345678 ) -printk (KERN_CONT "Buggy.\n" ); +pr_cont ("Buggy.\n" );else -printk (KERN_CONT "OK.\n" ); +pr_cont ("OK.\n" );#endif }
@@ -156,7 +159,7 @@ void __init check_bugs(void) {identify_boot_cpu ();#ifndef CONFIG_SMP -printk (KERN_INFO "CPU: " ); +pr_info ("" );print_cpu_info (&boot_cpu_data);#endif check_config ();
arch/x86/kernel/cpu/bugs_64.c +3 -1
@@ -3,6 +3,8 @@* Copyright (C) 2000 SuSE */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/init.h> #include <asm/alternative.h>
@@ -15,7 +17,7 @@ void __init check_bugs(void) {identify_boot_cpu ();#if !defined(CONFIG_SMP ) -printk (KERN_INFO "CPU: " ); +pr_info ("" );print_cpu_info (&boot_cpu_data);#endif alternative_instructions ();
arch/x86/kernel/cpu/centaur.c +7 -5
@@ -1,3 +1,5 @@ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/bitops.h> #include <linux/kernel.h> #include <linux/init.h>
@@ -260,7 +262,7 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)rdmsr (MSR_VIA_FCR , lo, hi); lo |=ACE_FCR ;/* enable ACE unit */ wrmsr (MSR_VIA_FCR , lo, hi); -printk (KERN_INFO "CPU: Enabled ACE h/w crypto\n" ); +pr_info ("Enabled ACE h/w crypto\n" ); }/* enable RNG unit, if present and disabled */
@@ -268,7 +270,7 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)rdmsr (MSR_VIA_RNG , lo, hi); lo |=RNG_ENABLE ;/* enable RNG unit */ wrmsr (MSR_VIA_RNG , lo, hi); -printk (KERN_INFO "CPU: Enabled h/w RNG\n" ); +pr_info ("Enabled h/w RNG\n" ); }/* store Centaur Extended Feature Flags as
@@ -361,7 +363,7 @@ static void __cpuinit init_centaur(struct cpuinfo_x86 *c) name ="C6" ; fcr_set =ECX8 |DSMC |EDCTLB |EMMX |ERETSTK ; fcr_clr =DPDC ; -printk (KERN_NOTICE "Disabling bugged TSC.\n" ); +pr_notice ("Disabling bugged TSC.\n" );clear_cpu_cap (c,X86_FEATURE_TSC );#ifdef CONFIG_X86_OOSTORE centaur_create_optimal_mcr ();
@@ -436,11 +438,11 @@ static void __cpuinit init_centaur(struct cpuinfo_x86 *c) newlo = (lo|fcr_set) & (~fcr_clr);if (newlo != lo) { -printk (KERN_INFO "Centaur FCR was 0x%X now 0x%X\n" , +pr_info ("Centaur FCR was 0x%X now 0x%X\n" , lo, newlo);wrmsr (MSR_IDT_FCR1 , newlo, hi); }else { -printk (KERN_INFO "Centaur FCR is 0x%X\n" , lo); +pr_info ("Centaur FCR is 0x%X\n" , lo); }/* Emulate MTRRs using Centaur's MCR. */ set_cpu_cap (c,X86_FEATURE_CENTAUR_MCR );
arch/x86/kernel/cpu/common.c +26 -28
151 lines not on this page · raw message
arch/x86/kernel/cpu/cpu_debug.c +3 -1
@@ -6,6 +6,8 @@* For licencing details see kernel-base/COPYING */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/interrupt.h> #include <linux/compiler.h> #include <linux/seq_file.h>
@@ -208,7 +210,7 @@ static void print_cpu_data(struct seq_file *seq, unsigned type,seq_printf (seq," %08x: %08x_%08x\n" , type, high, low); }else -printk (KERN_INFO " %08x: %08x_%08x\n" , type, high, low); +pr_info (" %08x: %08x_%08x\n" , type, high, low); }/* This function can also be called with seq = NULL for printk */
arch/x86/kernel/cpu/cyrix.c +7 -5
@@ -1,3 +1,5 @@ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/bitops.h> #include <linux/delay.h>
@@ -104,7 +106,7 @@ static void __cpuinit check_cx686_slop(struct cpuinfo_x86 *c)local_irq_restore (flags);if (ccr5 &2 ) {/* possible wrong calibration done */ -printk (KERN_INFO "Recalibrating delay loop with SLOP bit reset\n" ); +pr_info ("Recalibrating delay loop with SLOP bit reset\n" );calibrate_delay (); c->loops_per_jiffy = loops_per_jiffy; }
@@ -116,7 +118,7 @@ static void __cpuinit set_cx86_reorder(void) {u8 ccr3; -printk (KERN_INFO "Enable Memory access reorder on Cyrix/NSC processor.\n" ); +pr_info ("Enable Memory access reorder on Cyrix/NSC processor.\n" ); ccr3 =getCx86 (CX86_CCR3 );setCx86 (CX86_CCR3 , (ccr3 &0x0f ) |0x10 );/* enable MAPEN */
@@ -129,7 +131,7 @@ static void __cpuinit set_cx86_reorder(void)static void __cpuinit set_cx86_memwb (void ) { -printk (KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n" ); +pr_info ("Enable Memory-Write-back mode on Cyrix/NSC processor.\n" );/* CCR2 bit 2: unlock NW bit */ setCx86_old (CX86_CCR2 ,getCx86_old (CX86_CCR2 ) & ~0x04 );
@@ -269,7 +271,7 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)* VSA1 we work around however. */ -printk (KERN_INFO "Working around Cyrix MediaGX virtual DMA bugs.\n" ); +pr_info ("Working around Cyrix MediaGX virtual DMA bugs.\n" ); isa_dma_bridge_buggy =2 ;/* We do this before the PCI layer is running. However we
@@ -426,7 +428,7 @@ static void __cpuinit cyrix_identify(struct cpuinfo_x86 *c)if (dir0 ==5 || dir0 ==3 ) {unsigned char ccr3;unsigned long flags; -printk (KERN_INFO "Enabling CPUID on Cyrix processor.\n" ); +pr_info ("Enabling CPUID on Cyrix processor.\n" );local_irq_save (flags); ccr3 =getCx86 (CX86_CCR3 );/* enable MAPEN */
arch/x86/kernel/cpu/intel.c +8 -6
@@ -1,3 +1,5 @@ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/kernel.h>
@@ -102,7 +104,7 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)rdmsrl (MSR_IA32_MISC_ENABLE , misc_enable);if (misc_enable &MSR_IA32_MISC_ENABLE_FAST_STRING ) { -printk (KERN_INFO "kmemcheck: Disabling fast string operations\n" ); +pr_info ("kmemcheck: Disabling fast string operations\n" ); misc_enable &= ~MSR_IA32_MISC_ENABLE_FAST_STRING ;wrmsrl (MSR_IA32_MISC_ENABLE , misc_enable);
@@ -125,7 +127,7 @@ int __cpuinit ppro_with_ram_bug(void) boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 1 && boot_cpu_data.x86_mask < 8) { -printk (KERN_INFO "Pentium Pro with Errata#50 detected. Taking evasive action.\n" ); +pr_info ("Pentium Pro with Errata#50 detected. Taking evasive action.\n" );return 1 ; }return 0 ;
@@ -185,7 +187,7 @@ static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) c->f00f_bug =1 ;if (!f00f_workaround_enabled) {trap_init_f00f_bug (); -printk (KERN_NOTICE "Intel Pentium with F0 0F bug - workaround enabled.\n" ); +pr_notice ("Intel Pentium with F0 0F bug - workaround enabled.\n" ); f00f_workaround_enabled =1 ; } }
@@ -205,8 +207,8 @@ static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c)if ((c->x86 ==15 ) && (c->x86_model ==1 ) && (c->x86_mask ==1 )) {rdmsr (MSR_IA32_MISC_ENABLE , lo, hi);if ((lo &MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE ) ==0 ) { -printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n" ); -printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n" ); +pr_info ("C0 stepping P4 Xeon detected.\n" ); +pr_info ("Disabling hardware prefetching (Errata 037)\n" ); lo |=MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE ;wrmsr (MSR_IA32_MISC_ENABLE , lo, hi); }
@@ -267,7 +269,7 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) node =first_node (node_online_map);numa_set_node (cpu, node); -printk (KERN_INFO "CPU %d/0x%x -> Node %d\n" , cpu, apicid, node); +pr_info ("CPU %d/0x%x -> Node %d\n" , cpu, apicid, node);#endif }
arch/x86/kernel/cpu/intel_cacheinfo.c +8 -6
@@ -7,6 +7,8 @@* Andi Kleen / Andreas Herrmann : CPUID4 emulation on AMD. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/slab.h> #include <linux/device.h>
@@ -489,20 +491,20 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c) }if (trace) -printk (KERN_INFO "CPU: Trace cache: %dK uops" , trace); +pr_info ("Trace cache: %dK uops" , trace);else if (l1i) -printk (KERN_INFO "CPU: L1 I cache: %dK" , l1i); +pr_info ("L1 I cache: %dK" , l1i);if (l1d) -printk (KERN_CONT ", L1 D cache: %dK\n" , l1d); +pr_cont (", L1 D cache: %dK\n" , l1d);else -printk (KERN_CONT "\n" ); +pr_cont ("\n" );if (l2) -printk (KERN_INFO "CPU: L2 cache: %dK\n" , l2); +pr_info ("L2 cache: %dK\n" , l2);if (l3) -printk (KERN_INFO "CPU: L3 cache: %dK\n" , l3); +pr_info ("L3 cache: %dK\n" , l3); c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d));
arch/x86/kernel/cpu/perf_event.c +7 -3
@@ -11,6 +11,8 @@* For licencing details see kernel-base/COPYING */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/perf_event.h> #include <linux/capability.h> #include <linux/notifier.h>
@@ -1612,7 +1614,7 @@ static void intel_pmu_reset(void)local_irq_save (flags); -printk ("clearing PMU state on CPU#%d\n" ,smp_processor_id ()); +pr_info ("clearing PMU state on CPU#%d\n" ,smp_processor_id ());for (idx =0 ; idx < x86_pmu.num_events; idx++) {checking_wrmsrl (x86_pmu.eventsel + idx,0ull );
@@ -2064,7 +2066,8 @@ void __init init_hw_perf_events(void)pr_cont ("%s PMU driver.\n" , x86_pmu.name);if (x86_pmu.num_events >X86_PMC_MAX_GENERIC ) { -WARN (1 ,KERN_ERR "hw perf events %d > max(%d), clipping!" , +WARN (1 , + KERN_ERR pr_fmt("hw perf events %d > max(%d), clipping!"), x86_pmu.num_events,X86_PMC_MAX_GENERIC ); x86_pmu.num_events =X86_PMC_MAX_GENERIC ; }
@@ -2072,7 +2075,8 @@ void __init init_hw_perf_events(void) perf_max_events = x86_pmu.num_events;if (x86_pmu.num_events_fixed >X86_PMC_MAX_FIXED ) { -WARN (1 ,KERN_ERR "hw perf events fixed %d > max(%d), clipping!" , +WARN (1 , + KERN_ERR pr_fmt("hw perf events fixed %d > max(%d), clipping!"), x86_pmu.num_events_fixed,X86_PMC_MAX_FIXED ); x86_pmu.num_events_fixed =X86_PMC_MAX_FIXED ; }
arch/x86/kernel/cpu/perfctr-watchdog.c +6 -5
@@ -11,6 +11,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/percpu.h> #include <linux/module.h> #include <linux/kernel.h>
@@ -211,7 +213,7 @@ void enable_lapic_nmi_watchdog(void)if (!wd_ops)return ;if (!wd_ops->reserve ()) { -printk (KERN_ERR "NMI watchdog: cannot reserve perfctrs\n" ); +pr_err ("cannot reserve perfctrs\n" );return ; }
@@ -757,19 +759,18 @@ int lapic_watchdog_init(unsigned nmi_hz)if (!wd_ops) {probe_nmi_watchdog ();if (!wd_ops) { -printk (KERN_INFO "NMI watchdog: CPU not supported\n" ); +pr_info ("CPU not supported\n" );return -1 ; }if (!wd_ops->reserve ()) { -printk (KERN_ERR -"NMI watchdog: cannot reserve perfctrs\n" ); +pr_err ("cannot reserve perfctrs\n" );return -1 ; } }if (!(wd_ops->setup (nmi_hz))) { -printk (KERN_ERR "Cannot setup NMI watchdog on CPU %d\n" , +pr_err ("Cannot setup NMI watchdog on CPU %d\n" ,raw_smp_processor_id ());return -1 ; }
arch/x86/kernel/cpu/transmeta.c +11 -9
@@ -1,3 +1,5 @@ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/mm.h> #include <linux/init.h>
@@ -34,7 +36,7 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)if (max >=0x80860001 ) {cpuid (0x80860001 , &dummy, &cpu_rev, &cpu_freq, &cpu_flags);if (cpu_rev !=0x02000000 ) { - printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n", + pr_info("Processor revision %u.%u.%u.%u, %u MHz\n", (cpu_rev >> 24) & 0xff, (cpu_rev >> 16) & 0xff, (cpu_rev >> 8) & 0xff,
@@ -45,15 +47,15 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)if (max >=0x80860002 ) {cpuid (0x80860002 , &new_cpu_rev, &cms_rev1, &cms_rev2, &dummy);if (cpu_rev ==0x02000000 ) { -printk (KERN_INFO "CPU: Processor revision %08X, %u MHz\n" , +pr_info ("Processor revision %08X, %u MHz\n" , new_cpu_rev, cpu_freq); } -printk (KERN_INFO "CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n" , - (cms_rev1 >>24 ) &0xff , - (cms_rev1 >>16 ) &0xff , - (cms_rev1 >>8 ) &0xff , - cms_rev1 &0xff , - cms_rev2); +pr_info ("Code Morphing Software revision %u.%u.%u-%u-%u\n" , + (cms_rev1 >>24 ) &0xff , + (cms_rev1 >>16 ) &0xff , + (cms_rev1 >>8 ) &0xff , + cms_rev1 &0xff , + cms_rev2); }if (max >=0x80860006 ) { cpuid(0x80860003,
@@ -77,7 +79,7 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c) (void *)&cpu_info[56 ], (void *)&cpu_info[60]); cpu_info[64 ] ='\0' ; -printk (KERN_INFO "CPU: %s\n" , cpu_info); +pr_info ("%s\n" , cpu_info); }/* Unhide possibly hidden capability flags */
arch/x86/kernel/cpu/vmware.c +6 -5
@@ -21,6 +21,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/dmi.h> #include <asm/div64.h> #include <asm/vmware.h>
@@ -58,9 +60,9 @@ static unsigned long vmware_get_tsc_khz(void) tsc_hz = eax | (((uint64_t )ebx) <<32 );do_div (tsc_hz,1000 );BUG_ON (tsc_hz >>32 ); -printk (KERN_INFO "TSC freq read from hypervisor : %lu.%03lu MHz\n" , - (unsigned long ) tsc_hz /1000 , - (unsigned long ) tsc_hz %1000 ); +pr_info ("TSC freq read from hypervisor : %lu.%03lu MHz\n" , + (unsigned long ) tsc_hz /1000 , + (unsigned long ) tsc_hz %1000 );return tsc_hz; }
@@ -73,8 +75,7 @@ void __init vmware_platform_setup(void)if (ebx !=UINT_MAX ) x86_platform.calibrate_tsc = vmware_get_tsc_khz;else -printk (KERN_WARNING -"Failed to get TSC freq from the hypervisor\n" ); +pr_warning ("Failed to get TSC freq from the hypervisor\n" ); }/*
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 12/21 kmmio.c: Add and use pr_fmt(fmt)
In reply to Joe PerchesAdd #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Strip "kmmio: " from pr_<level>s
--- arch/x86/mm/kmmio.c | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-)
arch/x86/mm/kmmio.c +20 -20
@@ -5,6 +5,8 @@* 2008 Pekka Paalanen <[email protected]> */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/list.h> #include <linux/rculist.h> #include <linux/spinlock.h>
@@ -136,7 +138,7 @@ static int clear_page_presence(struct kmmio_fault_page *f, bool clear)pte_t *pte =lookup_address (f->page, &level);if (!pte) { -pr_err ("kmmio: no pte for page 0x%08lx\n" , f->page); +pr_err ("no pte for page 0x%08lx\n" , f->page);return -1 ; }
@@ -148,7 +150,7 @@ static int clear_page_presence(struct kmmio_fault_page *f, bool clear)clear_pte_presence (pte, clear, &f->old_presence);break ;default : -pr_err ("kmmio: unexpected page level 0x%x.\n" , level); +pr_err ("unexpected page level 0x%x.\n" , level);return -1 ; }
@@ -170,13 +172,14 @@ static int clear_page_presence(struct kmmio_fault_page *f, bool clear)static int arm_kmmio_fault_page (struct kmmio_fault_page *f) {int ret; -WARN_ONCE (f->armed,KERN_ERR "kmmio page already armed.\n" ); + WARN_ONCE(f->armed, KERN_ERR pr_fmt("kmmio page already armed.\n"));if (f->armed) { -pr_warning ("kmmio double-arm: page 0x%08lx, ref %d, old %d\n" , - f->page, f->count, !!f->old_presence); +pr_warning ("double-arm: page 0x%08lx, ref %d, old %d\n" , + f->page, f->count, !!f->old_presence); } ret =clear_page_presence (f, true); -WARN_ONCE (ret <0 ,KERN_ERR "kmmio arming 0x%08lx failed.\n" , f->page); + WARN_ONCE(ret < 0, KERN_ERR pr_fmt("arming 0x%08lx failed.\n"), + f->page); f->armed = true;return ret; }
@@ -240,24 +243,21 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr)* condition needs handling by do_page_fault(), the * page really not being present is the most common. */ -pr_debug ("kmmio: secondary hit for 0x%08lx CPU %d.\n" , - addr,smp_processor_id ()); +pr_debug ("secondary hit for 0x%08lx CPU %d.\n" , + addr,smp_processor_id ());if (!faultpage->old_presence) -pr_info ("kmmio: unexpected secondary hit for " -"address 0x%08lx on CPU %d.\n" , addr, -smp_processor_id ()); +pr_info ("unexpected secondary hit for address 0x%08lx on CPU %d.\n" , + addr,smp_processor_id ()); }else {/* * Prevent overwriting already in-flight context. * This should not happen, let's hope disarming at * least prevents a panic. */ -pr_emerg ("kmmio: recursive probe hit on CPU %d, " -"for address 0x%08lx. Ignoring.\n" , -smp_processor_id (), addr); -pr_emerg ("kmmio: previous hit was at 0x%08lx.\n" , - ctx->addr); +pr_emerg ("recursive probe hit on CPU %d, for address 0x%08lx. Ignoring.\n" , +smp_processor_id (), addr); +pr_emerg ("previous hit was at 0x%08lx.\n" , ctx->addr);disarm_kmmio_fault_page (faultpage); } goto no_kmmio_ctx;
@@ -316,8 +316,8 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs)* something external causing them (f.e. using a debugger while * mmio tracing enabled), or erroneous behaviour */ -pr_warning ("kmmio: unexpected debug trap on CPU %d.\n" , -smp_processor_id ()); +pr_warning ("unexpected debug trap on CPU %d.\n" , +smp_processor_id ()); goto out; }
@@ -425,7 +425,7 @@ int register_kmmio_probe(struct kmmio_probe *p)list_add_rcu (&p->list, &kmmio_probes);while (size < size_lim) {if (add_kmmio_fault_page (p->addr + size)) -pr_err ("kmmio: Unable to set page fault.\n" ); +pr_err ("Unable to set page fault.\n" ); size +=PAGE_SIZE ; } out:
@@ -511,7 +511,7 @@ void unregister_kmmio_probe(struct kmmio_probe *p) drelease =kmalloc (sizeof (*drelease),GFP_ATOMIC );if (!drelease) { -pr_crit ("kmmio: leaking kmmio_fault_page objects.\n" ); +pr_crit ("leaking kmmio_fault_page objects.\n" );return ; } drelease->release_list = release_list;
Signature · 1 line
1.6.3.1.10.g659a0.dirty
PATCH 7/21 arch/x86/kernel/apic/: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesAdded #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Converted printk(KERN_<level> to pr_<level>( Stripped an "ACPI: " typo prefix
Stripped "APIC: " from a few printks
--- arch/x86/kernel/apic/apic.c | 48 ++++---- arch/x86/kernel/apic/apic_flat_64.c | 5 +- arch/x86/kernel/apic/bigsmp_32.c | 8 +- arch/x86/kernel/apic/io_apic.c | 239 +++++++++++++++++------------------ arch/x86/kernel/apic/nmi.c | 29 ++--- arch/x86/kernel/apic/numaq_32.c | 53 ++++----- arch/x86/kernel/apic/probe_32.c | 18 ++-- arch/x86/kernel/apic/probe_64.c | 8 +- arch/x86/kernel/apic/summit_32.c | 23 ++-- arch/x86/kernel/apic/x2apic_uv_x.c | 26 ++-- 10 files changed, 225 insertions(+), 232 deletions(-)
arch/x86/kernel/apic/apic.c +24 -24
@@ -14,6 +14,8 @@* Mikael Pettersson : PM converted to driver model. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/perf_event.h> #include <linux/kernel_stat.h> #include <linux/mc146818rtc.h>
@@ -145,8 +147,7 @@ static int x2apic_preenabled;static __init int setup_nox2apic (char *str) {if (x2apic_enabled ()) { -pr_warning ("Bios already enabled x2apic, " -"can't enforce nox2apic" ); +pr_warning ("Bios already enabled x2apic, can't enforce nox2apic" );return 0 ; }
@@ -587,14 +588,15 @@ calibrate_by_pmtimer(long deltapm, long *delta, long *deltatsc) res = (((u64 )deltapm) * mult) >>22 ;do_div (res,1000000 ); -pr_warning ("APIC calibration not consistent " -"with PM-Timer: %ldms instead of 100ms\n" ,(long )res); +pr_warning ("APIC calibration not consistent with PM-Timer: " +"%ldms instead of 100ms\n" , + (long )res);/* Correct the lapic counter value */ res = (((u64)(*delta)) * pm_100ms);do_div (res, deltapm); -pr_info ("APIC delta adjusted to PM-Timer: " -"%lu (%ld)\n" , (unsigned long )res, *delta); +pr_info ("APIC delta adjusted to PM-Timer: %lu (%ld)\n" , + (unsigned long )res, *delta); *delta = (long )res;/* Correct the tsc counter value */
@@ -773,8 +775,8 @@ void __init setup_boot_APIC_clock(void)if (nmi_watchdog !=NMI_IO_APIC ) lapic_clockevent.features &= ~CLOCK_EVT_FEAT_DUMMY ;else -pr_warning ("APIC timer registered as dummy," -" due to nmi_watchdog=%d!\n" , nmi_watchdog); +pr_warning ("APIC timer registered as dummy, due to nmi_watchdog=%d!\n" , + nmi_watchdog);/* Setup the lapic or request the broadcast */ setup_APIC_timer ();
@@ -1371,8 +1373,7 @@ int __init enable_IR(void) }if (!x2apic_preenabled && skip_ioapic_setup) { -pr_info ("Skipped enabling intr-remap because of skipping " -"io-apic setup\n" ); +pr_info ("Skipped enabling intr-remap because of skipping io-apic setup\n" );return 0 ; }
@@ -1398,7 +1399,7 @@ void __init enable_IR_x2apic(void) dmar_table_init_ret =dmar_table_init ();if (dmar_table_init_ret)pr_debug ("dmar_table_init() failed with %d:\n" , - dmar_table_init_ret); + dmar_table_init_ret);#endif ioapic_entries =alloc_ioapic_entries ();
@@ -1512,8 +1513,7 @@ static int __init detect_init_APIC(void)* "lapic" specified. */ if (!force_enable_local_apic) { -pr_info ("Local APIC disabled by BIOS -- " -"you can enable it with \"lapic\"\n" ); +pr_info ("Local APIC disabled by BIOS -- you can enable it with \"lapic\"\n" );return -1 ; }/*
@@ -1596,7 +1596,7 @@ void __init init_apic_mappings(void)/* If no local APIC can be found return early */ if (!smp_found_config &&detect_init_APIC ()) {/* lets NOP'ify apic operations */ -pr_info ("APIC: disable apic facility\n" ); +pr_info ("disable apic facility\n" );apic_disable (); }else { apic_phys = mp_lapic_addr;
@@ -1659,7 +1659,7 @@ int __init APIC_init_uniprocessor(void)if (!cpu_has_apic &&APIC_INTEGRATED (apic_version[boot_cpu_physical_apicid])) {pr_err ("BIOS bug, local APIC 0x%x not detected!...\n" , - boot_cpu_physical_apicid); + boot_cpu_physical_apicid);return -1 ; }#endif
@@ -1742,8 +1742,8 @@ void smp_spurious_interrupt(struct pt_regs *regs)inc_irq_stat (irq_spurious_count);/* see sw-dev-man vol 3, chapter 7.4.13.5 */ -pr_info ("spurious APIC interrupt on CPU#%d, " -"should never happen.\n" ,smp_processor_id ()); +pr_info ("spurious APIC interrupt on CPU#%d, should never happen.\n" , +smp_processor_id ());irq_exit (); }
@@ -1775,7 +1775,7 @@ void smp_error_interrupt(struct pt_regs *regs)* 7: Illegal register address */ pr_debug ("APIC error on CPU%d: %02x(%02x)\n" , -smp_processor_id (), v , v1); +smp_processor_id (), v , v1);irq_exit (); }
@@ -1878,7 +1878,7 @@ void __cpuinit generic_processor_info(int apicid, int version)if (version ==0x0 ) {pr_warning ("BIOS bug, APIC version is 0 for CPU#%d! " "fixing up to 0x10. (tell your hw vendor)\n" , - version); + version); version =0x10 ; } apic_version[apicid] = version;
@@ -1887,9 +1887,9 @@ void __cpuinit generic_processor_info(int apicid, int version)int max = nr_cpu_ids;int thiscpu = max + disabled_cpus; -pr_warning ( -"ACPI: NR_CPUS/possible_cpus limit of %i reached." -" Processor %d/0x%x ignored.\n" , max, thiscpu, apicid); +pr_warning ("NR_CPUS/possible_cpus limit of %i reached." +" Processor %d/0x%x ignored.\n" , + max, thiscpu, apicid); disabled_cpus++;return ;
@@ -2208,7 +2208,7 @@ static int __cpuinit set_multi(const struct dmi_system_id *d) {if (multi)return 0 ; -pr_info ("APIC: %s detected, Multi Chassis\n" , d->ident); +pr_info ("%s detected, Multi Chassis\n" , d->ident); multi =1 ;return 0 ; }
@@ -2317,7 +2317,7 @@ static int __init apic_set_verbosity(char *arg) apic_verbosity =APIC_VERBOSE ; else {pr_warning ("APIC Verbosity level %s not recognised" -" use apic=verbose or apic=debug\n" , arg); +" - use apic=verbose or apic=debug\n" , arg);return -EINVAL ; }
arch/x86/kernel/apic/apic_flat_64.c +4 -1
@@ -8,6 +8,9 @@* Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and * James Cleverdon. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/errno.h> #include <linux/threads.h> #include <linux/cpumask.h>
@@ -237,7 +240,7 @@ static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)*/ if (acpi_gbl_FADT.header.revision >=FADT2_REVISION_ID && (acpi_gbl_FADT.flags &ACPI_FADT_APIC_PHYSICAL )) { -printk (KERN_DEBUG "system APIC only can use physical flat" ); +pr_dbg ("system APIC only can use physical flat" );return 1 ; }#endif
arch/x86/kernel/apic/bigsmp_32.c +5 -3
@@ -3,6 +3,9 @@* * Drives the local APIC in "clustered mode". */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/threads.h> #include <linux/cpumask.h> #include <linux/kernel.h>
@@ -75,8 +78,7 @@ static void bigsmp_init_apic_ldr(void)static void bigsmp_setup_apic_routing (void ) { -printk (KERN_INFO -"Enabling APIC mode: Physflat. Using %d I/O APICs\n" , +pr_info ("Enabling APIC mode: Physflat. Using %d I/O APICs\n" , nr_ioapics); }
@@ -166,7 +168,7 @@ static int dmi_bigsmp; /* can be set by dmi scanners */static int hp_ht_bigsmp (const struct dmi_system_id *d) { -printk (KERN_NOTICE "%s detected: force use of apic=bigsmp\n" , d->ident); +pr_notice ("%s detected: force use of apic=bigsmp\n" , d->ident); dmi_bigsmp =1 ;return 0 ;
arch/x86/kernel/apic/io_apic.c +115 -124
592 lines not on this page · raw message
arch/x86/kernel/apic/nmi.c +13 -16
@@ -11,6 +11,8 @@* Mikael Pettersson : PM converted to driver model. Disable/enable API. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/apic.h> #include <linux/nmi.h>
@@ -106,16 +108,13 @@ static __init void nmi_cpu_busy(void *data)static void report_broken_nmi (int cpu,unsigned int *prev_nmi_count) { -printk (KERN_CONT "\n" ); +pr_cont ("\n" ); -printk (KERN_WARNING -"WARNING: CPU#%d: NMI appears to be stuck (%d->%d)!\n" , - cpu, prev_nmi_count[cpu],get_nmi_count (cpu)); +pr_warning ("WARNING: CPU#%d: NMI appears to be stuck (%d->%d)!\n" , + cpu, prev_nmi_count[cpu],get_nmi_count (cpu)); -printk (KERN_WARNING -"Please report this to bugzilla.kernel.org,\n" ); -printk (KERN_WARNING -"and attach the output of the 'dmesg' command.\n" ); +pr_warning ("Please report this to bugzilla.kernel.org,\n" ); +pr_warning ("and attach the output of the 'dmesg' command.\n" );per_cpu (wd_enabled, cpu) =0 ;atomic_dec (&nmi_active);
@@ -138,7 +137,7 @@ int __init check_nmi_watchdog(void)if (!prev_nmi_count) goto error; -printk (KERN_INFO "Testing NMI watchdog ... " ); +pr_info ("Testing NMI watchdog ... " );#ifdef CONFIG_SMP if (nmi_watchdog ==NMI_LOCAL_APIC )
@@ -162,7 +161,7 @@ int __init check_nmi_watchdog(void)atomic_set (&nmi_active,-1 ); goto error; } -printk ("OK.\n" ); +pr_cont ("OK.\n" );/* * now that we know it works we can reduce NMI frequency to
@@ -418,7 +417,7 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)static DEFINE_SPINLOCK (lock);/* Serialise the printks */ spin_lock (&lock); -printk (KERN_WARNING "NMI backtrace for cpu %d\n" , cpu); +pr_warning ("NMI backtrace for cpu %d\n" , cpu);show_regs (regs);dump_stack ();spin_unlock (&lock);
@@ -520,8 +519,7 @@ int proc_nmi_enabled(struct ctl_table *table, int write,return 0 ;if (atomic_read (&nmi_active) <0 || !nmi_watchdog_active ()) { -printk (KERN_WARNING -"NMI watchdog is permanently disabled\n" ); +pr_warning ("NMI watchdog is permanently disabled\n" );return -EIO ; }
@@ -536,8 +534,7 @@ int proc_nmi_enabled(struct ctl_table *table, int write,else disable_ioapic_nmi_watchdog (); }else { -printk (KERN_WARNING -"NMI watchdog doesn't know what hardware to touch\n" ); +pr_warning ("NMI watchdog doesn't know what hardware to touch\n" );return -EIO ; }return 0 ;
@@ -560,7 +557,7 @@ void arch_trigger_all_cpu_backtrace(void)cpumask_copy (&backtrace_mask, cpu_online_mask); -printk (KERN_INFO "sending NMI to all CPUs:\n" ); +pr_info ("sending NMI to all CPUs:\n" ); apic->send_IPI_all (NMI_VECTOR );/* Wait for up to 10 seconds for all CPUs to do the backtrace */
arch/x86/kernel/apic/numaq_32.c +24 -29
124 lines not on this page · raw message
arch/x86/kernel/apic/probe_32.c +8 -10
@@ -6,6 +6,9 @@* * Generic x86 APIC driver probe layer. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/threads.h> #include <linux/cpumask.h> #include <linux/module.h>
@@ -55,9 +58,7 @@ late_initcall(print_ipi_mode);void default_setup_apic_routing (void ) {#ifdef CONFIG_X86_IO_APIC -printk (KERN_INFO -"Enabling APIC mode: Flat. Using %d I/O APICs\n" , - nr_ioapics); +pr_info ("Enabling APIC mode: Flat. Using %d I/O APICs\n" , nr_ioapics);#endif }
@@ -205,8 +206,7 @@ void __init generic_bigsmp_probe(void)if (!cmdline_apic && apic == &apic_default) {if (apic_bigsmp.probe ()) { apic = &apic_bigsmp; -printk (KERN_INFO "Overriding APIC driver with %s\n" , - apic->name); +pr_info ("Overriding APIC driver with %s\n" , apic->name); } }#endif
@@ -226,7 +226,7 @@ void __init generic_apic_probe(void)if (!apic_probe[i])panic ("Didn't find an APIC driver" ); } -printk (KERN_INFO "Using APIC driver %s\n" , apic->name); +pr_info ("Using APIC driver %s\n" , apic->name); }/* These functions can switch the APIC even after the initial ->probe() */
@@ -244,8 +244,7 @@ generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)if (!cmdline_apic) { apic = apic_probe[i]; -printk (KERN_INFO "Switched to APIC driver `%s'.\n" , - apic->name); +pr_info ("Switched to APIC driver `%s'.\n" , apic->name); }return 1 ; }
@@ -264,8 +263,7 @@ int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)if (!cmdline_apic) { apic = apic_probe[i]; -printk (KERN_INFO "Switched to APIC driver `%s'.\n" , - apic->name); +pr_info ("Switched to APIC driver `%s'.\n" , apic->name); }return 1 ; }
arch/x86/kernel/apic/probe_64.c +5 -3
@@ -8,6 +8,9 @@* Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and * James Cleverdon. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/threads.h> #include <linux/cpumask.h> #include <linux/string.h>
@@ -79,7 +82,7 @@ void __init default_setup_apic_routing(void) } } -printk (KERN_INFO "Setting APIC routing to %s\n" , apic->name); +pr_info ("Setting APIC routing to %s\n" , apic->name);if (is_vsmp_box ()) {/* need to update phys_pkg_id */
@@ -108,8 +111,7 @@ int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)for (i =0 ; apic_probe[i]; ++i) {if (apic_probe[i]->acpi_madt_oem_check (oem_id, oem_table_id)) { apic = apic_probe[i]; -printk (KERN_INFO "Setting APIC routing to %s.\n" , - apic->name); +pr_info ("Setting APIC routing to %s.\n" , apic->name);return 1 ; } }
arch/x86/kernel/apic/summit_32.c +14 -9
@@ -26,6 +26,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/mm.h> #include <linux/init.h> #include <asm/io.h>
@@ -228,8 +230,8 @@ static int summit_apic_id_registered(void)static void summit_setup_apic_routing (void ) { -printk ("Enabling APIC mode: Summit. Using %d I/O APICs\n" , - nr_ioapics); +pr_info ("Enabling APIC mode: Summit. Using %d I/O APICs\n" , + nr_ioapics); }static int summit_apicid_to_node (int logical_apicid)
@@ -289,7 +291,7 @@ static unsigned int summit_cpu_mask_to_apicid(const struct cpumask *cpumask)int new_apicid =summit_cpu_to_logical_apicid (cpu);if (round &&APIC_CLUSTER (apicid) !=APIC_CLUSTER (new_apicid)) { -printk ("%s: Not a valid mask!\n" , __func__); +pr_err ("%s: Not a valid mask!\n" , __func__);return BAD_APICID ; } apicid |= new_apicid;
@@ -369,7 +371,7 @@ static int setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus) } }if (i == rio_table_hdr->num_rio_dev) { -printk (KERN_ERR "%s: Couldn't find owner Cyclone for Winnipeg!\n" , __func__); +pr_err ("%s: Couldn't find owner Cyclone for Winnipeg!\n" , __func__);return last_bus; }
@@ -380,7 +382,7 @@ static int setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus) } }if (i == rio_table_hdr->num_scal_dev) { -printk (KERN_ERR "%s: Couldn't find owner Twister for Cyclone!\n" , __func__); +pr_err ("%s: Couldn't find owner Twister for Cyclone!\n" , __func__);return last_bus; }
@@ -410,7 +412,7 @@ static int setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus) num_buses =9 ;break ;default : -printk (KERN_INFO "%s: Unsupported Winnipeg type!\n" , __func__); +pr_info ("%s: Unsupported Winnipeg type!\n" , __func__);return last_bus; }
@@ -425,13 +427,15 @@ static int build_detail_arrays(void)int i, scal_detail_size, rio_detail_size;if (rio_table_hdr->num_scal_dev >MAX_NUMNODES ) { -printk (KERN_WARNING "%s: MAX_NUMNODES too low! Defined as %d, but system has %d nodes.\n" , __func__,MAX_NUMNODES , rio_table_hdr->num_scal_dev); +pr_warning ("%s: MAX_NUMNODES too low! Defined as %d, but system has %d nodes.\n" , + __func__,MAX_NUMNODES , rio_table_hdr->num_scal_dev);return 0 ; }switch (rio_table_hdr->version) {default : -printk (KERN_WARNING "%s: Invalid Rio Grande Table Version: %d\n" , __func__, rio_table_hdr->version); +pr_warning ("%s: Invalid Rio Grande Table Version: %d\n" , + __func__, rio_table_hdr->version);return 0 ;case 2 : scal_detail_size =11 ;
@@ -476,7 +480,8 @@ void setup_summit(void) offset = *((unsigned short *)(ptr + offset)); }if (!rio_table_hdr) { -printk (KERN_ERR "%s: Unable to locate Rio Grande Table in EBDA - bailing!\n" , __func__); +pr_err ("%s: Unable to locate Rio Grande Table in EBDA - bailing!\n" , + __func__);return ; }
arch/x86/kernel/apic/x2apic_uv_x.c +13 -13
@@ -7,6 +7,9 @@* * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/cpumask.h> #include <linux/hardirq.h> #include <linux/proc_fs.h>
@@ -371,8 +374,8 @@ static __init void map_high(char *id, unsigned long base, int shift, paddr = base << shift; bytes = (1UL << shift) * (max_pnode +1 ); -printk (KERN_INFO "UV: Map %s_HI 0x%lx - 0x%lx\n" , id, paddr, - paddr + bytes); +pr_info ("UV: Map %s_HI 0x%lx - 0x%lx\n" , + id, paddr, paddr + bytes);if (map_type == map_uc)init_extra_mapping_uc (paddr, bytes);else
@@ -417,9 +420,7 @@ static __init void uv_rtc_init(void) status =uv_bios_freq_base (BIOS_FREQ_BASE_REALTIME_CLOCK , &ticks_per_sec);if (status !=BIOS_STATUS_SUCCESS || ticks_per_sec <100000 ) { -printk (KERN_WARNING -"unable to determine platform RTC clock frequency, " -"guessing.\n" ); +pr_warning ("unable to determine platform RTC clock frequency, guessing.\n" );/* BIOS gives wrong value for clock freq. so guess */ sn_rtc_cycles_per_second =1000000000000UL /30000UL ; }else
@@ -560,15 +561,15 @@ void __init uv_system_init(void) node_id.v =uv_read_local_mmr (UVH_NODE_ID ); gnode_extra = (node_id.s.node_id & ~((1 << n_val) -1 )) >>1 ; gnode_upper = ((unsigned long )gnode_extra << m_val); -printk (KERN_DEBUG "UV: N %d, M %d, gnode_upper 0x%lx, gnode_extra 0x%x\n" , - n_val, m_val, gnode_upper, gnode_extra); +pr_dbg ("UV: N %d, M %d, gnode_upper 0x%lx, gnode_extra 0x%x\n" , + n_val, m_val, gnode_upper, gnode_extra); -printk (KERN_DEBUG "UV: global MMR base 0x%lx\n" , mmr_base); +pr_dbg ("UV: global MMR base 0x%lx\n" , mmr_base);for (i =0 ; i <UVH_NODE_PRESENT_TABLE_DEPTH ; i++) uv_possible_blades +=hweight64 (uv_read_local_mmr (UVH_NODE_PRESENT_TABLE + i *8 )); -printk (KERN_DEBUG "UV: Found %d blades\n" ,uv_num_possible_blades ()); +pr_dbg ("UV: Found %d blades\n" ,uv_num_possible_blades ()); bytes =sizeof (struct uv_blade_info ) *uv_num_possible_blades (); uv_blade_info =kmalloc (bytes,GFP_KERNEL );
@@ -634,10 +635,9 @@ void __init uv_system_init(void) uv_cpu_to_blade[cpu] = blade; max_pnode =max (pnode, max_pnode); -printk (KERN_DEBUG "UV: cpu %d, apicid 0x%x, pnode %d, nid %d, " -"lcpu %d, blade %d\n" , - cpu,per_cpu (x86_cpu_to_apicid, cpu), pnode, nid, - lcpu, blade); +pr_dbg ("UV: cpu %d, apicid 0x%x, pnode %d, nid %d, lcpu %d, blade %d\n" , + cpu,per_cpu (x86_cpu_to_apicid, cpu), pnode, nid, + lcpu, blade); }/* Add blade/pnode info for nodes without cpus */
Signature · 1 line
1.6.3.1.10.g659a0.dirty
Re: [PATCH 19/21] drivers/net/bonding/: : use pr_fmt
In reply to Joe PerchesFrom: Joe Perches <[email protected]>
Date: Sun, 4 Oct 2009 17:53:46 -0700
Quoted 8 lines
Add #define
pr_fmt(fmt)KBUILD_MODNAME": " fmt RemoveDRV_NAMEfrom pr_<level>s
Consolidate long format strings
Remove some extra tab indents
Remove some unnecessary ()s from pr_<level>s arguments Align pr_<level> argumentsSigned-off-by Joe Perches <[email protected]>
Applied to net-next-2.6
Re: [PATCH 20/21] drivers/net/tlan: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesFrom: Joe Perches <[email protected]>
Date: Sun, 4 Oct 2009 17:53:47 -0700
Quoted 5 lines
Added #define
pr_fmt(fmt)KBUILD_MODNAME": " fmt
Converted printk(KERN_<level> to pr_<level>(
Removed "TLAN: " prefixesSigned-off-by Joe Perches <[email protected]>
Applied to net-next-2.6
Re: [PATCH 21/21] drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg(
In reply to Joe PerchesFrom: Joe Perches <[email protected]>
Date: Sun, 4 Oct 2009 17:53:48 -0700
Quoted 3 lines
Removed "TLAN: " prefix from debug printks, it's added by
pr_fmtSigned-off-by Joe Perches <[email protected]>
Applied to net-next-2.6
Re: [PATCH 21/21] drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg(
Quoted 5 lines · David Miller
From: Joe Perches <[email protected]>
Date: Sun, 4 Oct 2009 17:53:48 -0700Quoted 2 lines
Removed "TLAN: " prefix from debug printks, it's added by
pr_fmtSigned-off-by Joe Perches <[email protected]>Applied to net-next-2.6
Patches 20 and 21 depend on patch 1, which introduces pr_dbg to kernel.h. Compile failure otherwise.
Re: [PATCH 21/21] drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg(
From: Joe Perches <[email protected]>
Date: Mon, 05 Oct 2009 00:16:14 -0700
Quoted 9 lines · David Miller
Quoted 5 lines
From: Joe Perches <[email protected]>
Date: Sun, 4 Oct 2009 17:53:48 -0700Quoted 2 lines
Removed "TLAN: " prefix from debug printks, it's added by
pr_fmtSigned-off-by Joe Perches <[email protected]>Applied to net-next-2.6
Patches 20 and 21 depend on patch 1, which introduces
pr_dbgtokernel.h. Compile failure otherwise.
Ok, I'll toss them then.
Someone else merge this stuff:
Re: [PATCH 16/21] kernel/kexec.c: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesQuoted 3 lines · Joe Perches
Added #define
pr_fmt(fmt)KBUILD_MODNAME": " fmt
Converted printk(KERN_<level> to pr_<level>(
AddedKERN_ERRto allocation failure message
I'm dense and I haven't seen the discussions. What is the point of adding a prefix string where none exists into a bunch of printks?
Quoted 99 lines
Signed-off-by Joe Perches <[email protected]>--- kernel/kexec.c | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-)kernel/kexec.c +10
-11@@ -6,6 +6,8 @@* Version 2. See the file COPYING for more details. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/capability.h> #include <linux/mm.h> #include <linux/file.h> @@ -245,13 +247,13 @@ static int kimage_normal_alloc(struct kimage **rimage, unsigned long entry, image->control_code_page =kimage_alloc_control_pages (image,get_order (KEXEC_CONTROL_PAGE_SIZE ));if (!image->control_code_page) { -printk (KERN_ERR "Could not allocate control_code_buffer\n" ); +pr_err ("Could not allocate control_code_buffer\n" ); goto out; } image->swap_page =kimage_alloc_control_pages (image,0 );if (!image->swap_page) { -printk (KERN_ERR "Could not allocate swap buffer\n" ); +pr_err ("Could not allocate swap buffer\n" ); goto out; }@@ -320,7 +322,7 @@ static int kimage_crash_alloc(struct kimage **rimage, unsigned long entry, image->control_code_page =kimage_alloc_control_pages (image,get_order (KEXEC_CONTROL_PAGE_SIZE ));if (!image->control_code_page) { -printk (KERN_ERR "Could not allocate control_code_buffer\n" ); +pr_err ("Could not allocate control_code_buffer\n" ); goto out; }@@ -1141,8 +1143,7 @@ static int __init crash_notes_memory_init(void)/* Allocate memory for saving cpu registers. */ crash_notes =alloc_percpu (note_buf_t);if (!crash_notes) { -printk ("Kexec: Memory allocation for saving cpu register" -" states failed\n" ); +pr_err ("Memory allocation for saving cpu register states failed\n" );return -ENOMEM ; }return 0 ;@@ -1192,8 +1193,7 @@ static int __init parse_crashkernel_mem(char *cmdline,if (*cur !=':' ) { end =memparse (cur, &tmp);if (cur == tmp) { -pr_warning ("crashkernel: Memory " -"value expected\n" ); +pr_warning ("crashkernel: Memory value expected\n" );return -EINVAL ; } cur = tmp;@@ -1211,7 +1211,7 @@ static int __init parse_crashkernel_mem(char *cmdline, size =memparse (cur, &tmp);if (cur == tmp) { -pr_warning ("Memory value expected\n" ); +pr_warning ("crashkernel: Memory value expected\n" );return -EINVAL ; } cur = tmp;@@ -1234,8 +1234,7 @@ static int __init parse_crashkernel_mem(char *cmdline, cur++; *crash_base =memparse (cur, &tmp);if (cur == tmp) { -pr_warning ("Memory value expected " -"after '@'\n" ); +pr_warning ("crashkernel: Memory value expected after '@'\n" );return -EINVAL ; } }@@ -1473,7 +1472,7 @@ int kernel_kexec(void)#endif {kernel_restart_prepare (NULL ); -printk (KERN_EMERG "Starting new kernel\n" ); +pr_emerg ("Starting new kernel\n" );machine_shutdown (); }Signature · 7 lines
1.6.3.1.10.g659a0.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Steven Rostedt
maintainerRe: [PATCH 02/21] ftrace.c: Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
In reply to Joe PerchesQuoted 13 lines · Joe Perches
Remove prefixes from pr_<level>, use
pr_fmt(fmt)
No change in output.Signed-off-by Joe Perches <[email protected]>--- arch/x86/kernel/ftrace.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)arch/x86/kernel/ftrace.c +0
-0
arch/x86/kernel/ftrace.c line 12
Quoted 4 lines
arch/x86/kernel/ftrace.c +1
-0@@ -9,6 +9,8 @@* the dangers of modifying code on the run. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt
What does KBUILD_MODNAME give us in the core code? This file does not belong to any module and is only compiled into the core kernel.
-- Steve
Quoted 23 lines
arch/x86/kernel/ftrace.c +4
-3+#include <linux/spinlock.h> #include <linux/hardirq.h> #include <linux/uaccess.h> @@ -336,15 +338,15 @@ int __init ftrace_dyn_arch_init(void *data)switch (faulted) {case 0 : -pr_info ("ftrace: converting mcount calls to 0f 1f 44 00 00\n" ); +pr_info ("converting mcount calls to 0f 1f 44 00 00\n" );memcpy (ftrace_nop, ftrace_test_p6nop,MCOUNT_INSN_SIZE );break ;case 1 : -pr_info ("ftrace: converting mcount calls to 66 66 66 66 90\n" ); +pr_info ("converting mcount calls to 66 66 66 66 90\n" );memcpy (ftrace_nop, ftrace_test_nop5,MCOUNT_INSN_SIZE );break ;case 2 : -pr_info ("ftrace: converting mcount calls to jmp . + 5\n" ); +pr_info ("converting mcount calls to jmp . + 5\n" );memcpy (ftrace_nop, ftrace_test_jmp,MCOUNT_INSN_SIZE );break ; }
Re: [PATCH 02/21] ftrace.c: Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Quoted 5 lines · Steven Rostedt
Quoted 2 lines · Joe Perches
Remove prefixes from pr_<level>, use
pr_fmt(fmt)
No change in output.What does
KBUILD_MODNAMEgive us in the core code? This file does not belong to any module and is only compiled into the core kernel.
Hi Steven.
KBUILD_MODNAME is basename(__FILE__), or if multiple files are grouped in the Makefile, then it's the basename(group)
http://lkml.indiana.edu/hypermail/linux/kernel/0210.2/0325.html
For ftrace.c, it gives "ftrace", which is the same as the prefix you were using, so there's no change in the output.
For other entries in say kernel/power, there were
messages that did not have prefixes
I believe these are some of the +/-'s of each approach:
Current:
o Allows some messages to not have a prefix at all
o Prefixes can vary inside a specific compilation unit
Proposed:
o Consistent, smaller source code, with no typos for instance: acpi/apic typos were found/fixed kernel/power had messages without PM:
mce used "MCE: " and "mce: " prefixes
o Compatible with KMSG_COMPONENT
o All logging messages should have a prefix so
it could be easier to grep/categorize logs
o Future:
- Doesn't require each compilation unit to #define pr_fmt
- Smaller objects without duplicated prefixes
- Extensible via some dynamic_debug like mechanism to hide or show modname/__func__/offset without significant overhead or any increase in object size (printk would emit the prefix via some insertion mechanism after "<level>")
cheers, Joe
Re: [PATCH 02/21] ftrace.c: Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Quoted 9 lines · Joe Perches
Quoted 5 lines · Steven Rostedt
Quoted 2 lines · Joe Perches
Remove prefixes from pr_<level>, use
pr_fmt(fmt)
No change in output.What does
KBUILD_MODNAMEgive us in the core code? This file does not belong to any module and is only compiled into the core kernel.Hi Steven.
Quoted 8 lines
KBUILD_MODNAMEisbasename(__FILE__), or if multiple files are grouped in theMakefile, then it's the basename(group)http://lkml.indiana.edu/hypermail/linux/kernel/0210.2/0325.html
For
ftrace.c, it gives "ftrace", which is the same as the prefix you were using, so there's no change in the output.
If it keeps the same output, and doesn't change when it may be printed, then you can add my:
to that one patch.
-- Steve
Re: [PATCH 16/21] kernel/kexec.c: use pr_<level> and add pr_fmt(fmt)
In reply to Eric W. BiedermanQuoted 7 lines · Eric W. Biederman
Quoted 3 lines · Joe Perches
Added #define
pr_fmt(fmt)KBUILD_MODNAME": " fmt
Converted printk(KERN_<level> to pr_<level>(
AddedKERN_ERRto allocation failure messageI'm dense and I haven't seen the discussions. What is the point of adding a prefix string where none exists into a bunch of printks?
Hi Eric.
There have been a few messages on lkml with little comment, so I thought I'd get a few more by submitting some patches.
There is a [0/21] message that you might have received directly.
http://lkml.org/lkml/2009/10/4/198
I believe these are some of the +/-'s of each approach:
(copy/pasted from an earlier response)
Current:
o Allows some messages to not have a prefix at all
o Prefixes can vary inside a specific compilation unit
Proposed:
o Consistent, smaller source code, with no typos for instance: acpi/apic typos were found/fixed kernel/power had messages without PM:
mce used "MCE: " and "mce: " prefixes
o Compatible with KMSG_COMPONENT
o All logging messages should have a prefix so
it could be easier to grep/categorize logs
o Future:
- Doesn't require each compilation unit to #define pr_fmt
- Smaller objects without duplicated prefixes
- Extensible via some dynamic_debug like mechanism to hide or show modname/__func__/offset without significant overhead or any increase in object size (printk would emit the prefix via some insertion mechanism after "<level>")
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Re: [PATCH 15/21] kernel/power/: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesQuoted 4 lines · Joe Perches
Added #define
pr_fmt(fmt)"PM: " fmt Converted printk(KERN_<level> to pr_<level>( Removed "PM: " prefix
Addedpr_fmt()to__initdatastrings
Well, can you please tell me what actually is wrong with the current code?
Rafael
Quoted 2 lines
Signed-off-by Joe Perches <[email protected]>---
Re: [PATCH 15/21] kernel/power/: use pr_<level> and add pr_fmt(fmt)
Quoted 7 lines · Rafael J. Wysocki
Quoted 4 lines · Joe Perches
Added #define
pr_fmt(fmt)"PM: " fmt Converted printk(KERN_<level> to pr_<level>( Removed "PM: " prefix
Addedpr_fmt()to__initdatastringsWell, can you please tell me what actually is wrong with the current code?
Not much. There were a couple of trivial corrections, but perhaps the changes add a bit more flexibility and regularity.
Effective trivial changes:
o Added KERN_CONT (pr_cont) to a couple of messages
o Added "PM: " (pr_info) to an #ifdef'd message
o Added "PM: " (pr_info) to a printk "Syncing filesystems ..." in power/user.c
cheers, Joe
Re: [PATCH 21/21] drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg(
In reply to Joe PerchesQuoted 9 lines · Joe Perches
Quoted 5 lines · David Miller
From: Joe Perches <[email protected]>
Date: Sun, 4 Oct 2009 17:53:48 -0700Quoted 2 lines
Removed "TLAN: " prefix from debug printks, it's added by
pr_fmtSigned-off-by Joe Perches <[email protected]>Applied to net-next-2.6
Patches 20 and 21 depend on patch 1, which introduces
pr_dbgtokernel.h. Compile failure otherwise.
Why don't you push the first patch first, then, and wait with the others until it gets merged? This way individual subsystem maintainers will be able to merge them cleanly.
Rafael
Re: [PATCH 21/21] drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg(
Quoted 3 lines · Rafael J. Wysocki
Why don't you push the first patch first, then, and wait with the others until it gets merged? This way individual subsystem maintainers will be able to merge them cleanly.
Sometimes patch series get a bit more feedback than individual patches.
Original rfc suggestion: (1 comment)
http://lkml.org/lkml/2009/10/1/399
Patch removing pr_fmt from driver (acked by Jiri):
http://lkml.org/lkml/2009/10/1/418
cheers, Joe
Re: [PATCH 15/21] kernel/power/: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesQuoted 13 lines · Joe Perches
Quoted 7 lines · Rafael J. Wysocki
Quoted 4 lines · Joe Perches
Added #define
pr_fmt(fmt)"PM: " fmt Converted printk(KERN_<level> to pr_<level>( Removed "PM: " prefix
Addedpr_fmt()to__initdatastringsWell, can you please tell me what actually is wrong with the current code?
Not much. There were a couple of trivial corrections, but perhaps the changes add a bit more flexibility and regularity.
Quoted 6 lines
Effective trivial changes:
o Added
KERN_CONT(pr_cont) to a couple of messages
o Added "PM: " (pr_info) to an #ifdef'd message
o Added "PM: " (pr_info) to a printk "Syncing filesystems ..." inpower/user.c
The patch as is conflicts with the changes I have queued up for 2.6.33 (they'll appear in linux-next after I've fixed all build issues, hopefully tomorrow). For one example, we're dropping swsusp.c altogether.
Also, I'm not a big fan of automatic conversions from printk() to pr_something() other than pr_debug().
Thanks,
Rafael
Re: [PATCH 15/21] kernel/power/: use pr_<level> and add pr_fmt(fmt)
Quoted 16 lines · Rafael J. Wysocki
Quoted 15 lines · Joe Perches
Quoted 7 lines · Rafael J. Wysocki
Quoted 4 lines · Joe Perches
Added #define
pr_fmt(fmt)"PM: " fmt Converted printk(KERN_<level> to pr_<level>( Removed "PM: " prefix
Addedpr_fmt()to__initdatastringsWell, can you please tell me what actually is wrong with the current code?
Not much. There were a couple of trivial corrections, but perhaps the changes add a bit more flexibility and regularity.
Effective trivial changes:
Quoted 8 lines
Quoted 4 lines
o Added
KERN_CONT(pr_cont) to a couple of messages
o Added "PM: " (pr_info) to an #ifdef'd message
o Added "PM: " (pr_info) to a printk "Syncing filesystems ..." inpower/user.cThe patch as is conflicts with the changes I have queued up for 2.6.33 (they'll appear in linux-next after I've fixed all build issues, hopefully tomorrow). For one example, we're dropping
swsusp.caltogether.
Hi Rafael.
Here's the same patch redone against -next.
Added #define pr_fmt(fmt) "PM: " fmt
Converted printk(KERN_<level> to pr_<level>( Converted printks without KERN_ to pr_info or pr_cont Removed hard coded "PM: " prefix from message strings Added pr_fmt() to __initdata strings
Integrated multiple line strings
All logging messages are now output prefixed with "PM: "
kernel/power/hibernate.c | 54 ++++++++++++++++++++--------------------- kernel/power/hibernate_nvs.c | 6 +++- kernel/power/process.c | 28 +++++++++++----------- kernel/power/snapshot.c | 33 +++++++++++++------------ kernel/power/suspend.c | 18 +++++++------ kernel/power/suspend_test.c | 17 +++++++------ kernel/power/swap.c | 44 ++++++++++++++++------------------ kernel/power/user.c | 8 ++++-- 8 files changed, 106 insertions(+), 102 deletions(-)
kernel/power/hibernate.c +26 -28
@@ -9,6 +9,8 @@* This file is released under the GPLv2. */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/suspend.h> #include <linux/syscalls.h> #include <linux/reboot.h>
@@ -85,7 +87,7 @@ EXPORT_SYMBOL(system_entering_hibernation);#ifdef CONFIG_PM_DEBUG static void hibernation_debug_sleep (void ) { -printk (KERN_INFO "hibernation debug: Waiting for 5 seconds.\n" ); +pr_info ("hibernation debug: Waiting for 5 seconds.\n" );mdelay (5000 ); }
@@ -221,10 +223,10 @@ void swsusp_show_speed(struct timeval *start, struct timeval *stop, centisecs =1 ;/* avoid div-by-zero */ k = nr_pages * (PAGE_SIZE /1024 ); kps = (k *100 ) / centisecs; -printk (KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n" , - msg, k, - centisecs /100 , centisecs %100 , - kps /1000 , (kps %1000 ) /10 ); +pr_info ("%s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n" , + msg, k, + centisecs /100 , centisecs %100 , + kps /1000 , (kps %1000 ) /10 ); }/**
@@ -249,8 +251,7 @@ static int create_image(int platform_mode)*/ error =dpm_suspend_noirq (PMSG_FREEZE );if (error) { -printk (KERN_ERR "PM: Some devices failed to power down, " -"aborting hibernation\n" ); +pr_err ("Some devices failed to power down, aborting hibernation\n" );return error; }
@@ -267,8 +268,7 @@ static int create_image(int platform_mode) error =sysdev_suspend (PMSG_FREEZE );if (error) { -printk (KERN_ERR "PM: Some system devices failed to power down, " -"aborting hibernation\n" ); +pr_err ("Some system devices failed to power down, aborting hibernation\n" ); goto Enable_irqs; }
@@ -279,8 +279,7 @@ static int create_image(int platform_mode)save_processor_state (); error =swsusp_arch_suspend ();if (error) -printk (KERN_ERR "PM: Error %d creating hibernation image\n" , - error); +pr_err ("Error %d creating hibernation image\n" , error);/* Restore control flow magically appears here */ restore_processor_state ();if (!in_suspend)
@@ -371,8 +370,7 @@ static int resume_target_kernel(bool platform_mode) error =dpm_suspend_noirq (PMSG_QUIESCE );if (error) { -printk (KERN_ERR "PM: Some devices failed to power down, " -"aborting resume\n" ); +pr_err ("Some devices failed to power down, aborting resume\n" );return error; }
@@ -549,7 +547,7 @@ static void power_down(void)* Valid image is on the disk, if we continue we risk serious data * corruption after resume. */ -printk (KERN_CRIT "PM: Please power down manually\n" ); +pr_crit ("Please power down manually\n" );while (1 ); }
@@ -593,9 +591,9 @@ int hibernate(void)if (error) goto Exit; -printk (KERN_INFO "PM: Syncing filesystems ... " ); +pr_info ("Syncing filesystems ... " );sys_sync (); -printk ("done.\n" ); +pr_cont ("done.\n" ); error =prepare_processes ();if (error)
@@ -616,13 +614,13 @@ int hibernate(void)if (hibernation_mode ==HIBERNATION_PLATFORM ) flags |=SF_PLATFORM_MODE ; -pr_debug ("PM: writing image.\n" ); +pr_debug ("writing image.\n" ); error =swsusp_write (flags);swsusp_free ();if (!error)power_down (); }else { -pr_debug ("PM: Image restored successfully.\n" ); +pr_debug ("Image restored successfully.\n" ); } Thaw:
@@ -683,7 +681,7 @@ static int software_resume(void) goto Unlock; } -pr_debug ("PM: Checking image partition %s\n" , resume_file); +pr_debug ("Checking image partition %s\n" , resume_file);/* Check if the device is there */ swsusp_resume_device =name_to_dev_t (resume_file);
@@ -708,10 +706,10 @@ static int software_resume(void) } Check_image: -pr_debug ("PM: Resume from partition %d:%d\n" , -MAJOR (swsusp_resume_device),MINOR (swsusp_resume_device)); +pr_debug ("Resume from partition %d:%d\n" , +MAJOR (swsusp_resume_device),MINOR (swsusp_resume_device)); -pr_debug ("PM: Checking hibernation image.\n" ); +pr_debug ("Checking hibernation image.\n" ); error =swsusp_check ();if (error) goto Unlock;
@@ -736,21 +734,21 @@ static int software_resume(void)if (error) goto close_finish; -pr_debug ("PM: Preparing processes for restore.\n" ); +pr_debug ("Preparing processes for restore.\n" ); error =prepare_processes ();if (error) {swsusp_close (FMODE_READ ); goto Done; } -pr_debug ("PM: Reading hibernation image.\n" ); +pr_debug ("Reading hibernation image.\n" ); error =swsusp_read (&flags);swsusp_close (FMODE_READ );if (!error)hibernation_restore (flags &SF_PLATFORM_MODE ); -printk (KERN_ERR "PM: Restore failed, recovering.\n" ); +pr_err ("Restore failed, recovering.\n" );swsusp_free ();thaw_processes (); Done:
@@ -763,7 +761,7 @@ static int software_resume(void)/* For success case, the suspend path will release the lock */ Unlock:mutex_unlock (&pm_mutex); -pr_debug ("PM: Resume from disk failed.\n" ); +pr_debug ("Resume from disk failed.\n" );return error; close_finish:swsusp_close (FMODE_READ );
@@ -876,7 +874,7 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr, error = -EINVAL ;if (!error) -pr_debug ("PM: Hibernation mode set to '%s'\n" , +pr_debug ("Hibernation mode set to '%s'\n" , hibernation_modes[mode]);mutex_unlock (&pm_mutex);return error ? error : n;
@@ -908,7 +906,7 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,mutex_lock (&pm_mutex); swsusp_resume_device = res;mutex_unlock (&pm_mutex); -printk (KERN_INFO "PM: Starting manual resume from disk\n" ); +pr_info ("Starting manual resume from disk\n" ); noresume =0 ;software_resume (); ret = n;
kernel/power/hibernate_nvs.c +4 -2
@@ -6,6 +6,8 @@* This file is released under the GPLv2. */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/io.h> #include <linux/kernel.h> #include <linux/list.h>
@@ -108,7 +110,7 @@ void hibernate_nvs_save(void) {struct nvs_page *entry; -printk (KERN_INFO "PM: Saving platform NVS memory\n" ); +pr_info ("Saving platform NVS memory\n" );list_for_each_entry (entry, &nvs_list, node)if (entry->data) {
@@ -127,7 +129,7 @@ void hibernate_nvs_restore(void) {struct nvs_page *entry; -printk (KERN_INFO "PM: Restoring platform NVS memory\n" ); +pr_info ("Restoring platform NVS memory\n" );list_for_each_entry (entry, &nvs_list, node)if (entry->data)
kernel/power/process.c +14 -14
@@ -5,6 +5,7 @@* Originally from swsusp. */ +#define pr_fmt (fmt) "PM: " fmt#undef DEBUG
@@ -78,23 +79,22 @@ static int try_to_freeze_tasks(bool sig_only)* and caller must call thaw_processes() if something fails), * but it cleans up leftover PF_FREEZE requests. */ -printk ("\n" ); -printk (KERN_ERR "Freezing of tasks failed after %d.%02d seconds " -"(%d tasks refusing to freeze):\n" , - elapsed_csecs /100 , elapsed_csecs %100 , todo); +pr_cont ("\n" ); +pr_err ("Freezing of tasks failed after %d.%02d seconds (%d tasks refusing to freeze):\n" , + elapsed_csecs /100 , elapsed_csecs %100 , todo);show_state ();read_lock (&tasklist_lock); do_each_thread(g, p) {task_lock (p);if (freezing (p) && !freezer_should_skip (p)) -printk (KERN_ERR " %s\n" , p->comm); +pr_err (" %s\n" , p->comm);cancel_freezing (p);task_unlock (p); }while_each_thread (g, p);read_unlock (&tasklist_lock); }else { -printk ("(elapsed %d.%02d seconds) " , elapsed_csecs /100 , - elapsed_csecs %100 ); +pr_cont ("(elapsed %d.%02d seconds) " , + elapsed_csecs /100 , elapsed_csecs %100 ); }return todo ? -EBUSY :0 ;
@@ -107,22 +107,22 @@ int freeze_processes(void) {int error; -printk ("Freezing user space processes ... " ); +pr_info ("Freezing user space processes ... " ); error =try_to_freeze_tasks (true);if (error) goto Exit; -printk ("done.\n" ); +pr_cont ("done.\n" ); -printk ("Freezing remaining freezable tasks ... " ); +pr_info ("Freezing remaining freezable tasks ... " ); error =try_to_freeze_tasks (false);if (error) goto Exit; -printk ("done." ); +pr_cont ("done." );oom_killer_disable (); Exit:BUG_ON (in_atomic ()); -printk ("\n" ); +pr_cont ("\n" );return error; }
@@ -151,10 +151,10 @@ void thaw_processes(void) {oom_killer_enable (); -printk ("Restarting tasks ... " ); +pr_info ("Restarting tasks ... " );thaw_tasks (true);thaw_tasks (false);schedule (); -printk ("done.\n" ); +pr_cont ("done.\n" ); }
kernel/power/snapshot.c +17 -16
@@ -10,6 +10,8 @@* */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/version.h> #include <linux/module.h> #include <linux/mm.h>
@@ -624,7 +626,7 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn, region->end_pfn = end_pfn;list_add_tail (®ion->list, &nosave_regions); Report: -printk (KERN_INFO "PM: Registered nosave memory: %016lx - %016lx\n" , +pr_info ("Registered nosave memory: %016lx - %016lx\n" , start_pfn <<PAGE_SHIFT , end_pfn <<PAGE_SHIFT ); }
@@ -693,7 +695,7 @@ static void mark_nosave_pages(struct memory_bitmap *bm)list_for_each_entry (region, &nosave_regions, list) {unsigned long pfn; -pr_debug ("PM: Marking nosave pages: %016lx - %016lx\n" , +pr_debug ("Marking nosave pages: %016lx - %016lx\n" , region->start_pfn <<PAGE_SHIFT , region->end_pfn <<PAGE_SHIFT );
@@ -745,7 +747,7 @@ int create_basic_memory_bitmaps(void) free_pages_map = bm2;mark_nosave_pages (forbidden_pages_map); -pr_debug ("PM: Basic memory bitmaps created\n" ); +pr_debug ("Basic memory bitmaps created\n" );return 0 ;
@@ -780,7 +782,7 @@ void free_basic_memory_bitmaps(void)memory_bm_free (bm2,PG_UNSAFE_CLEAR );kfree (bm2); -pr_debug ("PM: Basic memory bitmaps freed\n" ); +pr_debug ("Basic memory bitmaps freed\n" ); }/**
@@ -1261,7 +1263,7 @@ int hibernate_preallocate_memory(void)struct timeval start, stop;int error; -printk (KERN_INFO "PM: Preallocating image memory... " ); +pr_info ("Preallocating image memory... " );do_gettimeofday (&start); error =memory_bm_create (&orig_bm,GFP_IMAGE ,PG_ANY );
@@ -1354,13 +1356,13 @@ int hibernate_preallocate_memory(void) out:do_gettimeofday (&stop); -printk (KERN_CONT "done (allocated %lu pages)\n" , pages); +pr_cont ("done (allocated %lu pages)\n" , pages);swsusp_show_speed (&start, &stop, pages,"Allocated" );return 0 ; err_out: -printk (KERN_CONT "\n" ); +pr_cont ("\n" );swsusp_free ();return -ENOMEM ; }
@@ -1402,8 +1404,8 @@ static int enough_free_mem(unsigned int nr_pages, unsigned int nr_highmem) free +=zone_page_state (zone,NR_FREE_PAGES ); nr_pages +=count_pages_for_highmem (nr_highmem); -pr_debug ("PM: Normal pages needed: %u + %u, available pages: %u\n" , - nr_pages,PAGES_FOR_IO , free); +pr_debug ("Normal pages needed: %u + %u, available pages: %u\n" , + nr_pages,PAGES_FOR_IO , free);return free > nr_pages +PAGES_FOR_IO ; }
@@ -1500,20 +1502,20 @@ asmlinkage int swsusp_save(void) {unsigned int nr_pages, nr_highmem; -printk (KERN_INFO "PM: Creating hibernation image: \n" ); +pr_info ("Creating hibernation image:\n" );drain_local_pages (NULL ); nr_pages =count_data_pages (); nr_highmem =count_highmem_pages (); -printk (KERN_INFO "PM: Need to copy %u pages\n" , nr_pages + nr_highmem); +pr_info ("Need to copy %u pages\n" , nr_pages + nr_highmem);if (!enough_free_mem (nr_pages, nr_highmem)) { -printk (KERN_ERR "PM: Not enough free memory\n" ); +pr_err ("Not enough free memory\n" );return -ENOMEM ; }if (swsusp_alloc (&orig_bm, ©_bm, nr_pages, nr_highmem)) { -printk (KERN_ERR "PM: Memory allocation failed\n" ); +pr_err ("Memory allocation failed\n" );return -ENOMEM ; }
@@ -1533,8 +1535,7 @@ asmlinkage int swsusp_save(void) nr_copy_pages = nr_pages; nr_meta_pages =DIV_ROUND_UP (nr_pages *sizeof (long ),PAGE_SIZE ); -printk (KERN_INFO "PM: Hibernation image created (%d pages copied)\n" , - nr_pages); +pr_info ("Hibernation image created (%d pages copied)\n" , nr_pages);return 0 ; }
@@ -1733,7 +1734,7 @@ static int check_header(struct swsusp_info *info)if (!reason && info->num_physpages != num_physpages) reason ="memory size" ;if (reason) { -printk (KERN_ERR "PM: Image mismatch: %s\n" , reason); +pr_err ("Image mismatch: %s\n" , reason);return -EPERM ; }return 0 ;
kernel/power/suspend.c +10 -8
@@ -8,6 +8,8 @@* This file is released under the GPLv2. */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/string.h> #include <linux/delay.h> #include <linux/errno.h>
@@ -61,7 +63,7 @@ static int suspend_test(int level) {#ifdef CONFIG_PM_DEBUG if (pm_test_level == level) { -printk (KERN_INFO "suspend debug: Waiting for 5 seconds.\n" ); +pr_info ("suspend debug: Waiting for 5 seconds.\n" );mdelay (5000 );return 1 ; }
@@ -134,7 +136,7 @@ static int suspend_enter(suspend_state_t state) error =dpm_suspend_noirq (PMSG_SUSPEND );if (error) { -printk (KERN_ERR "PM: Some devices failed to power down\n" ); +pr_err ("Some devices failed to power down\n" ); goto Platfrom_finish; }
@@ -202,7 +204,7 @@ int suspend_devices_and_enter(suspend_state_t state)suspend_test_start (); error =dpm_suspend_start (PMSG_SUSPEND );if (error) { -printk (KERN_ERR "PM: Some devices failed to suspend\n" ); +pr_err ("Some devices failed to suspend\n" ); goto Recover_platform; }suspend_test_finish ("suspend devices" );
@@ -261,11 +263,11 @@ int enter_state(suspend_state_t state)if (!mutex_trylock (&pm_mutex))return -EBUSY ; -printk (KERN_INFO "PM: Syncing filesystems ... " ); +pr_info ("Syncing filesystems ... " );sys_sync (); -printk ("done.\n" ); +pr_cont ("done.\n" ); -pr_debug ("PM: Preparing system for %s sleep\n" , pm_states[state]); +pr_debug ("Preparing system for %s sleep\n" , pm_states[state]); error =suspend_prepare ();if (error) goto Unlock;
@@ -273,11 +275,11 @@ int enter_state(suspend_state_t state)if (suspend_test (TEST_FREEZER )) goto Finish; -pr_debug ("PM: Entering %s sleep\n" , pm_states[state]); +pr_debug ("Entering %s sleep\n" , pm_states[state]); error =suspend_devices_and_enter (state); Finish: -pr_debug ("PM: Finishing wakeup.\n" ); +pr_debug ("Finishing wakeup.\n" );suspend_finish (); Unlock:mutex_unlock (&pm_mutex);
kernel/power/suspend_test.c +9 -8
@@ -6,6 +6,8 @@* This file is released under the GPLv2. */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/init.h> #include <linux/rtc.h>
@@ -38,8 +40,7 @@ void suspend_test_finish(const char *label)unsigned msec; msec =jiffies_to_msecs (abs (nj)); -pr_info ("PM: %s took %d.%03d seconds\n" , label, - msec /1000 , msec %1000 ); +pr_info ("%s took %d.%03d seconds\n" , label, msec /1000 , msec %1000 );/* Warning on suspend means the RTC alarm period needs to be * larger -- the system was sooo slooowwww to suspend that the
@@ -60,13 +61,13 @@ void suspend_test_finish(const char *label)static void __init test_wakealarm (struct rtc_device *rtc,suspend_state_t state) {static char err_readtime[]__initdata = -KERN_ERR "PM: can't read %s time, err %d\n" ; + KERN_ERR pr_fmt("can't read %s time, err %d\n");static char err_wakealarm []__initdata = -KERN_ERR "PM: can't set %s wakealarm, err %d\n" ; + KERN_ERR pr_fmt("can't set %s wakealarm, err %d\n");static char err_suspend[]__initdata = -KERN_ERR "PM: suspend test failed, error %d\n" ; + KERN_ERR pr_fmt("suspend test failed, error %d\n");static char info_test[]__initdata = -KERN_INFO "PM: test RTC wakeup from '%s' suspend\n" ; + KERN_INFO pr_fmt("test RTC wakeup from '%s' suspend\n");unsigned long now;struct rtc_wkalrm alm;
@@ -132,7 +133,7 @@ static int __init has_wakealarm(struct device *dev, void *name_ptr)static suspend_state_t test_state__initdata =PM_SUSPEND_ON ;static char warn_bad_state[]__initdata = -KERN_WARNING "PM: can't test '%s' suspend state\n" ; + KERN_WARNING pr_fmt("can't test '%s' suspend state\n");static int __init setup_test_suspend (char *value) {
@@ -156,7 +157,7 @@ __setup("test_suspend", setup_test_suspend);static int __init test_suspend (void ) {static char warn_no_rtc[]__initdata = -KERN_WARNING "PM: no wakealarm-capable RTC driver is ready\n" ; + KERN_WARNING pr_fmt("no wakealarm-capable RTC driver is ready\n");char *pony =NULL ;struct rtc_device *rtc =NULL ;
kernel/power/swap.c +21 -23
153 lines not on this page · raw message
kernel/power/user.c +5 -3
@@ -9,6 +9,8 @@* */ +#define pr_fmt (fmt) "PM: " fmt +#include <linux/suspend.h> #include <linux/syscalls.h> #include <linux/reboot.h>
@@ -221,9 +223,9 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,if (data->frozen)break ; -printk ("Syncing filesystems ... " ); +pr_info ("Syncing filesystems ... " );sys_sync (); -printk ("done.\n" ); +pr_cont ("done.\n" ); error =usermodehelper_disable ();if (error)
@@ -382,7 +384,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,break ;default : -printk (KERN_ERR "SNAPSHOT_PMOPS: invalid argument %ld\n" , arg); +pr_err ("SNAPSHOT_PMOPS: invalid argument %ld\n" , arg); }break ;
Re: [PATCH 15/21] kernel/power/: use pr_<level> and add pr_fmt(fmt)
Quoted 22 lines · Joe Perches
Quoted 21 lines · Rafael J. Wysocki
Quoted 19 lines · Joe Perches
Quoted 7 lines · Rafael J. Wysocki
Quoted 4 lines · Joe Perches
Added #define
pr_fmt(fmt)"PM: " fmt Converted printk(KERN_<level> to pr_<level>( Removed "PM: " prefix
Addedpr_fmt()to__initdatastringsWell, can you please tell me what actually is wrong with the current code?
Not much. There were a couple of trivial corrections, but perhaps the changes add a bit more flexibility and regularity.
Effective trivial changes:
o Added
KERN_CONT(pr_cont) to a couple of messages
o Added "PM: " (pr_info) to an #ifdef'd message
o Added "PM: " (pr_info) to a printk "Syncing filesystems ..." inpower/user.c
Quoted 5 lines
Quoted 3 lines
The patch as is conflicts with the changes I have queued up for 2.6.33 (they'll appear in linux-next after I've fixed all build issues, hopefully tomorrow). For one example, we're dropping
swsusp.caltogether.Hi Rafael.
Hi,
Quoted 9 lines
Here's the same patch redone against -next.
Added #define
pr_fmt(fmt)"PM: " fmt
Converted printk(KERN_<level> to pr_<level>( Converted printks withoutKERN_topr_infoorpr_contRemoved hard coded "PM: " prefix from message strings Addedpr_fmt()to__initdatastrings
Integrated multiple line strings
All logging messages are now output prefixed with "PM: "
Does this patch depend on any other patch that haven't been merged yet?
I still don't like pr_info(), pr_error() and pr_crit().
Rafael
Quoted 12 lines
Signed-off-by Joe Perches <[email protected]>kernel/power/hibernate.c | 54 ++++++++++++++++++++--------------------- kernel/power/hibernate_nvs.c | 6 +++- kernel/power/process.c | 28 +++++++++++----------- kernel/power/snapshot.c | 33 +++++++++++++------------ kernel/power/suspend.c | 18 +++++++------ kernel/power/suspend_test.c | 17 +++++++------ kernel/power/swap.c | 44 ++++++++++++++++------------------ kernel/power/user.c | 8 ++++-- 8 files changed, 106 insertions(+), 102 deletions(-)
Re: [PATCH 15/21] kernel/power/: use pr_<level> and add pr_fmt(fmt)
Quoted 9 lines · Rafael J. Wysocki
Quoted 7 lines · Joe Perches
Added #define
pr_fmt(fmt)"PM: " fmt
Converted printk(KERN_<level> to pr_<level>( Converted printks withoutKERN_topr_infoorpr_contRemoved hard coded "PM: " prefix from message strings Addedpr_fmt()to__initdatastrings
Integrated multiple line strings
All logging messages are now output prefixed with "PM: "Does this patch depend on any other patch that haven't been merged yet?
No. I think it's OK to merge.
The idea is to eventually have smaller objects without prefixes, just a single stored prefix string that printk would insert and a bit more consistent output.
cheers, Joe
Re: [PATCH 15/21] kernel/power/: use pr_<level> and add pr_fmt(fmt)
In reply to Rafael J. WysockiQuoted 11 lines
Quoted 10 lines
Here's the same patch redone against -next.
Added #define
pr_fmt(fmt)"PM: " fmt
Converted printk(KERN_<level> to pr_<level>( Converted printks withoutKERN_topr_infoorpr_contRemoved hard coded "PM: " prefix from message strings Addedpr_fmt()to__initdatastrings
Integrated multiple line strings
All logging messages are now output prefixed with "PM: "
Quoted 3 lines
Does this patch depend on any other patch that haven't been merged yet?
I still don't like
pr_info(),pr_error()andpr_crit().
Well, rest of kernel uses them, they are shorter, and will save few bytes too... so why not?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[tip:tracing/core] ftrace.c: Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
In reply to Joe PerchesCommit-ID: 3bb258bf430d29a24350fe4f44f8bf07b7b7a8f6 Gitweb: http://git.kernel.org/tip/3bb258bf430d29a24350fe4f44f8bf07b7b7a8f6 Author: Joe Perches <[email protected]> AuthorDate: Sun, 4 Oct 2009 17:53:29 -0700 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 12 Oct 2009 08:05:40 +0200
ftrace.c: Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- Remove prefixes from pr_<level>, use pr_fmt(fmt).
No change in output.
LKML-Reference: <9b377eefae9e28c599dd4a17bdc81172965e9931.1254701151.git.joe@perches.com>
--- arch/x86/kernel/ftrace.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
arch/x86/kernel/ftrace.c +5 -3
@@ -9,6 +9,8 @@* the dangers of modifying code on the run. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/spinlock.h> #include <linux/hardirq.h> #include <linux/uaccess.h>
@@ -336,15 +338,15 @@ int __init ftrace_dyn_arch_init(void *data)switch (faulted) {case 0 : -pr_info ("ftrace: converting mcount calls to 0f 1f 44 00 00\n" ); +pr_info ("converting mcount calls to 0f 1f 44 00 00\n" );memcpy (ftrace_nop, ftrace_test_p6nop,MCOUNT_INSN_SIZE );break ;case 1 : -pr_info ("ftrace: converting mcount calls to 66 66 66 66 90\n" ); +pr_info ("converting mcount calls to 66 66 66 66 90\n" );memcpy (ftrace_nop, ftrace_test_nop5,MCOUNT_INSN_SIZE );break ;case 2 : -pr_info ("ftrace: converting mcount calls to jmp . + 5\n" ); +pr_info ("converting mcount calls to jmp . + 5\n" );memcpy (ftrace_nop, ftrace_test_jmp,MCOUNT_INSN_SIZE );break ; }
[tip:tracing/core] testmmiotrace.c: Add and use pr_fmt(fmt)
In reply to Joe PerchesCommit-ID: 3c355863fb32070a2800f41106519c5c3038623a Gitweb: http://git.kernel.org/tip/3c355863fb32070a2800f41106519c5c3038623a Author: Joe Perches <[email protected]> AuthorDate: Sun, 4 Oct 2009 17:53:40 -0700 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 12 Oct 2009 08:05:41 +0200
testmmiotrace.c: Add and use pr_fmt(fmt)
- Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt.
- Strip MODULE_NAME from pr_<level>s.
- Remove MODULE_NAME definition.
LKML-Reference: <3bb66cc7f85f77b9416902e1be7076f7e3f4ad48.1254701151.git.joe@perches.com>
--- arch/x86/mm/testmmiotrace.c | 29 ++++++++++++++--------------- 1 files changed, 14 insertions(+), 15 deletions(-)
arch/x86/mm/testmmiotrace.c +14 -15
@@ -1,12 +1,13 @@/* * Written by Pekka Paalanen, 2008-2009 <[email protected]> */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/io.h> #include <linux/mmiotrace.h> -#define MODULE_NAME "testmmiotrace" -static unsigned long mmio_address;module_param (mmio_address, ulong,0 ); MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB "
@@ -30,7 +31,7 @@ static unsigned v32(unsigned i)static void do_write_test (void __iomem *p) {unsigned int i; -pr_info (MODULE_NAME ": write test.\n" ); +pr_info ("write test.\n" );mmiotrace_printk ("Write test.\n" );for (i =0 ; i <256 ; i++)
@@ -47,7 +48,7 @@ static void do_read_test(void __iomem *p) {unsigned int i;unsigned errs[3 ] = {0 }; -pr_info (MODULE_NAME ": read test.\n" ); +pr_info ("read test.\n" );mmiotrace_printk ("Read test.\n" );for (i =0 ; i <256 ; i++)
@@ -68,7 +69,7 @@ static void do_read_test(void __iomem *p)static void do_read_far_test (void __iomem *p) { -pr_info (MODULE_NAME ": read far test.\n" ); +pr_info ("read far test.\n" );mmiotrace_printk ("Read far test.\n" );ioread32 (p + read_far);
@@ -78,7 +79,7 @@ static void do_test(unsigned long size) {void __iomem *p =ioremap_nocache (mmio_address, size);if (!p) { -pr_err (MODULE_NAME ": could not ioremap, aborting.\n" ); +pr_err ("could not ioremap, aborting.\n" );return ; }mmiotrace_printk ("ioremap returned %p.\n" , p);
@@ -94,24 +95,22 @@ static int __init init(void)unsigned long size = (read_far) ? (8 <<20 ) : (16 <<10 );if (mmio_address ==0 ) { -pr_err (MODULE_NAME ": you have to use the module argument " -"mmio_address.\n" ); -pr_err (MODULE_NAME ": DO NOT LOAD THIS MODULE UNLESS" -" YOU REALLY KNOW WHAT YOU ARE DOING!\n" ); +pr_err ("you have to use the module argument mmio_address.\n" ); +pr_err ("DO NOT LOAD THIS MODULE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!\n" );return -ENXIO ; } -pr_warning (MODULE_NAME ": WARNING: mapping %lu kB @ 0x%08lx in PCI " -"address space, and writing 16 kB of rubbish in there.\n" , - size >>10 , mmio_address); +pr_warning ("WARNING: mapping %lu kB @ 0x%08lx in PCI address space, " +"and writing 16 kB of rubbish in there.\n" , + size >>10 , mmio_address);do_test (size); -pr_info (MODULE_NAME ": All done.\n" ); +pr_info ("All done.\n" );return 0 ; } static void __exit cleanup(void) { -pr_debug (MODULE_NAME ": unloaded.\n" ); +pr_debug ("unloaded.\n" ); }module_init (init);
Joerg Roedel
AppliedRe: [PATCH 05/21] amd_iommu.c: use pr_<level> and add pr_fmt(fmt)
In reply to Joe PerchesQuoted 7 lines · Joe Perches
Added #define
pr_fmt(fmt)KBUILD_MODNAME": " fmt
Converted a few bare printks topr_contSigned-off-by Joe Perches <[email protected]>--- arch/x86/kernel/amd_iommu.c | 71 ++++++++++++++++++++++-------------------- 1 files changed, 37 insertions(+), 34 deletions(-)
Applied to amd-iommu/cleanups. Thanks Joe.
Re: [PATCH 05/21] amd_iommu.c: use pr_<level> and add pr_fmt(fmt)
Quoted 8 lines · Joerg Roedel
Quoted 6 lines · Joe Perches
Added #define
pr_fmt(fmt)KBUILD_MODNAME": " fmt
Converted a few bare printks topr_contSigned-off-by Joe Perches <[email protected]>--- arch/x86/kernel/amd_iommu.c | 71 ++++++++++++++++++++++-------------------- 1 files changed, 37 insertions(+), 34 deletions(-)Applied to amd-iommu/cleanups. Thanks Joe.
Hi Jeorg:
Looking back at the original patch:
arch/x86/kernel/amd_iommu.c static void iommu_print_event(struct amd_iommu *iommu, void *__evt) · line 225
Quoted 4 lines
default:
arch/x86/kernel/amd_iommu.c +2
-1-printk (KERN_ERR "UNKNOWN type=0x%02x]\n" , type); +pr_cont ("\n" ); +pr_err ("UNKNOWN type=0x%02x]\n" , type);
The default case probably had an incorrect KERN_ERR and should be
pr_cont("UNKNOWN type=0x%02x]\n", type);cheers, Joe