All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch/arm/kernel/smp_twd.c: Correct local timer printk decimal output
@ 2010-11-08 19:27 ` Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2010-11-08 19:27 UTC (permalink / raw)
  To: Russell King; +Cc: linux-arm-kernel, linux-kernel

The timer decimal place is shown incorrectly.
The %100 divisor needs to have 1 fewer 0.

Convert to pr_<level> while at it.

Uncompiled/untested.

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/arm/kernel/smp_twd.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 35882fb..4f90183 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -8,6 +8,9 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
@@ -89,7 +92,7 @@ static void __cpuinit twd_calibrate_rate(void)
 	 * the timer ticks
 	 */
 	if (twd_timer_rate == 0) {
-		printk(KERN_INFO "Calibrating local timer... ");
+		pr_info("Calibrating local timer... ");
 
 		/* Wait for a tick to start */
 		waitjiffies = get_jiffies_64() + 1;
@@ -113,8 +116,9 @@ static void __cpuinit twd_calibrate_rate(void)
 
 		twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
 
-		printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
-			(twd_timer_rate / 100000) % 100);
+		pr_cont("%lu.%02luMHz\n",
+			twd_timer_rate / 1000000,
+			(twd_timer_rate / 10000) % 100);
 	}
 
 	load = twd_timer_rate / HZ;



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] arch/arm/kernel/smp_twd.c: Correct local timer printk decimal output
@ 2010-11-08 19:27 ` Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2010-11-08 19:27 UTC (permalink / raw)
  To: linux-arm-kernel

The timer decimal place is shown incorrectly.
The %100 divisor needs to have 1 fewer 0.

Convert to pr_<level> while at it.

Uncompiled/untested.

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/arm/kernel/smp_twd.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 35882fb..4f90183 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -8,6 +8,9 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
@@ -89,7 +92,7 @@ static void __cpuinit twd_calibrate_rate(void)
 	 * the timer ticks
 	 */
 	if (twd_timer_rate == 0) {
-		printk(KERN_INFO "Calibrating local timer... ");
+		pr_info("Calibrating local timer... ");
 
 		/* Wait for a tick to start */
 		waitjiffies = get_jiffies_64() + 1;
@@ -113,8 +116,9 @@ static void __cpuinit twd_calibrate_rate(void)
 
 		twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
 
-		printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
-			(twd_timer_rate / 100000) % 100);
+		pr_cont("%lu.%02luMHz\n",
+			twd_timer_rate / 1000000,
+			(twd_timer_rate / 10000) % 100);
 	}
 
 	load = twd_timer_rate / HZ;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] arch/arm/kernel/smp_twd.c: Correct local timer printk decimal output
  2010-11-08 19:27 ` Joe Perches
@ 2010-11-12 16:12   ` Russell King - ARM Linux
  -1 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2010-11-12 16:12 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-arm-kernel, linux-kernel

On Mon, Nov 08, 2010 at 11:27:35AM -0800, Joe Perches wrote:
> The timer decimal place is shown incorrectly.
> The %100 divisor needs to have 1 fewer 0.
> 
> Convert to pr_<level> while at it.

I'd rather avoid core code having KBUILD_MODNAME prefix it.  The message
is unique enough as is.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] arch/arm/kernel/smp_twd.c: Correct local timer printk decimal output
@ 2010-11-12 16:12   ` Russell King - ARM Linux
  0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2010-11-12 16:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 08, 2010 at 11:27:35AM -0800, Joe Perches wrote:
> The timer decimal place is shown incorrectly.
> The %100 divisor needs to have 1 fewer 0.
> 
> Convert to pr_<level> while at it.

I'd rather avoid core code having KBUILD_MODNAME prefix it.  The message
is unique enough as is.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH V2] arch/arm/kernel/smp_twd.c: Correct local timer printk decimal output
  2010-11-08 19:27 ` Joe Perches
@ 2010-11-12 16:34   ` Joe Perches
  -1 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2010-11-12 16:34 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel, linux-arm-kernel

The timer decimal place is shown incorrectly.
The %100 divisor needs to have 1 fewer 0.

Convert to unprefixed pr_<level>/pr_cont while at it.

Uncompiled/untested.

Signed-off-by: Joe Perches <joe@perches.com>
---
V2:

On Fri, 2010-11-12 at 16:12 +0000, Russell King - ARM Linux wrote:
> I'd rather avoid core code having KBUILD_MODNAME prefix it.
> The message is unique enough as is.

Use a local #define pr_fmt(fmt) fmt so if ever
a global change for pr_fmt is made, this won't
need to be changed.

 arch/arm/kernel/smp_twd.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 35882fb..4f90183 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -8,6 +8,9 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+#define pr_fmt(fmt) fmt
+
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
@@ -89,7 +92,7 @@ static void __cpuinit twd_calibrate_rate(void)
 	 * the timer ticks
 	 */
 	if (twd_timer_rate == 0) {
-		printk(KERN_INFO "Calibrating local timer... ");
+		pr_info("Calibrating local timer... ");
 
 		/* Wait for a tick to start */
 		waitjiffies = get_jiffies_64() + 1;
@@ -113,8 +116,9 @@ static void __cpuinit twd_calibrate_rate(void)
 
 		twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
 
-		printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
-			(twd_timer_rate / 100000) % 100);
+		pr_cont("%lu.%02luMHz\n",
+			twd_timer_rate / 1000000,
+			(twd_timer_rate / 10000) % 100);
 	}
 
 	load = twd_timer_rate / HZ;


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH V2] arch/arm/kernel/smp_twd.c: Correct local timer printk decimal output
@ 2010-11-12 16:34   ` Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2010-11-12 16:34 UTC (permalink / raw)
  To: linux-arm-kernel

The timer decimal place is shown incorrectly.
The %100 divisor needs to have 1 fewer 0.

Convert to unprefixed pr_<level>/pr_cont while at it.

Uncompiled/untested.

Signed-off-by: Joe Perches <joe@perches.com>
---
V2:

On Fri, 2010-11-12 at 16:12 +0000, Russell King - ARM Linux wrote:
> I'd rather avoid core code having KBUILD_MODNAME prefix it.
> The message is unique enough as is.

Use a local #define pr_fmt(fmt) fmt so if ever
a global change for pr_fmt is made, this won't
need to be changed.

 arch/arm/kernel/smp_twd.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 35882fb..4f90183 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -8,6 +8,9 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+#define pr_fmt(fmt) fmt
+
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
@@ -89,7 +92,7 @@ static void __cpuinit twd_calibrate_rate(void)
 	 * the timer ticks
 	 */
 	if (twd_timer_rate == 0) {
-		printk(KERN_INFO "Calibrating local timer... ");
+		pr_info("Calibrating local timer... ");
 
 		/* Wait for a tick to start */
 		waitjiffies = get_jiffies_64() + 1;
@@ -113,8 +116,9 @@ static void __cpuinit twd_calibrate_rate(void)
 
 		twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
 
-		printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
-			(twd_timer_rate / 100000) % 100);
+		pr_cont("%lu.%02luMHz\n",
+			twd_timer_rate / 1000000,
+			(twd_timer_rate / 10000) % 100);
 	}
 
 	load = twd_timer_rate / HZ;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-11-12 16:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-08 19:27 [PATCH] arch/arm/kernel/smp_twd.c: Correct local timer printk decimal output Joe Perches
2010-11-08 19:27 ` Joe Perches
2010-11-12 16:12 ` Russell King - ARM Linux
2010-11-12 16:12   ` Russell King - ARM Linux
2010-11-12 16:34 ` [PATCH V2] " Joe Perches
2010-11-12 16:34   ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.