Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933343AbcLGWye (ORCPT ); Wed, 7 Dec 2016 17:54:34 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:46854 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932583AbcLGWyd (ORCPT ); Wed, 7 Dec 2016 17:54:33 -0500 Date: Thu, 8 Dec 2016 09:54:34 +1100 (AEDT) From: Finn Thain To: Geert Uytterhoeven cc: Greg Ungerer , Sam Creasey , Joshua Thompson , linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/22] m68k/mac: baboon - Modernize printing of kernel messages In-Reply-To: <1481123360-10978-8-git-send-email-geert@linux-m68k.org> Message-ID: References: <1481123360-10978-1-git-send-email-geert@linux-m68k.org> <1481123360-10978-8-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2288 Lines: 81 On Wed, 7 Dec 2016, Geert Uytterhoeven wrote: > - Introduce helpers for printing debug messages, incl. dummies for > validating format strings when debugging is disabled, > - Convert from printk() to pr_*(), > - Drop superfluous casts. > > Signed-off-by: Geert Uytterhoeven > --- > arch/m68k/mac/baboon.c | 22 ++++++++++------------ > 1 file changed, 10 insertions(+), 12 deletions(-) > > diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c > index f6f7d42713ec8b95..5dac92227654419b 100644 > --- a/arch/m68k/mac/baboon.c > +++ b/arch/m68k/mac/baboon.c > @@ -15,6 +15,11 @@ > #include > > /* #define DEBUG_IRQS */ > +#ifdef DEBUG_IRQS > +#define pr_irq(fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) > +#else > +#define pr_irq(fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) > +#endif > I'd prefer to drop the DEBUG_IRQS printk messages in this file. Thanks. > int baboon_present; > static volatile struct baboon *baboon; > @@ -38,7 +43,7 @@ void __init baboon_init(void) > baboon = (struct baboon *) BABOON_BASE; > baboon_present = 1; > > - printk("Baboon detected at %p\n", baboon); > + pr_info("Baboon detected at %p\n", baboon); > } > > /* > @@ -50,11 +55,8 @@ static void baboon_irq(struct irq_desc *desc) > int irq_bit, irq_num; > unsigned char events; > > -#ifdef DEBUG_IRQS > - printk("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n", > - (uint) baboon->mb_control, (uint) baboon->mb_ifr, > - (uint) baboon->mb_status); > -#endif > + pr_irq("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n", > + baboon->mb_control, baboon->mb_ifr, baboon->mb_status); > > events = baboon->mb_ifr & 0x07; > if (!events) > @@ -97,18 +99,14 @@ void __init baboon_register_interrupts(void) > > void baboon_irq_enable(int irq) > { > -#ifdef DEBUG_IRQUSE > - printk("baboon_irq_enable(%d)\n", irq); > -#endif > + pr_irq("baboon_irq_enable(%d)\n", irq); > > mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C)); > } > > void baboon_irq_disable(int irq) > { > -#ifdef DEBUG_IRQUSE > - printk("baboon_irq_disable(%d)\n", irq); > -#endif > + pr_irq("baboon_irq_disable(%d)\n", irq); > > mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C)); > } > --