linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@linux-m68k.org>, Sam Creasey <sammy@sammy.net>,
	Joshua Thompson <funaho@jurai.org>,
	linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 18/22] m68k/mm: kmap - Modernize printing of kernel messages
Date: Thu, 8 Dec 2016 10:26:11 +1100 (AEDT)	[thread overview]
Message-ID: <alpine.LNX.2.00.1612081022280.9219@nippy.intranet> (raw)
In-Reply-To: <1481123360-10978-19-git-send-email-geert@linux-m68k.org>


On Wed, 7 Dec 2016, Geert Uytterhoeven wrote:

>   - Convert from printk() to pr_*(),
>   - Add missing continuations,
>   - Remove #undef DEBUG.
> 
> Note that "#ifdef DEBUG" is sometimes retained because pr_cont() is not
> optimized away when debugging is disabled.
> 

I think that argues for using printk(KERN_DEBUG ...) and print(KERN_CONT 
...) inside #ifdef DEBUG, which would need no explanation.

If instead you use a combination of pr_debug and pr_cont and #ifdef DEBUG, 
perhaps the explanation should be moved from the commit log to a comment 
in the code?

-- 

> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  arch/m68k/mm/kmap.c | 26 ++++++++++++--------------
>  1 file changed, 12 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c
> index 6e4955bc542bfc59..ce4773461651656a 100644
> --- a/arch/m68k/mm/kmap.c
> +++ b/arch/m68k/mm/kmap.c
> @@ -21,8 +21,6 @@
>  #include <asm/pgalloc.h>
>  #include <asm/io.h>
>  
> -#undef DEBUG
> -
>  #define PTRTREESIZE	(256*1024)
>  
>  /*
> @@ -125,9 +123,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla
>  	}
>  #endif
>  
> -#ifdef DEBUG
> -	printk("ioremap: 0x%lx,0x%lx(%d) - ", physaddr, size, cacheflag);
> -#endif
> +	pr_debug("ioremap: 0x%lx,0x%lx(%d) - ", physaddr, size, cacheflag);
>  	/*
>  	 * Mappings have to be aligned
>  	 */
> @@ -145,7 +141,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla
>  	virtaddr = (unsigned long)area->addr;
>  	retaddr = virtaddr + offset;
>  #ifdef DEBUG
> -	printk("0x%lx,0x%lx,0x%lx", physaddr, virtaddr, retaddr);
> +	pr_cont("0x%lx,0x%lx,0x%lx", physaddr, virtaddr, retaddr);
>  #endif
>  
>  	/*
> @@ -187,12 +183,12 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla
>  	while ((long)size > 0) {
>  #ifdef DEBUG
>  		if (!(virtaddr & (PTRTREESIZE-1)))
> -			printk ("\npa=%#lx va=%#lx ", physaddr, virtaddr);
> +			pr_info("\npa=%#lx va=%#lx ", physaddr, virtaddr);
>  #endif
>  		pgd_dir = pgd_offset_k(virtaddr);
>  		pmd_dir = pmd_alloc(&init_mm, pgd_dir, virtaddr);
>  		if (!pmd_dir) {
> -			printk("ioremap: no mem for pmd_dir\n");
> +			pr_err("ioremap: no mem for pmd_dir\n");
>  			return NULL;
>  		}
>  
> @@ -204,7 +200,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla
>  		} else {
>  			pte_dir = pte_alloc_kernel(pmd_dir, virtaddr);
>  			if (!pte_dir) {
> -				printk("ioremap: no mem for pte_dir\n");
> +				pr_err("ioremap: no mem for pte_dir\n");
>  				return NULL;
>  			}
>  
> @@ -215,7 +211,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla
>  		}
>  	}
>  #ifdef DEBUG
> -	printk("\n");
> +	pr_cont("\n");
>  #endif
>  	flush_tlb_all();
>  
> @@ -254,7 +250,7 @@ void __iounmap(void *addr, unsigned long size)
>  	while ((long)size > 0) {
>  		pgd_dir = pgd_offset_k(virtaddr);
>  		if (pgd_bad(*pgd_dir)) {
> -			printk("iounmap: bad pgd(%08lx)\n", pgd_val(*pgd_dir));
> +			pr_err("iounmap: bad pgd(%08lx)\n", pgd_val(*pgd_dir));
>  			pgd_clear(pgd_dir);
>  			return;
>  		}
> @@ -274,7 +270,7 @@ void __iounmap(void *addr, unsigned long size)
>  		}
>  
>  		if (pmd_bad(*pmd_dir)) {
> -			printk("iounmap: bad pmd (%08lx)\n", pmd_val(*pmd_dir));
> +			pr_err("iounmap: bad pmd (%08lx)\n", pmd_val(*pmd_dir));
>  			pmd_clear(pmd_dir);
>  			return;
>  		}
> @@ -332,7 +328,8 @@ void kernel_set_cachemode(void *addr, unsigned long size, int cmode)
>  	while ((long)size > 0) {
>  		pgd_dir = pgd_offset_k(virtaddr);
>  		if (pgd_bad(*pgd_dir)) {
> -			printk("iocachemode: bad pgd(%08lx)\n", pgd_val(*pgd_dir));
> +			pr_err("iocachemode: bad pgd(%08lx)\n",
> +			       pgd_val(*pgd_dir));
>  			pgd_clear(pgd_dir);
>  			return;
>  		}
> @@ -351,7 +348,8 @@ void kernel_set_cachemode(void *addr, unsigned long size, int cmode)
>  		}
>  
>  		if (pmd_bad(*pmd_dir)) {
> -			printk("iocachemode: bad pmd (%08lx)\n", pmd_val(*pmd_dir));
> +			pr_err("iocachemode: bad pmd (%08lx)\n",
> +			       pmd_val(*pmd_dir));
>  			pmd_clear(pmd_dir);
>  			return;
>  		}
> 

  reply	other threads:[~2016-12-07 23:26 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 15:08 [PATCH 00/22] m68k: Modernize printing of kernel messages Geert Uytterhoeven
2016-12-07 15:08 ` [PATCH 01/22] m68k/atari: " Geert Uytterhoeven
2016-12-07 22:36   ` Finn Thain
2016-12-08 12:22     ` Geert Uytterhoeven
2016-12-08 22:55       ` Finn Thain
2016-12-10  0:44       ` Michael Schmitz
2017-02-09 11:59         ` Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 02/22] m68k/mac: macints - " Geert Uytterhoeven
2016-12-07 22:45   ` Finn Thain
2016-12-08 12:25     ` Geert Uytterhoeven
2016-12-08 23:11       ` Finn Thain
2016-12-07 15:09 ` [PATCH 03/22] m68k/mac: via " Geert Uytterhoeven
2016-12-07 22:48   ` Finn Thain
2016-12-07 15:09 ` [PATCH 04/22] m68k/68000: " Geert Uytterhoeven
2016-12-09 12:00   ` Greg Ungerer
2016-12-07 15:09 ` [PATCH 05/22] m68k/bvme6000: " Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 06/22] m68k/coldfire: " Geert Uytterhoeven
2016-12-07 22:53   ` Finn Thain
2016-12-09 12:09     ` Greg Ungerer
2016-12-07 15:09 ` [PATCH 07/22] m68k/mac: baboon - " Geert Uytterhoeven
2016-12-07 22:54   ` Finn Thain
2016-12-07 15:09 ` [PATCH 08/22] m68k/mac: iop " Geert Uytterhoeven
2016-12-07 23:06   ` Finn Thain
2016-12-07 15:09 ` [PATCH 09/22] m68k/mac: oss " Geert Uytterhoeven
2016-12-07 23:08   ` Finn Thain
2016-12-07 15:09 ` [PATCH 10/22] m68k/mac: psc " Geert Uytterhoeven
2016-12-07 23:10   ` Finn Thain
2016-12-07 15:09 ` [PATCH 11/22] m68k/mac: " Geert Uytterhoeven
2016-12-07 23:17   ` Finn Thain
2016-12-07 15:09 ` [PATCH 12/22] m68k/mvme147: " Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 13/22] m68k/mvme16x: " Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 14/22] m68k/q40: " Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 15/22] m68k/sun3: " Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 16/22] m68k/sun3x: " Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 17/22] m68k/kernel: " Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 18/22] m68k/mm: kmap - " Geert Uytterhoeven
2016-12-07 23:26   ` Finn Thain [this message]
2016-12-09 22:50     ` Finn Thain
2016-12-07 15:09 ` [PATCH 19/22] m68k/mm: motorola " Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 20/22] m68k/mm: sun3 " Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 21/22] m68k/mm: " Geert Uytterhoeven
2016-12-07 15:09 ` [PATCH 22/22] m68k/include: " Geert Uytterhoeven
2017-02-09 13:25 ` [PATCH 00/22] m68k: " Geert Uytterhoeven
2017-02-12  9:43   ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1612081022280.9219@nippy.intranet \
    --to=fthain@telegraphics.com.au \
    --cc=funaho@jurai.org \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=sammy@sammy.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).