MIPS: BCM63XX: Use pr_* instead of printk
PATCH 1/1 MIPS: BCM63XX: Use pr_* instead of printk
--- arch/mips/bcm63xx/boards/board_bcm963xx.c | 11 ++++++----- arch/mips/bcm63xx/cpu.c | 6 +++--- arch/mips/bcm63xx/dev-pcmcia.c | 2 +- arch/mips/bcm63xx/irq.c | 2 +- arch/mips/bcm63xx/setup.c | 8 ++++---- arch/mips/bcm63xx/timer.c | 2 +- 6 files changed, 16 insertions(+), 15 deletions(-)
arch/mips/bcm63xx/boards/board_bcm963xx.c +6 -5
@@ -7,6 +7,8 @@* Copyright (C) 2008 Florian Fainelli <[email protected]> */ +#define pr_fmt (fmt) "board_bcm963xx: " fmt +#include <linux/init.h> #include <linux/kernel.h> #include <linux/string.h>
@@ -31,7 +33,6 @@#include <uapi/linux/bcm933xx_hcs.h> -#define PFX "board_bcm963xx: "#define HCS_OFFSET_128K 0x20000
@@ -740,7 +741,7 @@ int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out)memcpy (out, &bcm63xx_sprom,sizeof (struct ssb_sprom ));return 0 ; }else { - printk(KERN_ERR PFX "unable to fill SPROM for given bustype.\n"); +pr_err ("unable to fill SPROM for given bustype.\n" );return -EINVAL ; } }
@@ -784,7 +785,7 @@ void __init board_prom_init(void) cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]); else strcpy(cfe_version, "unknown"); - printk(KERN_INFO PFX "CFE version: %s\n", cfe_version); + pr_info("CFE version: %s\n", cfe_version);bcm63xx_nvram_init (boot_addr +BCM963XX_NVRAM_OFFSET );
@@ -808,7 +809,7 @@ void __init board_prom_init(void)char name[17 ];memcpy (name, board_name,16 ); name[16 ] =0 ; - printk(KERN_ERR PFX "unknown bcm963xx board: %s\n", +pr_err ("unknown bcm963xx board: %s\n" , name);return ; }
@@ -854,7 +855,7 @@ void __init board_setup(void) {if (!board.name[0 ])panic ("unable to detect bcm963xx board" ); - printk(KERN_INFO PFX "board name: %s\n", board.name); +pr_info ("board name: %s\n" , board.name);/* make sure we're running on expected cpu */ if (bcm63xx_get_cpu_id () != board.expected_cpu_id)
arch/mips/bcm63xx/cpu.c +3 -3
@@ -376,10 +376,10 @@ void __init bcm63xx_cpu_init(void) bcm63xx_cpu_freq =detect_cpu_clock (); bcm63xx_memory_size =detect_memory_size (); -printk (KERN_INFO "Detected Broadcom 0x%04x CPU revision %02x\n" , +pr_info ("Detected Broadcom 0x%04x CPU revision %02x\n" , bcm63xx_cpu_id, bcm63xx_cpu_rev); -printk (KERN_INFO "CPU frequency is %u MHz\n" , +pr_info ("CPU frequency is %u MHz\n" , bcm63xx_cpu_freq /1000000 ); -printk (KERN_INFO "%uMB of RAM installed\n" , +pr_info ("%uMB of RAM installed\n" , bcm63xx_memory_size >>20 ); }
arch/mips/bcm63xx/dev-pcmcia.c +1 -1
@@ -139,6 +139,6 @@ int __init bcm63xx_pcmcia_register(void)return platform_device_register (&bcm63xx_pcmcia_device); out_err: -printk (KERN_ERR "unable to set pcmcia chip select\n" ); +pr_err ("unable to set pcmcia chip select\n" );return ret; }
arch/mips/bcm63xx/irq.c +1 -1
@@ -311,7 +311,7 @@ static int bcm63xx_external_irq_set_type(struct irq_data *d,break ;default : -printk (KERN_ERR "bogus flow type combination given !\n" ); +pr_err ("bogus flow type combination given !\n" );return -EINVAL ; }
arch/mips/bcm63xx/setup.c +4 -4
@@ -24,7 +24,7 @@void bcm63xx_machine_halt (void ) { -printk (KERN_INFO "System halted\n" ); +pr_info ("System halted\n" );while (1 ) ; }
@@ -34,7 +34,7 @@ static void bcm6348_a1_reboot(void)u32 reg;/* soft reset all blocks */ -printk (KERN_INFO "soft-resetting all blocks ...\n" ); +pr_info ("soft-resetting all blocks ...\n" ); reg =bcm_perf_readl (PERF_SOFTRESET_REG ); reg &= ~SOFTRESET_6348_ALL ;bcm_perf_writel (reg,PERF_SOFTRESET_REG );
@@ -46,7 +46,7 @@ static void bcm6348_a1_reboot(void)mdelay (10 );/* Jump to the power on address. */ -printk (KERN_INFO "jumping to reset vector.\n" ); +pr_info ("jumping to reset vector.\n" );/* set high vectors (base at 0xbfc00000 */ set_c0_status (ST0_BEV |ST0_ERL );/* run uncached in kseg0 */
@@ -110,7 +110,7 @@ void bcm63xx_machine_reboot(void)if (BCMCPU_IS_6348 () && (bcm63xx_get_cpu_rev () ==0xa1 ))bcm6348_a1_reboot (); -printk (KERN_INFO "triggering watchdog soft-reset...\n" ); +pr_info ("triggering watchdog soft-reset...\n" );if (BCMCPU_IS_6328 ()) {bcm_wdt_writel (1 ,WDT_SOFTRESET_REG ); }else {
arch/mips/bcm63xx/timer.c +1 -1
@@ -195,7 +195,7 @@ int bcm63xx_timer_init(void) irq =bcm63xx_get_irq_number (IRQ_TIMER ); ret =request_irq (irq, timer_interrupt,0 ,"bcm63xx_timer" ,NULL );if (ret) { -printk (KERN_ERR "bcm63xx_timer: failed to register irq\n" ); +pr_err ("bcm63xx_timer: failed to register irq\n" );return ret; }
Signature · 1 line
1.9.1
Quoted 1 line · Gregory Fong
If you ever do more of these, here are a few trivial style notes:
arch/mips/bcm63xx/boards/board_bcm963xx.c line 10
Quoted 3 lines
arch/mips/bcm63xx/boards/board_bcm963xx.c +1
-0+#define pr_fmt (fmt) "board_bcm963xx: " fmt
Using:
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
is more common
arch/mips/bcm63xx/boards/board_bcm963xx.c int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out) · line 744
Quoted 6 lines
arch/mips/bcm63xx/boards/board_bcm963xx.c +1
-1@@ -740,7 +741,7 @@ int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out)memcpy (out, &bcm63xx_sprom,sizeof (struct ssb_sprom ));return 0 ; }else { - printk(KERN_ERR PFX "unable to fill SPROM for given bustype.\n"); +pr_err ("unable to fill SPROM for given bustype.\n" );
The periods at the end of logging lines are generally superfluous and can be removed.
arch/mips/bcm63xx/boards/board_bcm963xx.c void __init board_prom_init(void) · line 813
Quoted 7 lines
arch/mips/bcm63xx/boards/board_bcm963xx.c +1
-1@@ -808,7 +809,7 @@ void __init board_prom_init(void)char name[17 ];memcpy (name, board_name,16 ); name[16 ] =0 ; - printk(KERN_ERR PFX "unknown bcm963xx board: %s\n", +pr_err ("unknown bcm963xx board: %s\n" , name);
It's nicer to unwrap lines where appropriate:
pr_err("unknown bcm963xx board: %s\n", name);arch/mips/bcm63xx/cpu.c
Quoted 1 line
arch/mips/bcm63xx/cpu.c +0
-0
[]
arch/mips/bcm63xx/cpu.c void __init bcm63xx_cpu_init(void) · line 380
Quoted 7 lines
arch/mips/bcm63xx/cpu.c +1
-1@@ -376,10 +376,10 @@ void __init bcm63xx_cpu_init(void) bcm63xx_cpu_freq =detect_cpu_clock (); bcm63xx_memory_size =detect_memory_size (); -printk (KERN_INFO "Detected Broadcom 0x%04x CPU revision %02x\n" , +pr_info ("Detected Broadcom 0x%04x CPU revision %02x\n" , bcm63xx_cpu_id, bcm63xx_cpu_rev);
It's nicer to reflow alignment for the entire statement to keep the subsequent line arguments at the open parenthesis:
pr_info("Detected Broadcom 0x%04x CPU revision %02x\n", bcm63xx_cpu_id, bcm63xx_cpu_rev);
arch/mips/bcm63xx/cpu.c void __init bcm63xx_cpu_init(void) · line 382
Quoted 2 lines
arch/mips/bcm63xx/cpu.c +1
-0+pr_info ("CPU frequency is %u MHz\n" , bcm63xx_cpu_freq /1000000 );
pr_info("CPU frequency is %u MHz\n", bcm63xx_cpu_freq / 1000000);etc...
arch/mips/bcm63xx/timer.c
Quoted 1 line
arch/mips/bcm63xx/timer.c +0
-0
[]
arch/mips/bcm63xx/timer.c int bcm63xx_timer_init(void) · line 198
Quoted 6 lines
arch/mips/bcm63xx/timer.c +1
-1@@ -195,7 +195,7 @@ int bcm63xx_timer_init(void) irq =bcm63xx_get_irq_number (IRQ_TIMER ); ret =request_irq (irq, timer_interrupt,0 ,"bcm63xx_timer" ,NULL );if (ret) { -printk (KERN_ERR "bcm63xx_timer: failed to register irq\n" ); +pr_err ("bcm63xx_timer: failed to register irq\n" );
It's sometimes nicer to change embedded function names to use "%s: ", __func__
pr_err("%s: failed to register irq\n", __func__);