Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751924AbbH1CAV (ORCPT ); Thu, 27 Aug 2015 22:00:21 -0400 Received: from smtprelay0066.hostedemail.com ([216.40.44.66]:56373 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751054AbbH1CAT (ORCPT ); Thu, 27 Aug 2015 22:00:19 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3871:3872:3873:4250:4321:4605:5007:6119:6261:10004:10400:10848:11026:11232:11657:11658:11914:12043:12296:12438:12517:12519:12555:12740:13161:13229:13972:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: fish05_1f92bbe37cb0c X-Filterd-Recvd-Size: 3482 Message-ID: <1440727215.11525.122.camel@perches.com> Subject: Re: [PATCH] MIPS: BCM63XX: Use pr_* instead of printk From: Joe Perches To: Gregory Fong Cc: Ralf Baechle , Florian Fainelli , Jonas Gorski , Rusty Russell , Nicolas Schichan , "open list:MIPS" , open list Date: Thu, 27 Aug 2015 19:00:15 -0700 In-Reply-To: <1440725410-2082-1-git-send-email-gregory.0xf0@gmail.com> References: <1440725410-2082-1-git-send-email-gregory.0xf0@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2617 Lines: 80 On Thu, 2015-08-27 at 18:30 -0700, Gregory Fong wrote: > If you ever do more of these, here are a few trivial style notes: > diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c > +#define pr_fmt(fmt) "board_bcm963xx: " fmt Using: #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt is more common > @@ -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. > @@ -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); > diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c [] > @@ -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); > + 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... > diff --git a/arch/mips/bcm63xx/timer.c b/arch/mips/bcm63xx/timer.c [] > @@ -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__); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/