Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1537812 > unrolled thread

[PATCH 00/22] m68k: Modernize printing of kernel messages

Started byGeert Uytterhoeven <geert@linux-m68k.org>
First post2016-12-07 16:20 +0100
Last post2016-12-07 16:20 +0100
Articles 20 on this page of 24 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/22] m68k: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
    [PATCH 14/22] m68k/q40: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
    [PATCH 19/22] m68k/mm: motorola - Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
    [PATCH 04/22] m68k/68000: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
      Re: [PATCH 04/22] m68k/68000: Modernize printing of kernel messages Greg Ungerer <gerg@linux-m68k.org> - 2016-12-09 13:20 +0100
    [PATCH 15/22] m68k/sun3: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
    [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
      Re: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel  messages Finn Thain <fthain@telegraphics.com.au> - 2016-12-07 23:50 +0100
        Re: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-08 13:30 +0100
          Re: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel  messages Finn Thain <fthain@telegraphics.com.au> - 2016-12-09 00:20 +0100
    [PATCH 21/22] m68k/mm: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
    [PATCH 11/22] m68k/mac: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
      Re: [PATCH 11/22] m68k/mac: Modernize printing of kernel messages Finn Thain <fthain@telegraphics.com.au> - 2016-12-08 00:20 +0100
    [PATCH 20/22] m68k/mm: sun3 - Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
    [PATCH 06/22] m68k/coldfire: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
      Re: [PATCH 06/22] m68k/coldfire: Modernize printing of kernel  messages Finn Thain <fthain@telegraphics.com.au> - 2016-12-08 00:00 +0100
        Re: [PATCH 06/22] m68k/coldfire: Modernize printing of kernel  messages Greg Ungerer <gerg@linux-m68k.org> - 2016-12-09 13:10 +0100
    [PATCH 22/22] m68k/include: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
    [PATCH 13/22] m68k/mvme16x: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
    [PATCH 05/22] m68k/bvme6000: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
    [PATCH 12/22] m68k/mvme147: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
    [PATCH 08/22] m68k/mac: iop - Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100
      Re: [PATCH 08/22] m68k/mac: iop - Modernize printing of kernel  messages Finn Thain <fthain@telegraphics.com.au> - 2016-12-08 00:10 +0100
    [PATCH 17/22] m68k/kernel: Modernize printing of kernel messages Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-07 16:20 +0100

Page 1 of 2  [1] 2  Next page →


#1537812 — [PATCH 00/22] m68k: Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 00/22] m68k: Modernize printing of kernel messages
Message-ID<sLMaJ-1Ll-5@gated-at.bofh.it>
	Hi all,

This patch series modernizes the printing of kernel messages in the m68k
architecture core, which is mainly about converting from printk() to
pr_*().

The trigger for (finally) doing this was the user-visible breakage
caused by commit 4bcc595ccd80decb ("printk: reinstate KERN_CONT for
printing continuation lines").

I had hoped to sent this series much earlier, to be still included in
v4.9, but that didn't happen due to lack of time. Fortunately v4.9 will
be an LTS(I) kernel, so the first three patches (tagged with a "Fixes"
tag) will hopefully make it to v4.9.x later ;-)

Compile-tested with my standard set of configs.
Boot-tested on ARAnyM.

Thanks for your comments!

Geert Uytterhoeven (22):
  m68k/atari: Modernize printing of kernel messages
  m68k/mac: macints - Modernize printing of kernel messages
  m68k/mac: via - Modernize printing of kernel messages
  m68k/68000: Modernize printing of kernel messages
  m68k/bvme6000: Modernize printing of kernel messages
  m68k/coldfire: Modernize printing of kernel messages
  m68k/mac: baboon - Modernize printing of kernel messages
  m68k/mac: iop - Modernize printing of kernel messages
  m68k/mac: oss - Modernize printing of kernel messages
  m68k/mac: psc - Modernize printing of kernel messages
  m68k/mac: Modernize printing of kernel messages
  m68k/mvme147: Modernize printing of kernel messages
  m68k/mvme16x: Modernize printing of kernel messages
  m68k/q40: Modernize printing of kernel messages
  m68k/sun3: Modernize printing of kernel messages
  m68k/sun3x: Modernize printing of kernel messages
  m68k/kernel: Modernize printing of kernel messages
  m68k/mm: kmap - Modernize printing of kernel messages
  m68k/mm: motorola - Modernize printing of kernel messages
  m68k/mm: sun3 - Modernize printing of kernel messages
  m68k/mm: Modernize printing of kernel messages
  m68k/include: Modernize printing of kernel messages

 arch/m68k/68000/m68328.c                 |  6 +-
 arch/m68k/68000/m68EZ328.c               |  6 +-
 arch/m68k/68000/m68VZ328.c               |  6 +-
 arch/m68k/atari/atakeyb.c                | 14 ++---
 arch/m68k/atari/config.c                 | 56 +++++++++---------
 arch/m68k/bvme6000/config.c              |  8 +--
 arch/m68k/bvme6000/rtc.c                 |  2 +-
 arch/m68k/coldfire/m528x.c               |  4 +-
 arch/m68k/coldfire/sltimers.c            |  4 +-
 arch/m68k/coldfire/timers.c              |  4 +-
 arch/m68k/coldfire/vectors.c             |  2 +-
 arch/m68k/include/asm/bug.h              |  4 +-
 arch/m68k/include/asm/dma.h              | 98 +++++++++++---------------------
 arch/m68k/include/asm/floppy.h           |  6 +-
 arch/m68k/include/asm/math-emu.h         | 10 ++--
 arch/m68k/include/asm/mcf_pgtable.h      |  9 +--
 arch/m68k/include/asm/motorola_pgtable.h |  6 +-
 arch/m68k/include/asm/sun3_pgtable.h     |  6 +-
 arch/m68k/include/asm/sun3xflop.h        | 14 ++---
 arch/m68k/kernel/dma.c                   |  4 +-
 arch/m68k/kernel/module.c                | 12 ++--
 arch/m68k/kernel/process.c               | 20 +++----
 arch/m68k/kernel/signal.c                | 24 +++-----
 arch/m68k/kernel/uboot.c                 |  3 +-
 arch/m68k/mac/baboon.c                   | 22 ++++---
 arch/m68k/mac/config.c                   | 34 ++++++-----
 arch/m68k/mac/iop.c                      | 69 ++++++++++------------
 arch/m68k/mac/macints.c                  | 42 +++++++-------
 arch/m68k/mac/misc.c                     |  8 +--
 arch/m68k/mac/oss.c                      | 26 +++++----
 arch/m68k/mac/psc.c                      | 32 +++++------
 arch/m68k/mac/via.c                      | 54 +++++++++---------
 arch/m68k/mm/init.c                      |  2 +-
 arch/m68k/mm/kmap.c                      | 26 ++++-----
 arch/m68k/mm/memory.c                    |  4 +-
 arch/m68k/mm/motorola.c                  | 32 ++++-------
 arch/m68k/mm/sun3kmap.c                  |  5 +-
 arch/m68k/mvme147/config.c               |  2 +-
 arch/m68k/mvme16x/config.c               | 32 +++++------
 arch/m68k/mvme16x/rtc.c                  |  2 +-
 arch/m68k/q40/config.c                   | 14 ++---
 arch/m68k/q40/q40ints.c                  | 15 +++--
 arch/m68k/sun3/config.c                  |  2 +-
 arch/m68k/sun3/dvma.c                    |  3 +-
 arch/m68k/sun3/idprom.c                  |  8 ++-
 arch/m68k/sun3/mmu_emu.c                 | 47 +++++++--------
 arch/m68k/sun3/prom/printf.c             |  2 +-
 arch/m68k/sun3/sun3dvma.c                | 51 +++++++----------
 arch/m68k/sun3x/dvma.c                   | 35 +++++-------
 arch/m68k/sun3x/prom.c                   |  4 +-
 50 files changed, 412 insertions(+), 489 deletions(-)

-- 
1.9.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

[toc] | [next] | [standalone]


#1537813 — [PATCH 14/22] m68k/q40: Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 14/22] m68k/q40: Modernize printing of kernel messages
Message-ID<sLMaK-1Ll-17@gated-at.bofh.it>
In reply to#1537812
  - Convert from printk() to pr_*(),
  - Use TABs for indentation while at it.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/q40/config.c  | 14 +++++++-------
 arch/m68k/q40/q40ints.c | 15 +++++++++------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index ea89a24f46000e4f..71c0867ecf20f201 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -84,7 +84,7 @@ static int __init q40_debug_setup(char *arg)
 {
 	/* useful for early debugging stages - writes kernel messages into SRAM */
 	if (MACH_IS_Q40 && !strncmp(arg, "mem", 3)) {
-		/*printk("using NVRAM debug, q40_mem_cptr=%p\n",q40_mem_cptr);*/
+		/*pr_info("using NVRAM debug, q40_mem_cptr=%p\n",q40_mem_cptr);*/
 		_cpleft = 2000 - ((long)q40_mem_cptr-0xff020000) / 4;
 		register_console(&q40_console_driver);
 	}
@@ -124,8 +124,8 @@ static void q40_heartbeat(int on)
 
 static void q40_reset(void)
 {
-        halted = 1;
-        printk("\n\n*******************************************\n"
+	halted = 1;
+	pr_info("*******************************************\n"
 		"Called q40_reset : press the RESET button!!\n"
 		"*******************************************\n");
 	Q40_LED_ON();
@@ -135,10 +135,10 @@ static void q40_reset(void)
 
 static void q40_halt(void)
 {
-        halted = 1;
-        printk("\n\n*******************\n"
-		   "  Called q40_halt\n"
-		   "*******************\n");
+	halted = 1;
+	pr_info("*******************\n"
+		"  Called q40_halt\n"
+		"*******************\n");
 	Q40_LED_ON();
 	while (1)
 		;
diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c
index 513f9bb17b9cffe6..3e7603202977e715 100644
--- a/arch/m68k/q40/q40ints.c
+++ b/arch/m68k/q40/q40ints.c
@@ -48,7 +48,8 @@ static unsigned int q40_irq_startup(struct irq_data *data)
 	switch (irq) {
 	case 1: case 2: case 8: case 9:
 	case 11: case 12: case 13:
-		printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq);
+		pr_warn("%s: ISA IRQ %d not implemented by HW\n", __func__,
+			irq);
 		/* FIXME return -ENXIO; */
 	}
 	return 0;
@@ -250,7 +251,7 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp)
 					disable_irq(irq);
 					disabled = 1;
 #else
-					/*printk("IRQ_INPROGRESS detected for irq %d, disabling - %s disabled\n",
+					/*pr_warn("IRQ_INPROGRESS detected for irq %d, disabling - %s disabled\n",
 						irq, disabled ? "already" : "not yet"); */
 					fp->sr = (((fp->sr) & (~0x700))+0x200);
 					disabled = 1;
@@ -273,7 +274,7 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp)
 					}
 #else
 					disabled = 0;
-					/*printk("reenabling irq %d\n", irq); */
+					/*pr_info("reenabling irq %d\n", irq); */
 #endif
 				}
 // used to do 'goto repeat;' here, this delayed bh processing too long
@@ -281,7 +282,8 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp)
 			}
 		}
 		if (mer && ccleirq > 0 && !aliased_irq) {
-			printk("ISA interrupt from unknown source? EIRQ_REG = %x\n",mer);
+			pr_warn("ISA interrupt from unknown source? EIRQ_REG = %x\n",
+				mer);
 			ccleirq--;
 		}
 	}
@@ -301,7 +303,7 @@ void q40_irq_enable(struct irq_data *data)
 	if (irq >= 5 && irq <= 15) {
 		mext_disabled--;
 		if (mext_disabled > 0)
-			printk("q40_irq_enable : nested disable/enable\n");
+			pr_warn("q40_irq_enable : nested disable/enable\n");
 		if (mext_disabled == 0)
 			master_outb(1, EXT_ENABLE_REG);
 	}
@@ -321,6 +323,7 @@ void q40_irq_disable(struct irq_data *data)
 		master_outb(0, EXT_ENABLE_REG);
 		mext_disabled++;
 		if (mext_disabled > 1)
-			printk("disable_irq nesting count %d\n",mext_disabled);
+			pr_info("disable_irq nesting count %d\n",
+				mext_disabled);
 	}
 }
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1537814 — [PATCH 19/22] m68k/mm: motorola - Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 19/22] m68k/mm: motorola - Modernize printing of kernel messages
Message-ID<sLMaK-1Ll-33@gated-at.bofh.it>
In reply to#1537812
  - Convert from printk() to pr_*(),
  - Remove #undef DEBUG,
  - Add missing continuations.

Note that "#ifdef DEBUG" is sometimes retained because pr_cont() is not
optimized away when debugging is disabled.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/include/asm/motorola_pgtable.h |  6 +++---
 arch/m68k/mm/motorola.c                  | 32 ++++++++++++--------------------
 2 files changed, 15 insertions(+), 23 deletions(-)

diff --git a/arch/m68k/include/asm/motorola_pgtable.h b/arch/m68k/include/asm/motorola_pgtable.h
index 0085aab80e5a76aa..df651bdd5f21f3b7 100644
--- a/arch/m68k/include/asm/motorola_pgtable.h
+++ b/arch/m68k/include/asm/motorola_pgtable.h
@@ -153,11 +153,11 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
 #define pgd_page(pgd)		(mem_map + ((unsigned long)(__va(pgd_val(pgd)) - PAGE_OFFSET) >> PAGE_SHIFT))
 
 #define pte_ERROR(e) \
