[PATCH 03/14] powerpc: use printk_once

Wolfram Sang w.sang at pengutronix.de
Mon Aug 10 18:00:49 EST 2009


On Sun, Aug 09, 2009 at 09:53:58PM +0200, Marcin Slusarz wrote:
> Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com>
> Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Cc: Paul Mackerras <paulus at samba.org>
> Cc: linuxppc-dev at ozlabs.org
> ---
>  arch/powerpc/kernel/iommu.c      |    6 +-----
>  arch/powerpc/kernel/irq.c        |    5 ++---
>  arch/powerpc/sysdev/ppc4xx_pci.c |    9 ++-------
>  3 files changed, 5 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
> index fd51578..c7fa258 100644
> --- a/arch/powerpc/kernel/iommu.c
> +++ b/arch/powerpc/kernel/iommu.c
> @@ -502,7 +502,6 @@ static void iommu_table_clear(struct iommu_table *tbl)
>  struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
>  {
>  	unsigned long sz;
> -	static int welcomed = 0;
>  	struct page *page;
>  
>  	/* Set aside 1/4 of the table for large allocations. */
> @@ -523,11 +522,8 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
>  
>  	iommu_table_clear(tbl);
>  
> -	if (!welcomed) {
> -		printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
> +	printk_once(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
>  		       novmerge ? "disabled" : "enabled");
> -		welcomed = 1;
> -	}
>  
>  	return tbl;
>  }
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index f7f376e..05ebd21 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -231,7 +231,6 @@ skip:
>  void fixup_irqs(cpumask_t map)
>  {
>  	unsigned int irq;
> -	static int warned;
>  
>  	for_each_irq(irq) {
>  		cpumask_t mask;
> @@ -246,8 +245,8 @@ void fixup_irqs(cpumask_t map)
>  		}
>  		if (irq_desc[irq].chip->set_affinity)
>  			irq_desc[irq].chip->set_affinity(irq, &mask);
> -		else if (irq_desc[irq].action && !(warned++))
> -			printk("Cannot set affinity for irq %i\n", irq);
> +		else if (irq_desc[irq].action)
> +			printk_once("Cannot set affinity for irq %i\n", irq);

Maybe we should add a loglevel to this printk (and the other one in fix_irqs)
while we are here?

Other than that:

Acked-by: Wolfram Sang <w.sang at pengutronix.de>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20090810/eb5fcb20/attachment.pgp>


More information about the Linuxppc-dev mailing list