lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1612080953460.9219@nippy.intranet>
Date:   Thu, 8 Dec 2016 09:54:34 +1100 (AEDT)
From:   Finn Thain <fthain@...egraphics.com.au>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
cc:     Greg Ungerer <gerg@...ux-m68k.org>, Sam Creasey <sammy@...my.net>,
        Joshua Thompson <funaho@...ai.org>,
        linux-m68k@...ts.linux-m68k.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 07/22] m68k/mac: baboon - Modernize printing of kernel
 messages


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 <geert@...ux-m68k.org>
> ---
>  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 <asm/mac_baboon.h>
>  
>  /* #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));
>  }
> 

-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