-	printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
+	pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
 #define pmd_ERROR(e) \
-	printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
+	pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
 #define pgd_ERROR(e) \
-	printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
+	pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
 
 
 /*
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 8f37fdd80be9e9cc..9f83a70c796c3303 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -32,8 +32,6 @@
 #endif
 #include <asm/sections.h>
 
-#undef DEBUG
-
 #ifndef mm_cachebits
 /*
  * Bits to add to page descriptors for "normal" caching mode.
@@ -86,9 +84,7 @@ static pmd_t * __init kernel_ptr_table(void)
 		}
 
 		last_pgtable = (pmd_t *)last;
-#ifdef DEBUG
-		printk("kernel_ptr_init: %p\n", last_pgtable);
-#endif
+		pr_debug("kernel_ptr_init: %p\n", last_pgtable);
 	}
 
 	last_pgtable += PTRS_PER_PMD;
@@ -124,7 +120,7 @@ static void __init map_node(int node)
 	while (size > 0) {
 #ifdef DEBUG
 		if (!(virtaddr & (PTRTREESIZE-1)))
-			printk ("\npa=%#lx va=%#lx ", physaddr & PAGE_MASK,
+			pr_cont("\npa=%#lx va=%#lx ", physaddr & PAGE_MASK,
 				virtaddr);
 #endif
 		pgd_dir = pgd_offset_k(virtaddr);
@@ -132,7 +128,7 @@ static void __init map_node(int node)
 			if (!(virtaddr & (ROOTTREESIZE-1)) &&
 			    size >= ROOTTREESIZE) {
 #ifdef DEBUG
-				printk ("[very early term]");
+				pr_cont("[very early term]");
 #endif
 				pgd_val(*pgd_dir) = physaddr;
 				size -= ROOTTREESIZE;
@@ -144,7 +140,7 @@ static void __init map_node(int node)
 		if (!pgd_present(*pgd_dir)) {
 			pmd_dir = kernel_ptr_table();
 #ifdef DEBUG
-			printk ("[new pointer %p]", pmd_dir);
+			pr_cont("[new pointer %p]", pmd_dir);
 #endif
 			pgd_set(pgd_dir, pmd_dir);
 		} else
@@ -153,14 +149,14 @@ static void __init map_node(int node)
 		if (CPU_IS_020_OR_030) {
 			if (virtaddr) {
 #ifdef DEBUG
-				printk ("[early term]");
+				pr_cont("[early term]");
 #endif
 				pmd_dir->pmd[(virtaddr/PTRTREESIZE) & 15] = physaddr;
 				physaddr += PTRTREESIZE;
 			} else {
 				int i;
 #ifdef DEBUG
-				printk ("[zero map]");
+				pr_cont("[zero map]");
 #endif
 				zero_pgtable = kernel_ptr_table();
 				pte_dir = (pte_t *)zero_pgtable;
@@ -176,7 +172,7 @@ static void __init map_node(int node)
 		} else {
 			if (!pmd_present(*pmd_dir)) {
 #ifdef DEBUG
-				printk ("[new table]");
+				pr_cont("[new table]");
 #endif
 				pte_dir = kernel_page_table();
 				pmd_set(pmd_dir, pte_dir);
@@ -195,7 +191,7 @@ static void __init map_node(int node)
 
 	}
 #ifdef DEBUG
-	printk("\n");
+	pr_cont("\n");
 #endif
 }
 
@@ -210,9 +206,7 @@ void __init paging_init(void)
 	unsigned long addr, size, end;
 	int i;
 
-#ifdef DEBUG
-	printk ("start of paging_init (%p, %lx)\n", kernel_pg_dir, availmem);
-#endif
+	pr_debug("start of paging_init (%p, %lx)\n", kernel_pg_dir, availmem);
 
 	/* Fix the cache mode in the page descriptors for the 680[46]0.  */
 	if (CPU_IS_040_OR_060) {
@@ -228,9 +222,9 @@ void __init paging_init(void)
 	max_addr = min_addr + m68k_memory[0].size;
 	for (i = 1; i < m68k_num_memory;) {
 		if (m68k_memory[i].addr < min_addr) {
-			printk("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n",
+			pr_warn("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n",
 				m68k_memory[i].addr, m68k_memory[i].size);
-			printk("Fix your bootloader or use a memfile to make use of this area!\n");
+			pr_warn("Fix your bootloader or use a memfile to make use of this area!\n");
 			m68k_num_memory--;
 			memmove(m68k_memory + i, m68k_memory + i + 1,
 				(m68k_num_memory - i) * sizeof(struct m68k_mem_info));
@@ -294,9 +288,7 @@ void __init paging_init(void)
 	 */
 	set_fs(KERNEL_DS);
 
-#ifdef DEBUG
-	printk ("before free_area_init\n");
-#endif
+	pr_debug("before free_area_init\n");
 	for (i = 0; i < m68k_num_memory; i++) {
 		zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
 		free_area_init_node(i, zones_size,
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1537815 — [PATCH 04/22] m68k/68000: Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 04/22] m68k/68000: Modernize printing of kernel messages
Message-ID<sLMaK-1Ll-39@gated-at.bofh.it>
In reply to#1537812
Convert from printk() to pr_*().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/68000/m68328.c   | 6 +++---
 arch/m68k/68000/m68EZ328.c | 6 +++---
 arch/m68k/68000/m68VZ328.c | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/m68k/68000/m68328.c b/arch/m68k/68000/m68328.c
index e53caf4c3bfbf9d1..419751b15ec8b5f1 100644
--- a/arch/m68k/68000/m68328.c
+++ b/arch/m68k/68000/m68328.c
@@ -45,9 +45,9 @@ void m68328_reset (void)
 
 void __init config_BSP(char *command, int len)
 {
-  printk(KERN_INFO "\n68328 support D. Jeff Dionne <jeff@uclinux.org>\n");
-  printk(KERN_INFO "68328 support Kenneth Albanowski <kjahds@kjshds.com>\n");
-  printk(KERN_INFO "68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n");
+  pr_info("68328 support D. Jeff Dionne <jeff@uclinux.org>\n");
+  pr_info("68328 support Kenneth Albanowski <kjahds@kjshds.com>\n");
+  pr_info("68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n");
 
   mach_hwclk = m68328_hwclk;
   mach_reset = m68328_reset;
diff --git a/arch/m68k/68000/m68EZ328.c b/arch/m68k/68000/m68EZ328.c
index e6ab321f93f832e9..6a309a3cfbfc1953 100644
--- a/arch/m68k/68000/m68EZ328.c
+++ b/arch/m68k/68000/m68EZ328.c
@@ -57,12 +57,12 @@ void __init config_BSP(char *command, int len)
 {
   unsigned char *p;
 
-  printk(KERN_INFO "\n68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n");
+  pr_info("68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n");
 
 #ifdef CONFIG_UCSIMM
-  printk(KERN_INFO "uCsimm serial string [%s]\n",getserialnum());
+  pr_info("uCsimm serial string [%s]\n", getserialnum());
   p = cs8900a_hwaddr = gethwaddr(0);
-  printk(KERN_INFO "uCsimm hwaddr %pM\n", p);
+  pr_info("uCsimm hwaddr %pM\n", p);
 
   p = getbenv("APPEND");
   if (p) strcpy(p,command);
diff --git a/arch/m68k/68000/m68VZ328.c b/arch/m68k/68000/m68VZ328.c
index 1154bdb220a022cd..81b5491685a4a2ab 100644
--- a/arch/m68k/68000/m68VZ328.c
+++ b/arch/m68k/68000/m68VZ328.c
@@ -150,9 +150,9 @@ static void __init init_hardware(char *command, int size)
 {
 	char *p;
 
-	printk(KERN_INFO "uCdimm serial string [%s]\n", getserialnum());
+	pr_info("uCdimm serial string [%s]\n", getserialnum());
 	p = cs8900a_hwaddr = gethwaddr(0);
-	printk(KERN_INFO "uCdimm hwaddr %pM\n", p);
+	pr_info("uCdimm hwaddr %pM\n", p);
 	p = getbenv("APPEND");
 	if (p)
 		strcpy(p, command);
@@ -177,7 +177,7 @@ static void __init init_hardware(char *command, int size)
 
 void __init config_BSP(char *command, int size)
 {
-	printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
+	pr_info("68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
 
 	init_hardware(command, size);
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1539311 — Re: [PATCH 04/22] m68k/68000: Modernize printing of kernel messages

FromGreg Ungerer <gerg@linux-m68k.org>
Date2016-12-09 13:20 +0100
SubjectRe: [PATCH 04/22] m68k/68000: Modernize printing of kernel messages
Message-ID<sMsjD-38t-1@gated-at.bofh.it>
In reply to#1537815
Hi Geert,

On 08/12/16 01:09, Geert Uytterhoeven wrote:
> Convert from printk() to pr_*().
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Looks good to me, so:

Acked-by: Greg Ungerer <gerg@linux-m68k.org>

Regards
Greg



> ---
>  arch/m68k/68000/m68328.c   | 6 +++---
>  arch/m68k/68000/m68EZ328.c | 6 +++---
>  arch/m68k/68000/m68VZ328.c | 6 +++---
>  3 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/arch/m68k/68000/m68328.c b/arch/m68k/68000/m68328.c
> index e53caf4c3bfbf9d1..419751b15ec8b5f1 100644
> --- a/arch/m68k/68000/m68328.c
> +++ b/arch/m68k/68000/m68328.c
> @@ -45,9 +45,9 @@ void m68328_reset (void)
>
>  void __init config_BSP(char *command, int len)
>  {
> -  printk(KERN_INFO "\n68328 support D. Jeff Dionne <jeff@uclinux.org>\n");
> -  printk(KERN_INFO "68328 support Kenneth Albanowski <kjahds@kjshds.com>\n");
> -  printk(KERN_INFO "68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n");
> +  pr_info("68328 support D. Jeff Dionne <jeff@uclinux.org>\n");
> +  pr_info("68328 support Kenneth Albanowski <kjahds@kjshds.com>\n");
> +  pr_info("68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n");
>
>    mach_hwclk = m68328_hwclk;
>    mach_reset = m68328_reset;
> diff --git a/arch/m68k/68000/m68EZ328.c b/arch/m68k/68000/m68EZ328.c
> index e6ab321f93f832e9..6a309a3cfbfc1953 100644
> --- a/arch/m68k/68000/m68EZ328.c
> +++ b/arch/m68k/68000/m68EZ328.c
> @@ -57,12 +57,12 @@ void __init config_BSP(char *command, int len)
>  {
>    unsigned char *p;
>
> -  printk(KERN_INFO "\n68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n");
> +  pr_info("68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n");
>
>  #ifdef CONFIG_UCSIMM
> -  printk(KERN_INFO "uCsimm serial string [%s]\n",getserialnum());
> +  pr_info("uCsimm serial string [%s]\n", getserialnum());
>    p = cs8900a_hwaddr = gethwaddr(0);
> -  printk(KERN_INFO "uCsimm hwaddr %pM\n", p);
> +  pr_info("uCsimm hwaddr %pM\n", p);
>
>    p = getbenv("APPEND");
>    if (p) strcpy(p,command);
> diff --git a/arch/m68k/68000/m68VZ328.c b/arch/m68k/68000/m68VZ328.c
> index 1154bdb220a022cd..81b5491685a4a2ab 100644
> --- a/arch/m68k/68000/m68VZ328.c
> +++ b/arch/m68k/68000/m68VZ328.c
> @@ -150,9 +150,9 @@ static void __init init_hardware(char *command, int size)
>  {
>  	char *p;
>
> -	printk(KERN_INFO "uCdimm serial string [%s]\n", getserialnum());
> +	pr_info("uCdimm serial string [%s]\n", getserialnum());
>  	p = cs8900a_hwaddr = gethwaddr(0);
> -	printk(KERN_INFO "uCdimm hwaddr %pM\n", p);
> +	pr_info("uCdimm hwaddr %pM\n", p);
>  	p = getbenv("APPEND");
>  	if (p)
>  		strcpy(p, command);
> @@ -177,7 +177,7 @@ static void __init init_hardware(char *command, int size)
>
>  void __init config_BSP(char *command, int size)
>  {
> -	printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
> +	pr_info("68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
>
>  	init_hardware(command, size);
>
>

[toc] | [prev] | [next] | [standalone]


#1537816 — [PATCH 15/22] m68k/sun3: Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 15/22] m68k/sun3: Modernize printing of kernel messages
Message-ID<sLMaK-1Ll-41@gated-at.bofh.it>
In reply to#1537812
  - Convert from printk() to pr_*(),
  - Add missing continuations,
  - Do not print nonexistent len variable,
  - Add missing sysname[] variable,
  - Correct printf()-style format specifiers.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/sun3/config.c      |  2 +-
 arch/m68k/sun3/dvma.c        |  3 +--
 arch/m68k/sun3/idprom.c      |  8 ++++---
 arch/m68k/sun3/mmu_emu.c     | 47 ++++++++++++++++++++--------------------
 arch/m68k/sun3/prom/printf.c |  2 +-
 arch/m68k/sun3/sun3dvma.c    | 51 +++++++++++++++++++-------------------------
 6 files changed, 54 insertions(+), 59 deletions(-)

diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index 3af34fa3a344ba85..1d28d380e8cc1037 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -134,7 +134,7 @@ void __init config_sun3(void)
 {
 	unsigned long memory_start, memory_end;
 
-	printk("ARCH: SUN3\n");
+	pr_info("ARCH: SUN3\n");
 	idprom_init();
 
 	/* Subtract kernel memory from available memory */
diff --git a/arch/m68k/sun3/dvma.c b/arch/m68k/sun3/dvma.c
index d95506e06c2ac42b..ca02ee25894cc4a5 100644
--- a/arch/m68k/sun3/dvma.c
+++ b/arch/m68k/sun3/dvma.c
@@ -31,8 +31,7 @@ static unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr)
 
 	ptep = pfn_pte(virt_to_pfn(kaddr), PAGE_KERNEL);
 	pte = pte_val(ptep);
-//		printk("dvma_remap: addr %lx -> %lx pte %08lx len %x\n",
-//		       kaddr, vaddr, pte, len);
+//	pr_info("dvma_remap: addr %lx -> %lx pte %08lx\n", kaddr, vaddr, pte);
 	if(ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] != pte) {
 		sun3_put_pte(vaddr, pte);
 		ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] = pte;
diff --git a/arch/m68k/sun3/idprom.c b/arch/m68k/sun3/idprom.c
index cfe9aa4223431764..9c23f506d60df450 100644
--- a/arch/m68k/sun3/idprom.c
+++ b/arch/m68k/sun3/idprom.c
@@ -64,12 +64,14 @@ static void __init display_system_type(unsigned char machtype)
 	for (i = 0; i < NUM_SUN_MACHINES; i++) {
 		if(Sun_Machines[i].id_machtype == machtype) {
 			if (machtype != (SM_SUN4M_OBP | 0x00))
-				printk("TYPE: %s\n", Sun_Machines[i].name);
+				pr_info("TYPE: %s\n", Sun_Machines[i].name);
 			else {
 #if 0
+				char sysname[128];
+
 				prom_getproperty(prom_root_node, "banner-name",
 						 sysname, sizeof(sysname));
-				printk("TYPE: %s\n", sysname);
+				pr_info("TYPE: %s\n", sysname);
 #endif
 			}
 			return;
@@ -125,5 +127,5 @@ void __init idprom_init(void)
 
 	display_system_type(idprom->id_machtype);
 
-	printk("Ethernet address: %pM\n", idprom->id_ethaddr);
+	pr_info("Ethernet address: %pM\n", idprom->id_ethaddr);
 }
diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c
index 3f258e230ba5d0c9..fc672c74ede7b155 100644
--- a/arch/m68k/sun3/mmu_emu.c
+++ b/arch/m68k/sun3/mmu_emu.c
@@ -72,21 +72,21 @@ void print_pte (pte_t pte)
 #if 0
 	/* Verbose version. */
 	unsigned long val = pte_val (pte);
-	printk (" pte=%lx [addr=%lx",
+	pr_cont(" pte=%lx [addr=%lx",
 		val, (val & SUN3_PAGE_PGNUM_MASK) << PAGE_SHIFT);
-	if (val & SUN3_PAGE_VALID)	printk (" valid");
-	if (val & SUN3_PAGE_WRITEABLE)	printk (" write");
-	if (val & SUN3_PAGE_SYSTEM)	printk (" sys");
-	if (val & SUN3_PAGE_NOCACHE)	printk (" nocache");
-	if (val & SUN3_PAGE_ACCESSED)	printk (" accessed");
-	if (val & SUN3_PAGE_MODIFIED)	printk (" modified");
+	if (val & SUN3_PAGE_VALID)	pr_cont(" valid");
+	if (val & SUN3_PAGE_WRITEABLE)	pr_cont(" write");
+	if (val & SUN3_PAGE_SYSTEM)	pr_cont(" sys");
+	if (val & SUN3_PAGE_NOCACHE)	pr_cont(" nocache");
+	if (val & SUN3_PAGE_ACCESSED)	pr_cont(" accessed");
+	if (val & SUN3_PAGE_MODIFIED)	pr_cont(" modified");
 	switch (val & SUN3_PAGE_TYPE_MASK) {
-		case SUN3_PAGE_TYPE_MEMORY: printk (" memory"); break;
-		case SUN3_PAGE_TYPE_IO:     printk (" io");     break;
-		case SUN3_PAGE_TYPE_VME16:  printk (" vme16");  break;
-		case SUN3_PAGE_TYPE_VME32:  printk (" vme32");  break;
+		case SUN3_PAGE_TYPE_MEMORY: pr_cont(" memory"); break;
+		case SUN3_PAGE_TYPE_IO:     pr_cont(" io");     break;
+		case SUN3_PAGE_TYPE_VME16:  pr_cont(" vme16");  break;
+		case SUN3_PAGE_TYPE_VME32:  pr_cont(" vme32");  break;
 	}
-	printk ("]\n");
+	pr_cont("]\n");
 #else
 	/* Terse version. More likely to fit on a line. */
 	unsigned long val = pte_val (pte);
@@ -108,7 +108,7 @@ void print_pte (pte_t pte)
 		default: type = "unknown?"; break;
 	}
 
-	printk (" pte=%08lx [%07lx %s %s]\n",
+	pr_cont(" pte=%08lx [%07lx %s %s]\n",
 		val, (val & SUN3_PAGE_PGNUM_MASK) << PAGE_SHIFT, flags, type);
 #endif
 }
@@ -116,7 +116,7 @@ void print_pte (pte_t pte)
 /* Print the PTE value for a given virtual address. For debugging. */
 void print_pte_vaddr (unsigned long vaddr)
 {
-	printk (" vaddr=%lx [%02lx]", vaddr, sun3_get_segmap (vaddr));
+	pr_cont(" vaddr=%lx [%02lx]", vaddr, sun3_get_segmap (vaddr));
 	print_pte (__pte (sun3_get_pte (vaddr)));
 }
 
@@ -153,7 +153,7 @@ void __init mmu_emu_init(unsigned long bootmem_end)
 
 		if(!pmeg_alloc[i]) {
 #ifdef DEBUG_MMU_EMU
-			printk("freed: ");
+			pr_info("freed:");
 			print_pte_vaddr (seg);
 #endif
 			sun3_put_segmap(seg, SUN3_INVALID_PMEG);
@@ -165,7 +165,7 @@ void __init mmu_emu_init(unsigned long bootmem_end)
 		if (sun3_get_segmap (seg) != SUN3_INVALID_PMEG) {
 #ifdef DEBUG_PROM_MAPS
 			for(i = 0; i < 16; i++) {
-				printk ("mapped:");
+				pr_info("mapped:");
 				print_pte_vaddr (seg + (i*PAGE_SIZE));
 				break;
 			}
@@ -293,8 +293,8 @@ inline void mmu_emu_map_pmeg (int context, int vaddr)
 
 
 #ifdef DEBUG_MMU_EMU
-printk("mmu_emu_map_pmeg: pmeg %x to context %d vaddr %x\n",
-       curr_pmeg, context, vaddr);
+	pr_info("mmu_emu_map_pmeg: pmeg %x to context %d vaddr %x\n",
+		curr_pmeg, context, vaddr);
 #endif
 
 	/* Invalidate old mapping for the pmeg, if any */
@@ -370,7 +370,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 	}
 
 #ifdef DEBUG_MMU_EMU
-	printk ("mmu_emu_handle_fault: vaddr=%lx type=%s crp=%p\n",
+	pr_info("mmu_emu_handle_fault: vaddr=%lx type=%s crp=%p\n",
 		vaddr, read_flag ? "read" : "write", crp);
 #endif
 
@@ -378,14 +378,15 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 	offset  = (vaddr >> SUN3_PTE_SIZE_BITS) & 0xF;
 
 #ifdef DEBUG_MMU_EMU
-	printk ("mmu_emu_handle_fault: segment=%lx offset=%lx\n", segment, offset);
+	pr_info("mmu_emu_handle_fault: segment=%lx offset=%lx\n", segment,
+		offset);
 #endif
 
 	pte = (pte_t *) pgd_val (*(crp + segment));
 
 //todo: next line should check for valid pmd properly.
 	if (!pte) {
-//                printk ("mmu_emu_handle_fault: invalid pmd\n");
+//                pr_info("mmu_emu_handle_fault: invalid pmd\n");
                 return 0;
         }
 
@@ -417,9 +418,9 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 		pte_val (*pte) |= SUN3_PAGE_ACCESSED;
 
 #ifdef DEBUG_MMU_EMU
-	printk ("seg:%d crp:%p ->", get_fs().seg, crp);
+	pr_info("seg:%ld crp:%p ->", get_fs().seg, crp);
 	print_pte_vaddr (vaddr);
-	printk ("\n");
+	pr_cont("\n");
 #endif
 
 	return 1;
diff --git a/arch/m68k/sun3/prom/printf.c b/arch/m68k/sun3/prom/printf.c
index df85018f487ac1a5..5b82bea03493e8e3 100644
--- a/arch/m68k/sun3/prom/printf.c
+++ b/arch/m68k/sun3/prom/printf.c
@@ -39,7 +39,7 @@
 
 #ifdef CONFIG_KGDB
 	if (kgdb_initialized) {
-		printk("kgdb_initialized = %d\n", kgdb_initialized);
+		pr_info("kgdb_initialized = %d\n", kgdb_initialized);
 		putpacket(bptr, 1);
 	} else
 #else
diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c
index b37521a5259ddb7a..d36bd15f9fdcda46 100644
--- a/arch/m68k/sun3/sun3dvma.c
+++ b/arch/m68k/sun3/sun3dvma.c
@@ -62,7 +62,7 @@ static void print_use(void)
 	int i;
 	int j = 0;
 
-	printk("dvma entry usage:\n");
+	pr_info("dvma entry usage:\n");
 
 	for(i = 0; i < IOMMU_TOTAL_ENTRIES; i++) {
 		if(!iommu_use[i])
@@ -70,16 +70,15 @@ static void print_use(void)
 
 		j++;
 
-		printk("dvma entry: %08lx len %08lx\n",
-		       ( i << DVMA_PAGE_SHIFT) + DVMA_START,
-		       iommu_use[i]);
+		pr_info("dvma entry: %08x len %08lx\n",
+			(i << DVMA_PAGE_SHIFT) + DVMA_START, iommu_use[i]);
 	}
 
-	printk("%d entries in use total\n", j);
+	pr_info("%d entries in use total\n", j);
 
-	printk("allocation/free calls: %lu/%lu\n", dvma_allocs, dvma_frees);
-	printk("allocation/free bytes: %Lx/%Lx\n", dvma_alloc_bytes,
-	       dvma_free_bytes);
+	pr_info("allocation/free calls: %lu/%lu\n", dvma_allocs, dvma_frees);
+	pr_info("allocation/free bytes: %Lx/%Lx\n", dvma_alloc_bytes,
+		dvma_free_bytes);
 }
 
 static void print_holes(struct list_head *holes)
@@ -88,18 +87,18 @@ static void print_holes(struct list_head *holes)
 	struct list_head *cur;
 	struct hole *hole;
 
-	printk("listing dvma holes\n");
+	pr_info("listing dvma holes\n");
 	list_for_each(cur, holes) {
 		hole = list_entry(cur, struct hole, list);
 
 		if((hole->start == 0) && (hole->end == 0) && (hole->size == 0))
 			continue;
 
-		printk("hole: start %08lx end %08lx size %08lx\n", hole->start, hole->end, hole->size);
+		pr_info("hole: start %08lx end %08lx size %08lx\n",
+			hole->start, hole->end, hole->size);
 	}
 
-	printk("end of hole listing...\n");
-
+	pr_info("end of hole listing...\n");
 }
 #endif /* DVMA_DEBUG */
 
@@ -137,7 +136,7 @@ static inline struct hole *rmcache(void)
 
 	if(list_empty(&hole_cache)) {
 		if(!refill()) {
-			printk("out of dvma hole cache!\n");
+			pr_crit("out of dvma hole cache!\n");
 			BUG();
 		}
 	}
@@ -157,7 +156,7 @@ static inline unsigned long get_baddr(int len, unsigned long align)
 
 	if(list_empty(&hole_list)) {
 #ifdef DVMA_DEBUG
-		printk("out of dvma holes! (printing hole cache)\n");
+		pr_crit("out of dvma holes! (printing hole cache)\n");
 		print_holes(&hole_cache);
 		print_use();
 #endif
@@ -195,7 +194,7 @@ static inline unsigned long get_baddr(int len, unsigned long align)
 
 	}
 
-	printk("unable to find dvma hole!\n");
+	pr_crit("unable to find dvma hole!\n");
 	BUG();
 	return 0;
 }
@@ -287,15 +286,12 @@ unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
 		len = 0x800;
 
 	if(!kaddr || !len) {
-//		printk("error: kaddr %lx len %x\n", kaddr, len);
+//		pr_err("error: kaddr %lx len %x\n", kaddr, len);
 //		*(int *)4 = 0;
 		return 0;
 	}
 
-#ifdef DEBUG
-	printk("dvma_map request %08lx bytes from %08lx\n",
-	       len, kaddr);
-#endif
+	pr_debug("dvma_map request %08x bytes from %08lx\n", len, kaddr);
 	off = kaddr & ~DVMA_PAGE_MASK;
 	kaddr &= PAGE_MASK;
 	len += off;
@@ -307,12 +303,13 @@ unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
 		align = ((align + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK);
 
 	baddr = get_baddr(len, align);
-//	printk("using baddr %lx\n", baddr);
+//	pr_info("using baddr %lx\n", baddr);
 
 	if(!dvma_map_iommu(kaddr, baddr, len))
 		return (baddr + off);
 
-	printk("dvma_map failed kaddr %lx baddr %lx len %x\n", kaddr, baddr, len);
+	pr_crit("dvma_map failed kaddr %lx baddr %lx len %x\n", kaddr, baddr,
+	len);
 	BUG();
 	return 0;
 }
@@ -343,9 +340,7 @@ void *dvma_malloc_align(unsigned long len, unsigned long align)
 	if(!len)
 		return NULL;
 
-#ifdef DEBUG
-	printk("dvma_malloc request %lx bytes\n", len);
-#endif
+	pr_debug("dvma_malloc request %lx bytes\n", len);
 	len = ((len + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK);
 
         if((kaddr = __get_free_pages(GFP_ATOMIC, get_order(len))) == 0)
@@ -364,10 +359,8 @@ void *dvma_malloc_align(unsigned long len, unsigned long align)
 		return NULL;
 	}
 
-#ifdef DEBUG
-	printk("mapped %08lx bytes %08lx kern -> %08lx bus\n",
-	       len, kaddr, baddr);
-#endif
+	pr_debug("mapped %08lx bytes %08lx kern -> %08lx bus\n", len, kaddr,
+		 baddr);
 
 	return (void *)vaddr;
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1537817 — [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages
Message-ID<sLMaK-1Ll-37@gated-at.bofh.it>
In reply to#1537812
  - Introduce helpers for printing debug messages, incl. dummies for
    validating format strings when debugging is disabled,
  - Convert from printk() to pr_*(),
  - Add missing continuations, to fix user-visible breakage.

Fixes: 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/mac/macints.c | 42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index 9f98c08719010e27..8572290cb93b6679 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -135,6 +135,11 @@
 irqreturn_t mac_debug_handler(int, void *);
 
 /* #define DEBUG_MACINTS */
+#ifdef DEBUG_MACINTS
+#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
 
 static unsigned int mac_irq_startup(struct irq_data *);
 static void mac_irq_shutdown(struct irq_data *);
@@ -149,20 +154,18 @@
 
 void __init mac_init_IRQ(void)
 {
-#ifdef DEBUG_MACINTS
-	printk("mac_init_IRQ(): Setting things up...\n");
-#endif
+	pr_irq("mac_init_IRQ(): Setting things up...\n");
 	m68k_setup_irq_controller(&mac_irq_chip, handle_simple_irq, IRQ_USER,
 				  NUM_MAC_SOURCES - IRQ_USER);
 	/* Make sure the SONIC interrupt is cleared or things get ugly */
 #ifdef SHUTUP_SONIC
-	printk("Killing onboard sonic... ");
+	pr_info("Killing onboard sonic... ");
 	/* This address should hopefully be mapped already */
 	if (hwreg_present((void*)(0x50f0a000))) {
 		*(long *)(0x50f0a014) = 0x7fffL;
 		*(long *)(0x50f0a010) = 0L;
 	}
-	printk("Done.\n");
+	pr_cont("Done.\n");
 #endif /* SHUTUP_SONIC */
 
 	/*
@@ -182,9 +185,7 @@ void __init mac_init_IRQ(void)
 	if (request_irq(IRQ_AUTO_7, mac_nmi_handler, 0, "NMI",
 			mac_nmi_handler))
 		pr_err("Couldn't register NMI\n");
-#ifdef DEBUG_MACINTS
-	printk("mac_init_IRQ(): Done!\n");
-#endif
+	pr_irq("mac_init_IRQ(): Done!\n");
 }
 
 /*
@@ -281,7 +282,7 @@ static void mac_irq_shutdown(struct irq_data *data)
 irqreturn_t mac_debug_handler(int irq, void *dev_id)
 {
 	if (num_debug[irq] < 10) {
-		printk("DEBUG: Unexpected IRQ %d\n", irq);
+		pr_info("DEBUG: Unexpected IRQ %d\n", irq);
 		num_debug[irq]++;
 	}
 	return IRQ_HANDLED;
@@ -304,9 +305,9 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)
 
 	if (in_nmi == 1) {
 		nmi_hold = 1;
-		printk("... pausing, press NMI to resume ...");
+		pr_info("... pausing, press NMI to resume ...");
 	} else {
-		printk(" ok!\n");
+		pr_cont(" ok!\n");
 		nmi_hold = 0;
 	}
 
@@ -319,20 +320,21 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)
 #if 0
 		struct pt_regs *fp = get_irq_regs();
 		show_state();
-		printk("PC: %08lx\nSR: %04x  SP: %p\n", fp->pc, fp->sr, fp);
-		printk("d0: %08lx    d1: %08lx    d2: %08lx    d3: %08lx\n",
-		       fp->d0, fp->d1, fp->d2, fp->d3);
-		printk("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
-		       fp->d4, fp->d5, fp->a0, fp->a1);
+		pr_info("PC: %08lx\nSR: %04x  SP: %p\n", fp->pc, fp->sr, fp);
+		pr_info("d0: %08lx    d1: %08lx    d2: %08lx    d3: %08lx\n",
+			fp->d0, fp->d1, fp->d2, fp->d3);
+		pr_info("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
+			fp->d4, fp->d5, fp->a0, fp->a1);
 
 		if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page)
-			printk("Corrupted stack page\n");
-		printk("Process %s (pid: %d, stackpage=%08lx)\n",
-			current->comm, current->pid, current->kernel_stack_page);
+			pr_info("Corrupted stack page\n");
+		pr_info("Process %s (pid: %d, stackpage=%08lx)\n",
+			current->comm, current->pid,
+			current->kernel_stack_page);
 		if (intr_count == 1)
 			dump_stack((struct frame *)fp);
 #else
-		/* printk("NMI "); */
+		/* pr_info("NMI "); */
 #endif
 	}
 	in_nmi--;
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1538131 — Re: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages

FromFinn Thain <fthain@telegraphics.com.au>
Date2016-12-07 23:50 +0100
SubjectRe: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages
Message-ID<sLTcd-6aD-7@gated-at.bofh.it>
In reply to#1537817
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_*(),
>   - Add missing continuations, to fix user-visible breakage.
> 
> Fixes: 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  arch/m68k/mac/macints.c | 42 ++++++++++++++++++++++--------------------
>  1 file changed, 22 insertions(+), 20 deletions(-)
> 
> diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
> index 9f98c08719010e27..8572290cb93b6679 100644
> --- a/arch/m68k/mac/macints.c
> +++ b/arch/m68k/mac/macints.c
> @@ -135,6 +135,11 @@
>  irqreturn_t mac_debug_handler(int, void *);
>  
>  /* #define DEBUG_MACINTS */
> +#ifdef DEBUG_MACINTS
> +#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
>  
>  static unsigned int mac_irq_startup(struct irq_data *);
>  static void mac_irq_shutdown(struct irq_data *);

I would prefer to delete all the DEBUG_MACINTS clutter.


> @@ -149,20 +154,18 @@
>  
>  void __init mac_init_IRQ(void)
>  {
> -#ifdef DEBUG_MACINTS
> -	printk("mac_init_IRQ(): Setting things up...\n");
> -#endif
> +	pr_irq("mac_init_IRQ(): Setting things up...\n");
>  	m68k_setup_irq_controller(&mac_irq_chip, handle_simple_irq, IRQ_USER,
>  				  NUM_MAC_SOURCES - IRQ_USER);
>  	/* Make sure the SONIC interrupt is cleared or things get ugly */
>  #ifdef SHUTUP_SONIC
> -	printk("Killing onboard sonic... ");
> +	pr_info("Killing onboard sonic... ");
>  	/* This address should hopefully be mapped already */
>  	if (hwreg_present((void*)(0x50f0a000))) {
>  		*(long *)(0x50f0a014) = 0x7fffL;
>  		*(long *)(0x50f0a010) = 0L;
>  	}
> -	printk("Done.\n");
> +	pr_cont("Done.\n");
>  #endif /* SHUTUP_SONIC */
>  
>  	/*
> @@ -182,9 +185,7 @@ void __init mac_init_IRQ(void)
>  	if (request_irq(IRQ_AUTO_7, mac_nmi_handler, 0, "NMI",
>  			mac_nmi_handler))
>  		pr_err("Couldn't register NMI\n");
> -#ifdef DEBUG_MACINTS
> -	printk("mac_init_IRQ(): Done!\n");
> -#endif
> +	pr_irq("mac_init_IRQ(): Done!\n");
>  }
>  
>  /*
> @@ -281,7 +282,7 @@ static void mac_irq_shutdown(struct irq_data *data)
>  irqreturn_t mac_debug_handler(int irq, void *dev_id)
>  {
>  	if (num_debug[irq] < 10) {
> -		printk("DEBUG: Unexpected IRQ %d\n", irq);
> +		pr_info("DEBUG: Unexpected IRQ %d\n", irq);
>  		num_debug[irq]++;
>  	}
>  	return IRQ_HANDLED;

Is this dead code?


> @@ -304,9 +305,9 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)
>  
>  	if (in_nmi == 1) {
>  		nmi_hold = 1;
> -		printk("... pausing, press NMI to resume ...");
> +		pr_info("... pausing, press NMI to resume ...");
>  	} else {
> -		printk(" ok!\n");
> +		pr_cont(" ok!\n");
>  		nmi_hold = 0;
>  	}
>  
> @@ -319,20 +320,21 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)
>  #if 0
>  		struct pt_regs *fp = get_irq_regs();
>  		show_state();
> -		printk("PC: %08lx\nSR: %04x  SP: %p\n", fp->pc, fp->sr, fp);
> -		printk("d0: %08lx    d1: %08lx    d2: %08lx    d3: %08lx\n",
> -		       fp->d0, fp->d1, fp->d2, fp->d3);
> -		printk("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
> -		       fp->d4, fp->d5, fp->a0, fp->a1);
> +		pr_info("PC: %08lx\nSR: %04x  SP: %p\n", fp->pc, fp->sr, fp);
> +		pr_info("d0: %08lx    d1: %08lx    d2: %08lx    d3: %08lx\n",
> +			fp->d0, fp->d1, fp->d2, fp->d3);
> +		pr_info("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
> +			fp->d4, fp->d5, fp->a0, fp->a1);
>  
>  		if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page)
> -			printk("Corrupted stack page\n");
> -		printk("Process %s (pid: %d, stackpage=%08lx)\n",
> -			current->comm, current->pid, current->kernel_stack_page);
> +			pr_info("Corrupted stack page\n");
> +		pr_info("Process %s (pid: %d, stackpage=%08lx)\n",
> +			current->comm, current->pid,
> +			current->kernel_stack_page);
>  		if (intr_count == 1)
>  			dump_stack((struct frame *)fp);
>  #else
> -		/* printk("NMI "); */
> +		/* pr_info("NMI "); */
>  #endif
>  	}
>  	in_nmi--;
> 

I think it would be good to use pr_debug here instead of #if 0. But that 
will probably break the build... better ignore the #if 0 section for this 
series, until I put together a different patch?

-- 

[toc] | [prev] | [next] | [standalone]


#1538483 — Re: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-08 13:30 +0100
SubjectRe: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages
Message-ID<sM5ZM-65C-19@gated-at.bofh.it>
In reply to#1538131
On Wed, Dec 7, 2016 at 11:45 PM, Finn Thain <fthain@telegraphics.com.au> wrote:
> 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_*(),
>>   - Add missing continuations, to fix user-visible breakage.
>>
>> Fixes: 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> ---
>>  arch/m68k/mac/macints.c | 42 ++++++++++++++++++++++--------------------
>>  1 file changed, 22 insertions(+), 20 deletions(-)
>>
>> diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
>> index 9f98c08719010e27..8572290cb93b6679 100644
>> --- a/arch/m68k/mac/macints.c
>> +++ b/arch/m68k/mac/macints.c
>> @@ -135,6 +135,11 @@
>>  irqreturn_t mac_debug_handler(int, void *);
>>
>>  /* #define DEBUG_MACINTS */
>> +#ifdef DEBUG_MACINTS
>> +#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
>>
>>  static unsigned int mac_irq_startup(struct irq_data *);
>>  static void mac_irq_shutdown(struct irq_data *);
>
> I would prefer to delete all the DEBUG_MACINTS clutter.

OK, can do that.

>> @@ -281,7 +282,7 @@ static void mac_irq_shutdown(struct irq_data *data)
>>  irqreturn_t mac_debug_handler(int irq, void *dev_id)
>>  {
>>       if (num_debug[irq] < 10) {
>> -             printk("DEBUG: Unexpected IRQ %d\n", irq);
>> +             pr_info("DEBUG: Unexpected IRQ %d\n", irq);
>>               num_debug[irq]++;
>>       }
>>       return IRQ_HANDLED;
>
> Is this dead code?

Yes, mac_debug_handler() is unused.

Removing that can be done in a separate patch (this is one of the
patches I'd like
to send upstream ASAP).

>> @@ -319,20 +320,21 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)
>>  #if 0
>>               struct pt_regs *fp = get_irq_regs();
>>               show_state();
>> -             printk("PC: %08lx\nSR: %04x  SP: %p\n", fp->pc, fp->sr, fp);
>> -             printk("d0: %08lx    d1: %08lx    d2: %08lx    d3: %08lx\n",
>> -                    fp->d0, fp->d1, fp->d2, fp->d3);
>> -             printk("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
>> -                    fp->d4, fp->d5, fp->a0, fp->a1);
>> +             pr_info("PC: %08lx\nSR: %04x  SP: %p\n", fp->pc, fp->sr, fp);
>> +             pr_info("d0: %08lx    d1: %08lx    d2: %08lx    d3: %08lx\n",
>> +                     fp->d0, fp->d1, fp->d2, fp->d3);
>> +             pr_info("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
>> +                     fp->d4, fp->d5, fp->a0, fp->a1);
>>
>>               if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page)
>> -                     printk("Corrupted stack page\n");
>> -             printk("Process %s (pid: %d, stackpage=%08lx)\n",
>> -                     current->comm, current->pid, current->kernel_stack_page);
>> +                     pr_info("Corrupted stack page\n");
>> +             pr_info("Process %s (pid: %d, stackpage=%08lx)\n",
>> +                     current->comm, current->pid,
>> +                     current->kernel_stack_page);
>>               if (intr_count == 1)
>>                       dump_stack((struct frame *)fp);
>>  #else
>> -             /* printk("NMI "); */
>> +             /* pr_info("NMI "); */
>>  #endif
>>       }
>>       in_nmi--;
>>
>
> I think it would be good to use pr_debug here instead of #if 0. But that
> will probably break the build... better ignore the #if 0 section for this
> series, until I put together a different patch?

Or worse, break at runtime. There's also non-printing code in that block.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

[toc] | [prev] | [next] | [standalone]


#1538945 — Re: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages

FromFinn Thain <fthain@telegraphics.com.au>
Date2016-12-09 00:20 +0100
SubjectRe: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages
Message-ID<sMg8N-3WO-5@gated-at.bofh.it>
In reply to#1538483
On Thu, 8 Dec 2016, Geert Uytterhoeven wrote:

> On Wed, Dec 7, 2016 at 11:45 PM, Finn Thain <fthain@telegraphics.com.au> wrote:
> > 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_*(),
> >>   - Add missing continuations, to fix user-visible breakage.
> >>
> >> Fixes: 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")
> >> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> >> ---
> >>  arch/m68k/mac/macints.c | 42 ++++++++++++++++++++++--------------------
> >>  1 file changed, 22 insertions(+), 20 deletions(-)
> >>
> >> diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
> >> index 9f98c08719010e27..8572290cb93b6679 100644
> >> --- a/arch/m68k/mac/macints.c
> >> +++ b/arch/m68k/mac/macints.c
> >> @@ -135,6 +135,11 @@
> >>  irqreturn_t mac_debug_handler(int, void *);
> >>
> >>  /* #define DEBUG_MACINTS */
> >> +#ifdef DEBUG_MACINTS
> >> +#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
> >>
> >>  static unsigned int mac_irq_startup(struct irq_data *);
> >>  static void mac_irq_shutdown(struct irq_data *);
> >
> > I would prefer to delete all the DEBUG_MACINTS clutter.
> 
> OK, can do that.

Thanks.

> 
> >> @@ -281,7 +282,7 @@ static void mac_irq_shutdown(struct irq_data *data)
> >>  irqreturn_t mac_debug_handler(int irq, void *dev_id)
> >>  {
> >>       if (num_debug[irq] < 10) {
> >> -             printk("DEBUG: Unexpected IRQ %d\n", irq);
> >> +             pr_info("DEBUG: Unexpected IRQ %d\n", irq);
> >>               num_debug[irq]++;
> >>       }
> >>       return IRQ_HANDLED;
> >
> > Is this dead code?
> 
> Yes, mac_debug_handler() is unused.
> 
> Removing that can be done in a separate patch (this is one of the 
> patches I'd like to send upstream ASAP).

OK.

> 
> >> @@ -319,20 +320,21 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)
> >>  #if 0
> >>               struct pt_regs *fp = get_irq_regs();
> >>               show_state();
> >> -             printk("PC: %08lx\nSR: %04x  SP: %p\n", fp->pc, fp->sr, fp);
> >> -             printk("d0: %08lx    d1: %08lx    d2: %08lx    d3: %08lx\n",
> >> -                    fp->d0, fp->d1, fp->d2, fp->d3);
> >> -             printk("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
> >> -                    fp->d4, fp->d5, fp->a0, fp->a1);
> >> +             pr_info("PC: %08lx\nSR: %04x  SP: %p\n", fp->pc, fp->sr, fp);
> >> +             pr_info("d0: %08lx    d1: %08lx    d2: %08lx    d3: %08lx\n",
> >> +                     fp->d0, fp->d1, fp->d2, fp->d3);
> >> +             pr_info("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
> >> +                     fp->d4, fp->d5, fp->a0, fp->a1);
> >>
> >>               if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page)
> >> -                     printk("Corrupted stack page\n");
> >> -             printk("Process %s (pid: %d, stackpage=%08lx)\n",
> >> -                     current->comm, current->pid, current->kernel_stack_page);
> >> +                     pr_info("Corrupted stack page\n");
> >> +             pr_info("Process %s (pid: %d, stackpage=%08lx)\n",
> >> +                     current->comm, current->pid,
> >> +                     current->kernel_stack_page);
> >>               if (intr_count == 1)
> >>                       dump_stack((struct frame *)fp);
> >>  #else
> >> -             /* printk("NMI "); */
> >> +             /* pr_info("NMI "); */
> >>  #endif
> >>       }
> >>       in_nmi--;
> >>
> >
> > I think it would be good to use pr_debug here instead of #if 0. But that
> > will probably break the build... better ignore the #if 0 section for this
> > series, until I put together a different patch?
> 
> Or worse, break at runtime.
> 

The NMI isn't easily tiggered, unless you know how. It's solely for 
developers.

Anyway, this is dead code so it makes little difference whether you patch 
it or not. But this hunk will break an NMI debug patch that I've been 
using for ten years or so. Since this code needs a rewrite anyway, you 
might as well avoid the churn IMHO.

> There's also non-printing code in that block.

But no side-effects, right?

-- 

> Gr{oetje,eeting}s,
> 
>                         Geert
> 

[toc] | [prev] | [next] | [standalone]


#1537819 — [PATCH 21/22] m68k/mm: Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 21/22] m68k/mm: Modernize printing of kernel messages
Message-ID<sLMaK-1Ll-43@gated-at.bofh.it>
In reply to#1537812
Convert from printk() to pr_*().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/mm/init.c   | 2 +-
 arch/m68k/mm/memory.c | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index b09a3cb29b68fda4..7f5dd339a311800e 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -66,7 +66,7 @@ void __init m68k_setup_node(int node)
 	end = (unsigned long)phys_to_virt(info->addr + info->size - 1) >> __virt_to_node_shift();
 	for (; i <= end; i++) {
 		if (pg_data_table[i])
-			printk("overlap at %u for chunk %u\n", i, node);
+			pr_warn("overlap at %u for chunk %u\n", i, node);
 		pg_data_table[i] = pg_data_map + node;
 	}
 #endif
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c
index 51bc9d258ede39b8..4902b681a9fccf3f 100644
--- a/arch/m68k/mm/memory.c
+++ b/arch/m68k/mm/memory.c
@@ -47,9 +47,7 @@ void __init init_pointer_table(unsigned long ptable)
 	}
 
 	PD_MARKBITS(dp) &= ~mask;
-#ifdef DEBUG
-	printk("init_pointer_table: %lx, %x\n", ptable, PD_MARKBITS(dp));
-#endif
+	pr_debug("init_pointer_table: %lx, %x\n", ptable, PD_MARKBITS(dp));
 
 	/* unreserve the page so it's possible to free that page */
 	PD_PAGE(dp)->flags &= ~(1 << PG_reserved);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1537820 — [PATCH 11/22] m68k/mac: Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 11/22] m68k/mac: Modernize printing of kernel messages
Message-ID<sLMaK-1Ll-45@gated-at.bofh.it>
In reply to#1537812
Convert from printk() to pr_*().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/mac/config.c | 34 ++++++++++++++++------------------
 arch/m68k/mac/misc.c   |  8 ++++----
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index e46895316eb0ef4d..1d7bc6ab3e7fe1b4 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -150,7 +150,7 @@ static void mac_cache_card_flush(int writeback)
 void __init config_mac(void)
 {
 	if (!MACH_IS_MAC)
-		printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n");
+		pr_err("ERROR: no Mac, but config_mac() called!!\n");
 
 	mach_sched_init = mac_sched_init;
 	mach_init_IRQ = mac_init_IRQ;
@@ -837,8 +837,7 @@ static void __init mac_identify(void)
 		/* no bootinfo model id -> NetBSD booter was used! */
 		/* XXX FIXME: breaks for model > 31 */
 		model = (mac_bi_data.cpuid >> 2) & 63;
-		printk(KERN_WARNING "No bootinfo model ID, using cpuid instead "
-		       "(obsolete bootloader?)\n");
+		pr_warn("No bootinfo model ID, using cpuid instead (obsolete bootloader?)\n");
 	}
 
 	macintosh_config = mac_data_table;
@@ -880,24 +879,23 @@ static void __init mac_identify(void)
 	 */
 	iop_preinit();
 
-	printk(KERN_INFO "Detected Macintosh model: %d\n", model);
+	pr_info("Detected Macintosh model: %d\n", model);
 
 	/*
 	 * Report booter data:
 	 */
-	printk(KERN_DEBUG " Penguin bootinfo data:\n");
-	printk(KERN_DEBUG " Video: addr 0x%lx "
-		"row 0x%lx depth %lx dimensions %ld x %ld\n",
-		mac_bi_data.videoaddr, mac_bi_data.videorow,
-		mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
-		mac_bi_data.dimensions >> 16);
-	printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
-		mac_bi_data.videological, mac_orig_videoaddr,
-		mac_bi_data.sccbase);
-	printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n",
-		mac_bi_data.boottime, mac_bi_data.gmtbias);
-	printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
-		mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
+	pr_debug(" Penguin bootinfo data:\n");
+	pr_debug(" Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
+		 mac_bi_data.videoaddr, mac_bi_data.videorow,
+		 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
+		 mac_bi_data.dimensions >> 16);
+	pr_debug(" Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
+		 mac_bi_data.videological, mac_orig_videoaddr,
+		 mac_bi_data.sccbase);
+	pr_debug(" Boottime: 0x%lx GMTBias: 0x%lx\n", mac_bi_data.boottime,
+		 mac_bi_data.gmtbias);
+	pr_debug(" Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
+		 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
 
 	iop_init();
 	via_init();
@@ -912,7 +910,7 @@ static void __init mac_identify(void)
 
 static void __init mac_report_hardware(void)
 {
-	printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
+	pr_info("Apple Macintosh %s\n", macintosh_config->name);
 }
 
 static void mac_get_model(char *str)
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index 0fb54a90eac27305..676e0caaeaa670a0 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -520,7 +520,7 @@ void mac_poweroff(void)
 #endif
 	}
 	local_irq_enable();
-	printk("It is now safe to turn off your Macintosh.\n");
+	pr_info("It is now safe to turn off your Macintosh.\n");
 	while(1);
 }
 
@@ -610,7 +610,7 @@ void mac_reset(void)
 
 	/* should never get here */
 	local_irq_enable();
-	printk ("Restart failed.  Please restart manually.\n");
+	pr_err("Restart failed.  Please restart manually.\n");
 	while(1);
 }
 
@@ -718,13 +718,13 @@ int mac_hwclk(int op, struct rtc_time *t)
 			 &t->tm_year, &t->tm_mon, &t->tm_mday,
 			 &t->tm_hour, &t->tm_min, &t->tm_sec);
 #if 0
-		printk("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n",
+		pr_info("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n",
 			t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
 			t->tm_hour, t->tm_min, t->tm_sec);
 #endif
 	} else { /* write */
 #if 0
-		printk("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n",
+		pr_info("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n",
 			t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
 			t->tm_hour, t->tm_min, t->tm_sec);
 #endif
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1538159 — Re: [PATCH 11/22] m68k/mac: Modernize printing of kernel messages

FromFinn Thain <fthain@telegraphics.com.au>
Date2016-12-08 00:20 +0100
SubjectRe: [PATCH 11/22] m68k/mac: Modernize printing of kernel messages
Message-ID<sLTFf-6FW-13@gated-at.bofh.it>
In reply to#1537820
On Wed, 7 Dec 2016, Geert Uytterhoeven wrote:

> Convert from printk() to pr_*().
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  arch/m68k/mac/config.c | 34 ++++++++++++++++------------------
>  arch/m68k/mac/misc.c   |  8 ++++----
>  2 files changed, 20 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
> index e46895316eb0ef4d..1d7bc6ab3e7fe1b4 100644
> --- a/arch/m68k/mac/config.c
> +++ b/arch/m68k/mac/config.c
> @@ -150,7 +150,7 @@ static void mac_cache_card_flush(int writeback)
>  void __init config_mac(void)
>  {
>  	if (!MACH_IS_MAC)
> -		printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n");
> +		pr_err("ERROR: no Mac, but config_mac() called!!\n");
>  
>  	mach_sched_init = mac_sched_init;
>  	mach_init_IRQ = mac_init_IRQ;

I think this printk is impossible to reach.


> @@ -837,8 +837,7 @@ static void __init mac_identify(void)
>  		/* no bootinfo model id -> NetBSD booter was used! */
>  		/* XXX FIXME: breaks for model > 31 */
>  		model = (mac_bi_data.cpuid >> 2) & 63;
> -		printk(KERN_WARNING "No bootinfo model ID, using cpuid instead "
> -		       "(obsolete bootloader?)\n");
> +		pr_warn("No bootinfo model ID, using cpuid instead (obsolete bootloader?)\n");
>  	}
>  
>  	macintosh_config = mac_data_table;
> @@ -880,24 +879,23 @@ static void __init mac_identify(void)
>  	 */
>  	iop_preinit();
>  
> -	printk(KERN_INFO "Detected Macintosh model: %d\n", model);
> +	pr_info("Detected Macintosh model: %d\n", model);
>  
>  	/*
>  	 * Report booter data:
>  	 */
> -	printk(KERN_DEBUG " Penguin bootinfo data:\n");
> -	printk(KERN_DEBUG " Video: addr 0x%lx "
> -		"row 0x%lx depth %lx dimensions %ld x %ld\n",
> -		mac_bi_data.videoaddr, mac_bi_data.videorow,
> -		mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
> -		mac_bi_data.dimensions >> 16);
> -	printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
> -		mac_bi_data.videological, mac_orig_videoaddr,
> -		mac_bi_data.sccbase);
> -	printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n",
> -		mac_bi_data.boottime, mac_bi_data.gmtbias);
> -	printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
> -		mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
> +	pr_debug(" Penguin bootinfo data:\n");
> +	pr_debug(" Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
> +		 mac_bi_data.videoaddr, mac_bi_data.videorow,
> +		 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
> +		 mac_bi_data.dimensions >> 16);
> +	pr_debug(" Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
> +		 mac_bi_data.videological, mac_orig_videoaddr,
> +		 mac_bi_data.sccbase);
> +	pr_debug(" Boottime: 0x%lx GMTBias: 0x%lx\n", mac_bi_data.boottime,
> +		 mac_bi_data.gmtbias);
> +	pr_debug(" Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
> +		 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
>  
>  	iop_init();
>  	via_init();

I'd prefer that these remained printk(KERN_DEBUG ...).


> @@ -912,7 +910,7 @@ static void __init mac_identify(void)
>  
>  static void __init mac_report_hardware(void)
>  {
> -	printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
> +	pr_info("Apple Macintosh %s\n", macintosh_config->name);
>  }
>  
>  static void mac_get_model(char *str)
> diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
> index 0fb54a90eac27305..676e0caaeaa670a0 100644
> --- a/arch/m68k/mac/misc.c
> +++ b/arch/m68k/mac/misc.c
> @@ -520,7 +520,7 @@ void mac_poweroff(void)
>  #endif
>  	}
>  	local_irq_enable();
> -	printk("It is now safe to turn off your Macintosh.\n");
> +	pr_info("It is now safe to turn off your Macintosh.\n");
>  	while(1);
>  }
>  
> @@ -610,7 +610,7 @@ void mac_reset(void)
>  
>  	/* should never get here */
>  	local_irq_enable();
> -	printk ("Restart failed.  Please restart manually.\n");
> +	pr_err("Restart failed.  Please restart manually.\n");
>  	while(1);
>  }
>  
> @@ -718,13 +718,13 @@ int mac_hwclk(int op, struct rtc_time *t)
>  			 &t->tm_year, &t->tm_mon, &t->tm_mday,
>  			 &t->tm_hour, &t->tm_min, &t->tm_sec);
>  #if 0
> -		printk("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n",
> +		pr_info("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n",
>  			t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
>  			t->tm_hour, t->tm_min, t->tm_sec);
>  #endif
>  	} else { /* write */
>  #if 0
> -		printk("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n",
> +		pr_info("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n",
>  			t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
>  			t->tm_hour, t->tm_min, t->tm_sec);
>  #endif
> 

These two can be changed to pr_debug() and the #if 0 removed. Since there 
is no DEBUG macro definition here, I believe they will become no_printk() 
and get checked by the compiler.

Thanks.

-- 

[toc] | [prev] | [next] | [standalone]


#1537822 — [PATCH 20/22] m68k/mm: sun3 - Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 20/22] m68k/mm: sun3 - Modernize printing of kernel messages
Message-ID<sLMaK-1Ll-53@gated-at.bofh.it>
In reply to#1537812
  - Convert from printk() to pr_*(),
  - Add missing print to do_page_mapin(), as print_pte_vaddr() calls
    pr_cont().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/include/asm/sun3_pgtable.h | 6 +++---
 arch/m68k/mm/sun3kmap.c              | 5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/m68k/include/asm/sun3_pgtable.h b/arch/m68k/include/asm/sun3_pgtable.h
index 48657f9fdeceac19..d5104a7b5388535f 100644
--- a/arch/m68k/include/asm/sun3_pgtable.h
+++ b/arch/m68k/include/asm/sun3_pgtable.h
@@ -151,11 +151,11 @@ static inline void pgd_clear (pgd_t *pgdp) {}
 
 
 #define pte_ERROR(e) \
-	printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
+	pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
 #define pmd_ERROR(e) \
-	printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
+	pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
 #define pgd_ERROR(e) \
-	printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
+	pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
 
 
 /*
diff --git a/arch/m68k/mm/sun3kmap.c b/arch/m68k/mm/sun3kmap.c
index 3dc41158c05e973a..ae03555449b85d0e 100644
--- a/arch/m68k/mm/sun3kmap.c
+++ b/arch/m68k/mm/sun3kmap.c
@@ -40,6 +40,7 @@ static inline void do_page_mapin(unsigned long phys, unsigned long virt,
 	sun3_put_pte(virt, pte);
 
 #ifdef SUN3_KMAP_DEBUG
+	pr_info("mapin:");
 	print_pte_vaddr(virt);
 #endif
 
@@ -80,8 +81,8 @@ void __iomem *sun3_ioremap(unsigned long phys, unsigned long size,
 		return NULL;
 
 #ifdef SUN3_KMAP_DEBUG
-	printk("ioremap: got virt %p size %lx(%lx)\n",
-	       area->addr, size, area->size);
+	pr_info("ioremap: got virt %p size %lx(%lx)\n", area->addr, size,
+		area->size);
 #endif
 
 	pages = size / PAGE_SIZE;
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1537823 — [PATCH 06/22] m68k/coldfire: Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 06/22] m68k/coldfire: Modernize printing of kernel messages
Message-ID<sLMaL-1Ll-55@gated-at.bofh.it>
In reply to#1537812
  - Introduce helpers for printing debug messages, incl. dummies for
    validating format strings when debugging is disabled,
  - Convert from printk() to pr_*(),
  - Correct printf()-style format specifiers,
  - Drop superfluous casts,

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/coldfire/m528x.c          |  4 +-
 arch/m68k/coldfire/sltimers.c       |  4 +-
 arch/m68k/coldfire/timers.c         |  4 +-
 arch/m68k/coldfire/vectors.c        |  2 +-
 arch/m68k/include/asm/dma.h         | 98 +++++++++++++------------------------
 arch/m68k/include/asm/mcf_pgtable.h |  9 ++--
 6 files changed, 44 insertions(+), 77 deletions(-)

diff --git a/arch/m68k/coldfire/m528x.c b/arch/m68k/coldfire/m528x.c
index 12f9e370d8dde8d8..fcdf6b3d427c3ca0 100644
--- a/arch/m68k/coldfire/m528x.c
+++ b/arch/m68k/coldfire/m528x.c
@@ -99,7 +99,7 @@ void wildfire_halt(void)
 #ifdef CONFIG_WILDFIREMOD
 void wildfiremod_halt(void)
 {
-	printk(KERN_INFO "WildFireMod hibernating...\n");
+	pr_info("WildFireMod hibernating...\n");
 
 	/* Set portE.5 to Digital IO */
 	writew(readw(MCFGPIO_PEPAR) & ~(1 << (5 * 2)), MCFGPIO_PEPAR);
@@ -111,7 +111,7 @@ void wildfiremod_halt(void)
 	writeb(readb(MCFGPIO_PODR_E) & ~(1 << 5), MCFGPIO_PODR_E);
 	writeb(readb(MCFGPIO_PODR_E) | (1 << 5), MCFGPIO_PODR_E);
 
-	printk(KERN_EMERG "Failed to hibernate. Halting!\n");
+	pr_emerg("Failed to hibernate. Halting!\n");
 }
 #endif
 
diff --git a/arch/m68k/coldfire/sltimers.c b/arch/m68k/coldfire/sltimers.c
index 831a08cf6f40d7e6..e1c66a4a53d2d285 100644
--- a/arch/m68k/coldfire/sltimers.c
+++ b/arch/m68k/coldfire/sltimers.c
@@ -57,8 +57,8 @@ irqreturn_t mcfslt_profile_tick(int irq, void *dummy)
 
 void mcfslt_profile_init(void)
 {
-	printk(KERN_INFO "PROFILE: lodging TIMER 1 @ %dHz as profile timer\n",
-	       PROFILEHZ);
+	pr_info("PROFILE: lodging TIMER 1 @ %dHz as profile timer\n",
+		PROFILEHZ);
 
 	setup_irq(MCF_IRQ_PROFILER, &mcfslt_profile_irq);
 
diff --git a/arch/m68k/coldfire/timers.c b/arch/m68k/coldfire/timers.c
index cd496a20fcc7ced7..b849e40c97b1a408 100644
--- a/arch/m68k/coldfire/timers.c
+++ b/arch/m68k/coldfire/timers.c
@@ -177,8 +177,8 @@ irqreturn_t coldfire_profile_tick(int irq, void *dummy)
 
 void coldfire_profile_init(void)
 {
-	printk(KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n",
-	       PROFILEHZ);
+	pr_info("PROFILE: lodging TIMER2 @ %dHz as profile timer\n",
+		PROFILEHZ);
 
 	/* Set up TIMER 2 as high speed profile clock */
 	__raw_writew(MCFTIMER_TMR_DISABLE, PA(MCFTIMER_TMR));
diff --git a/arch/m68k/coldfire/vectors.c b/arch/m68k/coldfire/vectors.c
index 08923fe600e013d9..a185df5963d4ae50 100644
--- a/arch/m68k/coldfire/vectors.c
+++ b/arch/m68k/coldfire/vectors.c
@@ -24,7 +24,7 @@
 asmlinkage void dbginterrupt_c(struct frame *fp)
 {
 	extern void dump(struct pt_regs *fp);
-	printk(KERN_DEBUG "%s(%d): BUS ERROR TRAP\n", __FILE__, __LINE__);
+	pr_debug("%s(%d): BUS ERROR TRAP\n", __FILE__, __LINE__);
 	dump((struct pt_regs *) fp);
 	asm("halt");
 }
diff --git a/arch/m68k/include/asm/dma.h b/arch/m68k/include/asm/dma.h
index 208b4daa14b334f4..c20ed384da6520dd 100644
--- a/arch/m68k/include/asm/dma.h
+++ b/arch/m68k/include/asm/dma.h
@@ -1,6 +1,12 @@
 #ifndef _M68K_DMA_H
 #define _M68K_DMA_H 1
 
+#ifdef DMA_DEBUG
+#define pr_dma(fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#else
+#define pr_dma(fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#endif
+
 #ifdef CONFIG_COLDFIRE
 /*
  * ColdFire DMA Model:
@@ -126,9 +132,7 @@ static __inline__ void enable_dma(unsigned int dmanr)
 {
   volatile unsigned short *dmawp;
 
-#ifdef DMA_DEBUG
-  printk("enable_dma(dmanr=%d)\n", dmanr);
-#endif
+  pr_dma("enable_dma(dmanr=%d)\n", dmanr);
 
   dmawp = (unsigned short *) dma_base_addr[dmanr];
   dmawp[MCFDMA_DCR] |= MCFDMA_DCR_EEXT;
@@ -139,9 +143,7 @@ static __inline__ void disable_dma(unsigned int dmanr)
   volatile unsigned short *dmawp;
   volatile unsigned char  *dmapb;
 
-#ifdef DMA_DEBUG
-  printk("disable_dma(dmanr=%d)\n", dmanr);
-#endif
+  pr_dma("disable_dma(dmanr=%d)\n", dmanr);
 
   dmawp = (unsigned short *) dma_base_addr[dmanr];
   dmapb = (unsigned char *) dma_base_addr[dmanr];
@@ -172,9 +174,7 @@ static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
   volatile unsigned char  *dmabp;
   volatile unsigned short *dmawp;
 
-#ifdef DMA_DEBUG
-  printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
-#endif
+  pr_dma("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
 
   dmabp = (unsigned char *) dma_base_addr[dmanr];
   dmawp = (unsigned short *) dma_base_addr[dmanr];
@@ -201,11 +201,9 @@ static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
      ((mode & DMA_MODE_LONG_BIT) ? MCFDMA_DCR_DSIZE_LONG :
                                    MCFDMA_DCR_DSIZE_BYTE));
 
-#ifdef DEBUG_DMA
-  printk("%s(%d): dmanr=%d DSR[%x]=%x DCR[%x]=%x\n", __FILE__, __LINE__,
-         dmanr, (int) &dmabp[MCFDMA_DSR], dmabp[MCFDMA_DSR],
-	 (int) &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR]);
-#endif
+  pr_dma("%s(%u): dmanr=%d DSR[%p]=%x DCR[%p]=%x\n", __FILE__, __LINE__, dmanr,
+	 &dmabp[MCFDMA_DSR], dmabp[MCFDMA_DSR], &dmawp[MCFDMA_DCR],
+	 dmawp[MCFDMA_DCR]);
 }
 
 /* Set transfer address for specific DMA channel */
@@ -214,9 +212,7 @@ static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
   volatile unsigned short *dmawp;
   volatile unsigned int   *dmalp;
 
-#ifdef DMA_DEBUG
-  printk("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
-#endif
+  pr_dma("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
 
   dmawp = (unsigned short *) dma_base_addr[dmanr];
   dmalp = (unsigned int *) dma_base_addr[dmanr];
@@ -234,12 +230,10 @@ static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
     dmalp[MCFDMA_SAR] = dma_device_address[dmanr];
   }
 
-#ifdef DEBUG_DMA
-  printk("%s(%d): dmanr=%d DCR[%x]=%x SAR[%x]=%08x DAR[%x]=%08x\n",
-	__FILE__, __LINE__, dmanr, (int) &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR],
-	(int) &dmalp[MCFDMA_SAR], dmalp[MCFDMA_SAR],
-	(int) &dmalp[MCFDMA_DAR], dmalp[MCFDMA_DAR]);
-#endif
+  pr_dma("%s(%u): dmanr=%d DCR[%p]=%x SAR[%p]=%08x DAR[%p]=%08x\n", __FILE__,
+	 __LINE__, dmanr, &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR],
+	 &dmalp[MCFDMA_SAR], dmalp[MCFDMA_SAR], &dmalp[MCFDMA_DAR],
+	 dmalp[MCFDMA_DAR]);
 }
 
 /*
@@ -248,9 +242,7 @@ static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
  */
 static __inline__ void set_dma_device_addr(unsigned int dmanr, unsigned int a)
 {
-#ifdef DMA_DEBUG
-  printk("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
-#endif
+  pr_dma("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
 
   dma_device_address[dmanr] = a;
 }
@@ -262,9 +254,7 @@ static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
 {
   volatile unsigned short *dmawp;
 
-#ifdef DMA_DEBUG
-  printk("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
-#endif
+  pr_dma("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
 
   dmawp = (unsigned short *) dma_base_addr[dmanr];
   dmawp[MCFDMA_BCR] = (unsigned short)count;
@@ -281,9 +271,7 @@ static __inline__ int get_dma_residue(unsigned int dmanr)
   volatile unsigned short *dmawp;
   unsigned short count;
 
-#ifdef DMA_DEBUG
-  printk("get_dma_residue(dmanr=%d)\n", dmanr);
-#endif
+  pr_dma("get_dma_residue(dmanr=%d)\n", dmanr);
 
   dmawp = (unsigned short *) dma_base_addr[dmanr];
   count = dmawp[MCFDMA_BCR];
@@ -319,9 +307,7 @@ static __inline__ void enable_dma(unsigned int dmanr)
 {
   volatile unsigned int  *dmalp;
 
-#ifdef DMA_DEBUG
-  printk("enable_dma(dmanr=%d)\n", dmanr);
-#endif
+  pr_dma("enable_dma(dmanr=%d)\n", dmanr);
 
   dmalp = (unsigned int *) dma_base_addr[dmanr];
   dmalp[MCFDMA_DMR] |= MCFDMA_DMR_EN;
@@ -331,9 +317,7 @@ static __inline__ void disable_dma(unsigned int dmanr)
 {
   volatile unsigned int   *dmalp;
 
-#ifdef DMA_DEBUG
-  printk("disable_dma(dmanr=%d)\n", dmanr);
-#endif
+  pr_dma("disable_dma(dmanr=%d)\n", dmanr);
 
   dmalp = (unsigned int *) dma_base_addr[dmanr];
 
@@ -363,9 +347,7 @@ static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
   volatile unsigned int   *dmalp;
   volatile unsigned short *dmawp;
 
-#ifdef DMA_DEBUG
-  printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
-#endif
+  pr_dma("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
   dmalp = (unsigned int *) dma_base_addr[dmanr];
   dmawp = (unsigned short *) dma_base_addr[dmanr];
 
@@ -387,11 +369,9 @@ static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
 
   dmawp[MCFDMA_DIR] |= MCFDMA_DIR_ASCEN;   /* Enable completion interrupts */
 
-#ifdef DEBUG_DMA
-  printk("%s(%d): dmanr=%d DMR[%x]=%x DIR[%x]=%x\n", __FILE__, __LINE__,
-         dmanr, (int) &dmalp[MCFDMA_DMR], dmabp[MCFDMA_DMR],
-	 (int) &dmawp[MCFDMA_DIR], dmawp[MCFDMA_DIR]);
-#endif
+  pr_dma("%s(%u): dmanr=%d DMR[%p]=%x DIR[%p]=%x\n", __FILE__, __LINE__, dmanr,
+	 &dmalp[MCFDMA_DMR], dmabp[MCFDMA_DMR], &dmawp[MCFDMA_DIR],
+	 dmawp[MCFDMA_DIR]);
 }
 
 /* Set transfer address for specific DMA channel */
@@ -399,9 +379,7 @@ static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
 {
   volatile unsigned int   *dmalp;
 
-#ifdef DMA_DEBUG
-  printk("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
-#endif
+  pr_dma("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
 
   dmalp = (unsigned int *) dma_base_addr[dmanr];
 
@@ -418,12 +396,10 @@ static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
     dmalp[MCFDMA_DSAR] = dma_device_address[dmanr];
   }
 
-#ifdef DEBUG_DMA
-  printk("%s(%d): dmanr=%d DMR[%x]=%x SAR[%x]=%08x DAR[%x]=%08x\n",
-	__FILE__, __LINE__, dmanr, (int) &dmawp[MCFDMA_DMR], dmawp[MCFDMA_DMR],
-	(int) &dmalp[MCFDMA_DSAR], dmalp[MCFDMA_DSAR],
-	(int) &dmalp[MCFDMA_DDAR], dmalp[MCFDMA_DDAR]);
-#endif
+  pr_dma("%s(%u): dmanr=%d DMR[%p]=%x SAR[%p]=%08x DAR[%p]=%08x\n", __FILE__,
+	 __LINE__, dmanr, &dmawp[MCFDMA_DMR], dmawp[MCFDMA_DMR],
+	 &dmalp[MCFDMA_DSAR], dmalp[MCFDMA_DSAR], &dmalp[MCFDMA_DDAR],
+	 dmalp[MCFDMA_DDAR]);
 }
 
 /*
@@ -432,9 +408,7 @@ static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
  */
 static __inline__ void set_dma_device_addr(unsigned int dmanr, unsigned int a)
 {
-#ifdef DMA_DEBUG
-  printk("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
-#endif
+  pr_dma("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
 
   dma_device_address[dmanr] = a;
 }
@@ -448,9 +422,7 @@ static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
 {
   volatile unsigned int *dmalp;
 
-#ifdef DMA_DEBUG
-  printk("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
-#endif
+  pr_dma("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
 
   dmalp = (unsigned int *) dma_base_addr[dmanr];
   dmalp[MCFDMA_DBCR] = count;
@@ -467,9 +439,7 @@ static __inline__ int get_dma_residue(unsigned int dmanr)
   volatile unsigned int *dmalp;
   unsigned int count;
 
-#ifdef DMA_DEBUG
-  printk("get_dma_residue(dmanr=%d)\n", dmanr);
-#endif
+  pr_dma("get_dma_residue(dmanr=%d)\n", dmanr);
 
   dmalp = (unsigned int *) dma_base_addr[dmanr];
   count = dmalp[MCFDMA_DBCR];
diff --git a/arch/m68k/include/asm/mcf_pgtable.h b/arch/m68k/include/asm/mcf_pgtable.h
index 2500ce04fcc412ea..43a8b7a1cba4b2c1 100644
--- a/arch/m68k/include/asm/mcf_pgtable.h
+++ b/arch/m68k/include/asm/mcf_pgtable.h
@@ -203,14 +203,11 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
 static inline void pgd_clear(pgd_t *pgdp) {}
 
 #define pte_ERROR(e) \
-	printk(KERN_ERR "%s:%d: bad pte %08lx.\n",	\
-	__FILE__, __LINE__, pte_val(e))
+	pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
 #define pmd_ERROR(e) \
-	printk(KERN_ERR "%s:%d: bad pmd %08lx.\n",	\
-	__FILE__, __LINE__, pmd_val(e))
+	pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
 #define pgd_ERROR(e) \
-	printk(KERN_ERR "%s:%d: bad pgd %08lx.\n",	\
-	__FILE__, __LINE__, pgd_val(e))
+	pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
 
 /*
  * The following only work if pte_present() is true.
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1538147 — Re: [PATCH 06/22] m68k/coldfire: Modernize printing of kernel messages

FromFinn Thain <fthain@telegraphics.com.au>
Date2016-12-08 00:00 +0100
SubjectRe: [PATCH 06/22] m68k/coldfire: Modernize printing of kernel messages
Message-ID<sLTlU-6gc-11@gated-at.bofh.it>
In reply to#1537823
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_*(),
>   - Correct printf()-style format specifiers,
>   - Drop superfluous casts,
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  arch/m68k/coldfire/m528x.c          |  4 +-
>  arch/m68k/coldfire/sltimers.c       |  4 +-
>  arch/m68k/coldfire/timers.c         |  4 +-
>  arch/m68k/coldfire/vectors.c        |  2 +-
>  arch/m68k/include/asm/dma.h         | 98 +++++++++++++------------------------
>  arch/m68k/include/asm/mcf_pgtable.h |  9 ++--
>  6 files changed, 44 insertions(+), 77 deletions(-)
> 
> diff --git a/arch/m68k/coldfire/m528x.c b/arch/m68k/coldfire/m528x.c
> index 12f9e370d8dde8d8..fcdf6b3d427c3ca0 100644
> --- a/arch/m68k/coldfire/m528x.c
> +++ b/arch/m68k/coldfire/m528x.c
> @@ -99,7 +99,7 @@ void wildfire_halt(void)
>  #ifdef CONFIG_WILDFIREMOD
>  void wildfiremod_halt(void)
>  {
> -	printk(KERN_INFO "WildFireMod hibernating...\n");
> +	pr_info("WildFireMod hibernating...\n");
>  
>  	/* Set portE.5 to Digital IO */
>  	writew(readw(MCFGPIO_PEPAR) & ~(1 << (5 * 2)), MCFGPIO_PEPAR);
> @@ -111,7 +111,7 @@ void wildfiremod_halt(void)
>  	writeb(readb(MCFGPIO_PODR_E) & ~(1 << 5), MCFGPIO_PODR_E);
>  	writeb(readb(MCFGPIO_PODR_E) | (1 << 5), MCFGPIO_PODR_E);
>  
> -	printk(KERN_EMERG "Failed to hibernate. Halting!\n");
> +	pr_emerg("Failed to hibernate. Halting!\n");
>  }
>  #endif
>  
> diff --git a/arch/m68k/coldfire/sltimers.c b/arch/m68k/coldfire/sltimers.c
> index 831a08cf6f40d7e6..e1c66a4a53d2d285 100644
> --- a/arch/m68k/coldfire/sltimers.c
> +++ b/arch/m68k/coldfire/sltimers.c
> @@ -57,8 +57,8 @@ irqreturn_t mcfslt_profile_tick(int irq, void *dummy)
>  
>  void mcfslt_profile_init(void)
>  {
> -	printk(KERN_INFO "PROFILE: lodging TIMER 1 @ %dHz as profile timer\n",
> -	       PROFILEHZ);
> +	pr_info("PROFILE: lodging TIMER 1 @ %dHz as profile timer\n",
> +		PROFILEHZ);
>  
>  	setup_irq(MCF_IRQ_PROFILER, &mcfslt_profile_irq);
>  
> diff --git a/arch/m68k/coldfire/timers.c b/arch/m68k/coldfire/timers.c
> index cd496a20fcc7ced7..b849e40c97b1a408 100644
> --- a/arch/m68k/coldfire/timers.c
> +++ b/arch/m68k/coldfire/timers.c
> @@ -177,8 +177,8 @@ irqreturn_t coldfire_profile_tick(int irq, void *dummy)
>  
>  void coldfire_profile_init(void)
>  {
> -	printk(KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n",
> -	       PROFILEHZ);
> +	pr_info("PROFILE: lodging TIMER2 @ %dHz as profile timer\n",
> +		PROFILEHZ);
>  
>  	/* Set up TIMER 2 as high speed profile clock */
>  	__raw_writew(MCFTIMER_TMR_DISABLE, PA(MCFTIMER_TMR));
> diff --git a/arch/m68k/coldfire/vectors.c b/arch/m68k/coldfire/vectors.c
> index 08923fe600e013d9..a185df5963d4ae50 100644
> --- a/arch/m68k/coldfire/vectors.c
> +++ b/arch/m68k/coldfire/vectors.c
> @@ -24,7 +24,7 @@
>  asmlinkage void dbginterrupt_c(struct frame *fp)
>  {
>  	extern void dump(struct pt_regs *fp);
> -	printk(KERN_DEBUG "%s(%d): BUS ERROR TRAP\n", __FILE__, __LINE__);
> +	pr_debug("%s(%d): BUS ERROR TRAP\n", __FILE__, __LINE__);
>  	dump((struct pt_regs *) fp);
>  	asm("halt");
>  }

This file also seems to lack #define DEBUG, so you and Greg might want to 
check this change.

-- 

[toc] | [prev] | [next] | [standalone]


#1539309 — Re: [PATCH 06/22] m68k/coldfire: Modernize printing of kernel messages

FromGreg Ungerer <gerg@linux-m68k.org>
Date2016-12-09 13:10 +0100
SubjectRe: [PATCH 06/22] m68k/coldfire: Modernize printing of kernel messages
Message-ID<sMs9X-355-13@gated-at.bofh.it>
In reply to#1538147
Hi Finn, Geert,

On 08/12/16 08:53, Finn Thain wrote:
>
> 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_*(),
>>   - Correct printf()-style format specifiers,
>>   - Drop superfluous casts,
>>
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> ---
>>  arch/m68k/coldfire/m528x.c          |  4 +-
>>  arch/m68k/coldfire/sltimers.c       |  4 +-
>>  arch/m68k/coldfire/timers.c         |  4 +-
>>  arch/m68k/coldfire/vectors.c        |  2 +-
>>  arch/m68k/include/asm/dma.h         | 98 +++++++++++++------------------------
>>  arch/m68k/include/asm/mcf_pgtable.h |  9 ++--
>>  6 files changed, 44 insertions(+), 77 deletions(-)
>>
[snip]
>> diff --git a/arch/m68k/coldfire/vectors.c b/arch/m68k/coldfire/vectors.c
>> index 08923fe600e013d9..a185df5963d4ae50 100644
>> --- a/arch/m68k/coldfire/vectors.c
>> +++ b/arch/m68k/coldfire/vectors.c
>> @@ -24,7 +24,7 @@
>>  asmlinkage void dbginterrupt_c(struct frame *fp)
>>  {
>>  	extern void dump(struct pt_regs *fp);
>> -	printk(KERN_DEBUG "%s(%d): BUS ERROR TRAP\n", __FILE__, __LINE__);
>> +	pr_debug("%s(%d): BUS ERROR TRAP\n", __FILE__, __LINE__);
>>  	dump((struct pt_regs *) fp);
>>  	asm("halt");
>>  }
>
> This file also seems to lack #define DEBUG, so you and Greg might want to
> check this change.

I think we still want this message in, even if DEBUG is
not defined. This code is conditionally compiled in for
hardware debuger processing - and this message should really
come out if this trap case occurs so the user has some idea
that it just tripped. (The text of the message is not perfect,
but that is a separate issue).

Perhaps pr_alert() or pr_crit() would be better?

Regards
Greg

[toc] | [prev] | [next] | [standalone]


#1537824 — [PATCH 22/22] m68k/include: Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 22/22] m68k/include: Modernize printing of kernel messages
Message-ID<sLMaL-1Ll-59@gated-at.bofh.it>
In reply to#1537812
  - Convert from printk() to pr_*(),
  - Add dummies for validating format strings when debugging is
    disabled.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/include/asm/bug.h      |  4 ++--
 arch/m68k/include/asm/floppy.h   |  6 +++---
 arch/m68k/include/asm/math-emu.h | 10 +++++-----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/m68k/include/asm/bug.h b/arch/m68k/include/asm/bug.h
index ef9a2e47352f0d8a..5bc8d91d68d42bf0 100644
--- a/arch/m68k/include/asm/bug.h
+++ b/arch/m68k/include/asm/bug.h
@@ -6,12 +6,12 @@
 #ifdef CONFIG_DEBUG_BUGVERBOSE
 #ifndef CONFIG_SUN3
 #define BUG() do { \
-	printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+	pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
 	__builtin_trap(); \
 } while (0)
 #else
 #define BUG() do { \
-	printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+	pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
 	panic("BUG!"); \
 } while (0)
 #endif
diff --git a/arch/m68k/include/asm/floppy.h b/arch/m68k/include/asm/floppy.h
index 47365b1ccbecfeb9..c3b9ad6732fc68cc 100644
--- a/arch/m68k/include/asm/floppy.h
+++ b/arch/m68k/include/asm/floppy.h
@@ -234,9 +234,9 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id)
 		virtual_dma_residue += virtual_dma_count;
 		virtual_dma_count=0;
 #ifdef TRACE_FLPY_INT
-		printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n",
-		       virtual_dma_count, virtual_dma_residue, calls, bytes,
-		       dma_wait);
+		pr_info("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n",
+			virtual_dma_count, virtual_dma_residue, calls, bytes,
+			dma_wait);
 		calls = 0;
 		dma_wait=0;
 #endif
diff --git a/arch/m68k/include/asm/math-emu.h b/arch/m68k/include/asm/math-emu.h
index 5e9249b0014ca0fc..b062696d5a0d99aa 100644
--- a/arch/m68k/include/asm/math-emu.h
+++ b/arch/m68k/include/asm/math-emu.h
@@ -105,21 +105,21 @@ struct fp_data {
 #ifdef FPU_EMU_DEBUG
 extern unsigned int fp_debugprint;
 
-#define dprint(bit, fmt, args...) ({			\
+#define dprint(bit, fmt, ...) ({			\
 	if (fp_debugprint & (1 << (bit)))		\
-		printk(fmt, ## args);			\
+		pr_info(fmt, ##__VA_ARGS__);		\
 })
 #else
-#define dprint(bit, fmt, args...)
+#define dprint(bit, fmt, ...)	no_printk(fmt, ##__VA_ARGS__)
 #endif
 
 #define uprint(str) ({					\
 	static int __count = 3;				\
 							\
 	if (__count > 0) {				\
-		printk("You just hit an unimplemented "	\
+		pr_err("You just hit an unimplemented "	\
 		       "fpu instruction (%s)\n", str);	\
-		printk("Please report this to ....\n");	\
+		pr_err("Please report this to ....\n");	\
 		__count--;				\
 	}						\
 })
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1537825 — [PATCH 13/22] m68k/mvme16x: Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 13/22] m68k/mvme16x: Modernize printing of kernel messages
Message-ID<sLMaL-1Ll-63@gated-at.bofh.it>
In reply to#1537812
Convert from printk() to pr_*().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/mvme16x/config.c | 32 ++++++++++++++++----------------
 arch/m68k/mvme16x/rtc.c    |  2 +-
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index 58e240939d265f69..6fa06d4d16bf08d4 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -72,8 +72,8 @@ int __init mvme16x_parse_bootinfo(const struct bi_record *bi)
 
 void mvme16x_reset(void)
 {
-	printk ("\r\n\nCalled mvme16x_reset\r\n"
-			"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r");
+	pr_info("\r\n\nCalled mvme16x_reset\r\n"
+		"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r");
 	/* The string of returns is to delay the reset until the whole
 	 * message is output.  Assert reset bit in GCSR */
 	*(volatile char *)0xfff40107 = 0x80;
@@ -289,7 +289,7 @@ void __init config_mvme16x(void)
 
     if (strncmp("BDID", p->bdid, 4))
     {
-	printk ("\n\nBug call .BRD_ID returned garbage - giving up\n\n");
+	pr_crit("Bug call .BRD_ID returned garbage - giving up\n");
 	while (1)
 		;
     }
@@ -298,25 +298,25 @@ void __init config_mvme16x(void)
 	vme_brdtype = brdno;
 
     mvme16x_get_model(id);
-    printk ("\nBRD_ID: %s   BUG %x.%x %02x/%02x/%02x\n", id, p->rev>>4,
-					p->rev&0xf, p->yr, p->mth, p->day);
+    pr_info("BRD_ID: %s   BUG %x.%x %02x/%02x/%02x\n", id, p->rev >> 4,
+	    p->rev & 0xf, p->yr, p->mth, p->day);
     if (brdno == 0x0162 || brdno == 0x172)
     {
 	unsigned char rev = *(unsigned char *)MVME162_VERSION_REG;
 
 	mvme16x_config = rev | MVME16x_CONFIG_GOT_SCCA;
 
-	printk ("MVME%x Hardware status:\n", brdno);
-	printk ("    CPU Type           68%s040\n",
-			rev & MVME16x_CONFIG_GOT_FPU ? "" : "LC");
-	printk ("    CPU clock          %dMHz\n",
-			rev & MVME16x_CONFIG_SPEED_32 ? 32 : 25);
-	printk ("    VMEchip2           %spresent\n",
-			rev & MVME16x_CONFIG_NO_VMECHIP2 ? "NOT " : "");
-	printk ("    SCSI interface     %spresent\n",
-			rev & MVME16x_CONFIG_NO_SCSICHIP ? "NOT " : "");
-	printk ("    Ethernet interface %spresent\n",
-			rev & MVME16x_CONFIG_NO_ETHERNET ? "NOT " : "");
+	pr_info("MVME%x Hardware status:\n", brdno);
+	pr_info("    CPU Type           68%s040\n",
+		rev & MVME16x_CONFIG_GOT_FPU ? "" : "LC");
+	pr_info("    CPU clock          %dMHz\n",
+		rev & MVME16x_CONFIG_SPEED_32 ? 32 : 25);
+	pr_info("    VMEchip2           %spresent\n",
+		rev & MVME16x_CONFIG_NO_VMECHIP2 ? "NOT " : "");
+	pr_info("    SCSI interface     %spresent\n",
+		rev & MVME16x_CONFIG_NO_SCSICHIP ? "NOT " : "");
+	pr_info("    Ethernet interface %spresent\n",
+		rev & MVME16x_CONFIG_NO_ETHERNET ? "NOT " : "");
     }
     else
     {
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c
index 1cdc732681885e9a..e37ecb7e69284a83 100644
--- a/arch/m68k/mvme16x/rtc.c
+++ b/arch/m68k/mvme16x/rtc.c
@@ -158,7 +158,7 @@ static int __init rtc_MK48T08_init(void)
 	if (!MACH_IS_MVME16x)
 		return -ENODEV;
 
-	printk(KERN_INFO "MK48T08 Real Time Clock Driver v%s\n", RTC_VERSION);
+	pr_info("MK48T08 Real Time Clock Driver v%s\n", RTC_VERSION);
 	return misc_register(&rtc_dev);
 }
 device_initcall(rtc_MK48T08_init);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1537827 — [PATCH 05/22] m68k/bvme6000: Modernize printing of kernel messages

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-12-07 16:20 +0100
Subject[PATCH 05/22] m68k/bvme6000: Modernize printing of kernel messages
Message-ID<sLMaL-1Ll-61@gated-at.bofh.it>
In reply to#1537812
Convert from printk() to pr_*().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/bvme6000/config.c | 8 ++++----
 arch/m68k/bvme6000/rtc.c    | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c
index 611d4d9ea2bd80ac..2cfff47650407479 100644
--- a/arch/m68k/bvme6000/config.c
+++ b/arch/m68k/bvme6000/config.c
@@ -63,8 +63,8 @@ void bvme6000_reset(void)
 {
 	volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE;
 
-	printk ("\r\n\nCalled bvme6000_reset\r\n"
-			"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r");
+	pr_info("\r\n\nCalled bvme6000_reset\r\n"
+		"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r");
 	/* The string of returns is to delay the reset until the whole
 	 * message is output. */
 	/* Enable the watchdog, via PIT port C bit 4 */
@@ -117,8 +117,8 @@ void __init config_bvme6000(void)
     mach_reset		 = bvme6000_reset;
     mach_get_model       = bvme6000_get_model;
 
-    printk ("Board is %sconfigured as a System Controller\n",
-		*config_reg_ptr & BVME_CONFIG_SW1 ? "" : "not ");
+    pr_info("Board is %sconfigured as a System Controller\n",
+	    *config_reg_ptr & BVME_CONFIG_SW1 ? "" : "not ");
 
     /* Now do the PIT configuration */
 
diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c
index f7984f44ff0f8072..43f483f3149ada31 100644
--- a/arch/m68k/bvme6000/rtc.c
+++ b/arch/m68k/bvme6000/rtc.c
@@ -168,7 +168,7 @@ static int __init rtc_DP8570A_init(void)
 	if (!MACH_IS_BVME6000)
 		return -ENODEV;
 
-	printk(KERN_INFO "DP8570A Real Time Clock Driver v%s\n", RTC_VERSION);
+	pr_info("DP8570A Real Time Clock Driver v%s\n", RTC_VERSION);
 	return misc_register(&rtc_dev);
 }
 module_init(rtc_DP8570A_init);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.kernel


csiph-web