netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [trivial PATCH] treewide: Fix printks with 0x%#
@ 2013-07-25 18:53 Joe Perches
  2013-07-26  5:35 ` Takashi Iwai
  2013-08-27  5:39 ` Mike Frysinger
  0 siblings, 2 replies; 4+ messages in thread
From: Joe Perches @ 2013-07-25 18:53 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: James E.J. Bottomley, Helge Deller, John Stultz, Thomas Gleixner,
	Daniele Venzano, Andi Kleen, Jaroslav Kysela, Takashi Iwai,
	linux-parisc, linux-kernel, netdev, linux-mm, alsa-devel


Using 0x%# emits 0x0x.  Only one is necessary.

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/parisc/kernel/signal.c       | 2 +-
 drivers/clocksource/acpi_pm.c     | 4 ++--
 drivers/net/ethernet/sis/sis900.c | 2 +-
 mm/memory-failure.c               | 2 +-
 sound/pci/ens1370.c               | 2 +-
 sound/pci/via82xx.c               | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c
index 940188d..35c5bf1 100644
--- a/arch/parisc/kernel/signal.c
+++ b/arch/parisc/kernel/signal.c
@@ -85,7 +85,7 @@ restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs)
 	err |= __copy_from_user(regs->iaoq, sc->sc_iaoq, sizeof(regs->iaoq));
 	err |= __copy_from_user(regs->iasq, sc->sc_iasq, sizeof(regs->iasq));
 	err |= __get_user(regs->sar, &sc->sc_sar);
-	DBG(2,"restore_sigcontext: iaoq is 0x%#lx / 0x%#lx\n", 
+	DBG(2,"restore_sigcontext: iaoq is %#lx / %#lx\n",
 			regs->iaoq[0],regs->iaoq[1]);
 	DBG(2,"restore_sigcontext: r28 is %ld\n", regs->gr[28]);
 	return err;
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
index 6efe4d1..6eab889 100644
--- a/drivers/clocksource/acpi_pm.c
+++ b/drivers/clocksource/acpi_pm.c
@@ -200,14 +200,14 @@ static int __init init_acpi_pm_clocksource(void)
 			if ((value2 < value1) && ((value2) < 0xFFF))
 				break;
 			printk(KERN_INFO "PM-Timer had inconsistent results:"
-			       " 0x%#llx, 0x%#llx - aborting.\n",
+			       " %#llx, %#llx - aborting.\n",
 			       value1, value2);
 			pmtmr_ioport = 0;
 			return -EINVAL;
 		}
 		if (i == ACPI_PM_READ_CHECKS) {
 			printk(KERN_INFO "PM-Timer failed consistency check "
-			       " (0x%#llx) - aborting.\n", value1);
+			       " (%#llx) - aborting.\n", value1);
 			pmtmr_ioport = 0;
 			return -ENODEV;
 		}
diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c
index eb4aea3..6c1e34c 100644
--- a/drivers/net/ethernet/sis/sis900.c
+++ b/drivers/net/ethernet/sis/sis900.c
@@ -1723,7 +1723,7 @@ static irqreturn_t sis900_interrupt(int irq, void *dev_instance)
 
 	if(netif_msg_intr(sis_priv))
 		printk(KERN_DEBUG "%s: exiting interrupt, "
-		       "interrupt status = 0x%#8.8x.\n",
+		       "interrupt status = %#8.8x\n",
 		       net_dev->name, sr32(isr));
 
 	spin_unlock (&sis_priv->lock);
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 09ae111..29d3f38 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1267,7 +1267,7 @@ void memory_failure_queue(unsigned long pfn, int trapno, int flags)
 	if (kfifo_put(&mf_cpu->fifo, &entry))
 		schedule_work_on(smp_processor_id(), &mf_cpu->work);
 	else
-		pr_err("Memory failure: buffer overflow when queuing memory failure at 0x%#lx\n",
+		pr_err("Memory failure: buffer overflow when queuing memory failure at %#lx\n",
 		       pfn);
 	spin_unlock_irqrestore(&mf_cpu->lock, proc_flags);
 	put_cpu_var(memory_failure_cpu);
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index ca8929b..61262f3 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -1842,7 +1842,7 @@ static int snd_ensoniq_create_gameport(struct ensoniq *ensoniq, int dev)
 
 	default:
 		if (!request_region(io_port, 8, "ens137x: gameport")) {
-			printk(KERN_WARNING "ens137x: gameport io port 0x%#x in use\n",
+			printk(KERN_WARNING "ens137x: gameport io port %#x in use\n",
 			       io_port);
 			return -EBUSY;
 		}
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 3c511d0..5ae6f04 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -1940,7 +1940,7 @@ static int snd_via686_create_gameport(struct via82xx *chip, unsigned char *legac
 
 	r = request_region(JOYSTICK_ADDR, 8, "VIA686 gameport");
 	if (!r) {
-		printk(KERN_WARNING "via82xx: cannot reserve joystick port 0x%#x\n",
+		printk(KERN_WARNING "via82xx: cannot reserve joystick port %#x\n",
 		       JOYSTICK_ADDR);
 		return -EBUSY;
 	}



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [trivial PATCH] treewide: Fix printks with 0x%#
  2013-07-25 18:53 [trivial PATCH] treewide: Fix printks with 0x%# Joe Perches
@ 2013-07-26  5:35 ` Takashi Iwai
  2013-08-27  5:39 ` Mike Frysinger
  1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2013-07-26  5:35 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jiri Kosina, James E.J. Bottomley, Helge Deller, John Stultz,
	Thomas Gleixner, Daniele Venzano, Andi Kleen, Jaroslav Kysela,
	linux-parisc, linux-kernel, netdev, linux-mm, alsa-devel

At Thu, 25 Jul 2013 11:53:25 -0700,
Joe Perches wrote:
> 
> 
> Using 0x%# emits 0x0x.  Only one is necessary.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi

> ---
>  arch/parisc/kernel/signal.c       | 2 +-
>  drivers/clocksource/acpi_pm.c     | 4 ++--
>  drivers/net/ethernet/sis/sis900.c | 2 +-
>  mm/memory-failure.c               | 2 +-
>  sound/pci/ens1370.c               | 2 +-
>  sound/pci/via82xx.c               | 2 +-
>  6 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c
> index 940188d..35c5bf1 100644
> --- a/arch/parisc/kernel/signal.c
> +++ b/arch/parisc/kernel/signal.c
> @@ -85,7 +85,7 @@ restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs)
>  	err |= __copy_from_user(regs->iaoq, sc->sc_iaoq, sizeof(regs->iaoq));
>  	err |= __copy_from_user(regs->iasq, sc->sc_iasq, sizeof(regs->iasq));
>  	err |= __get_user(regs->sar, &sc->sc_sar);
> -	DBG(2,"restore_sigcontext: iaoq is 0x%#lx / 0x%#lx\n", 
> +	DBG(2,"restore_sigcontext: iaoq is %#lx / %#lx\n",
>  			regs->iaoq[0],regs->iaoq[1]);
>  	DBG(2,"restore_sigcontext: r28 is %ld\n", regs->gr[28]);
>  	return err;
> diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
> index 6efe4d1..6eab889 100644
> --- a/drivers/clocksource/acpi_pm.c
> +++ b/drivers/clocksource/acpi_pm.c
> @@ -200,14 +200,14 @@ static int __init init_acpi_pm_clocksource(void)
>  			if ((value2 < value1) && ((value2) < 0xFFF))
>  				break;
>  			printk(KERN_INFO "PM-Timer had inconsistent results:"
> -			       " 0x%#llx, 0x%#llx - aborting.\n",
> +			       " %#llx, %#llx - aborting.\n",
>  			       value1, value2);
>  			pmtmr_ioport = 0;
>  			return -EINVAL;
>  		}
>  		if (i == ACPI_PM_READ_CHECKS) {
>  			printk(KERN_INFO "PM-Timer failed consistency check "
> -			       " (0x%#llx) - aborting.\n", value1);
> +			       " (%#llx) - aborting.\n", value1);
>  			pmtmr_ioport = 0;
>  			return -ENODEV;
>  		}
> diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c
> index eb4aea3..6c1e34c 100644
> --- a/drivers/net/ethernet/sis/sis900.c
> +++ b/drivers/net/ethernet/sis/sis900.c
> @@ -1723,7 +1723,7 @@ static irqreturn_t sis900_interrupt(int irq, void *dev_instance)
>  
>  	if(netif_msg_intr(sis_priv))
>  		printk(KERN_DEBUG "%s: exiting interrupt, "
> -		       "interrupt status = 0x%#8.8x.\n",
> +		       "interrupt status = %#8.8x\n",
>  		       net_dev->name, sr32(isr));
>  
>  	spin_unlock (&sis_priv->lock);
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 09ae111..29d3f38 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1267,7 +1267,7 @@ void memory_failure_queue(unsigned long pfn, int trapno, int flags)
>  	if (kfifo_put(&mf_cpu->fifo, &entry))
>  		schedule_work_on(smp_processor_id(), &mf_cpu->work);
>  	else
> -		pr_err("Memory failure: buffer overflow when queuing memory failure at 0x%#lx\n",
> +		pr_err("Memory failure: buffer overflow when queuing memory failure at %#lx\n",
>  		       pfn);
>  	spin_unlock_irqrestore(&mf_cpu->lock, proc_flags);
>  	put_cpu_var(memory_failure_cpu);
> diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
> index ca8929b..61262f3 100644
> --- a/sound/pci/ens1370.c
> +++ b/sound/pci/ens1370.c
> @@ -1842,7 +1842,7 @@ static int snd_ensoniq_create_gameport(struct ensoniq *ensoniq, int dev)
>  
>  	default:
>  		if (!request_region(io_port, 8, "ens137x: gameport")) {
> -			printk(KERN_WARNING "ens137x: gameport io port 0x%#x in use\n",
> +			printk(KERN_WARNING "ens137x: gameport io port %#x in use\n",
>  			       io_port);
>  			return -EBUSY;
>  		}
> diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
> index 3c511d0..5ae6f04 100644
> --- a/sound/pci/via82xx.c
> +++ b/sound/pci/via82xx.c
> @@ -1940,7 +1940,7 @@ static int snd_via686_create_gameport(struct via82xx *chip, unsigned char *legac
>  
>  	r = request_region(JOYSTICK_ADDR, 8, "VIA686 gameport");
>  	if (!r) {
> -		printk(KERN_WARNING "via82xx: cannot reserve joystick port 0x%#x\n",
> +		printk(KERN_WARNING "via82xx: cannot reserve joystick port %#x\n",
>  		       JOYSTICK_ADDR);
>  		return -EBUSY;
>  	}
> 
> 
> 

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

* Re: [trivial PATCH] treewide: Fix printks with 0x%#
  2013-07-25 18:53 [trivial PATCH] treewide: Fix printks with 0x%# Joe Perches
  2013-07-26  5:35 ` Takashi Iwai
@ 2013-08-27  5:39 ` Mike Frysinger
  2013-08-27  6:00   ` Joe Perches
  1 sibling, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2013-08-27  5:39 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jiri Kosina, James E.J. Bottomley, Helge Deller, John Stultz,
	Thomas Gleixner, Daniele Venzano, Andi Kleen, Jaroslav Kysela,
	Takashi Iwai, linux-parisc, linux-kernel, netdev, linux-mm,
	alsa-devel

[-- Attachment #1: Type: Text/Plain, Size: 148 bytes --]

On Thursday 25 July 2013 14:53:25 Joe Perches wrote:
> Using 0x%# emits 0x0x.  Only one is necessary.

sounds like a job for checkpatch.pl :)
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [trivial PATCH] treewide: Fix printks with 0x%#
  2013-08-27  5:39 ` Mike Frysinger
@ 2013-08-27  6:00   ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2013-08-27  6:00 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Jiri Kosina, James E.J. Bottomley, Helge Deller, John Stultz,
	Thomas Gleixner, Daniele Venzano, Andi Kleen, Jaroslav Kysela,
	Takashi Iwai, linux-parisc, linux-kernel, netdev, linux-mm,
	alsa-devel

On Tue, 2013-08-27 at 01:39 -0400, Mike Frysinger wrote:
> On Thursday 25 July 2013 14:53:25 Joe Perches wrote:
> > Using 0x%# emits 0x0x.  Only one is necessary.
> 
> sounds like a job for checkpatch.pl :)

Here.  Submit it yourself...
---
 scripts/checkpatch.pl | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9ba4fc4..520f8e7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3869,6 +3869,18 @@ sub process {
 			}
 		}
 
+# check for formats with "0x%#"
+		if ($line =~ /"X*"/) {
+			my $fmt = get_quoted_string($line, $rawline);
+			if ($fmt =~ /0x%#/) {
+				if (WARN("REDUNDANT_HEX",
+					 "Redundant hex prefix 0x format\n" . $herecurr) &&
+				    $fix) {
+					$fixed[$linenr - 1] =~ s/0x%#/%#/g;
+				}
+			}
+		}
+
 # Check for misused memsets
 		if ($^V && $^V ge 5.10.0 &&
 		    defined $stat &&




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

end of thread, other threads:[~2013-08-27  6:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-25 18:53 [trivial PATCH] treewide: Fix printks with 0x%# Joe Perches
2013-07-26  5:35 ` Takashi Iwai
2013-08-27  5:39 ` Mike Frysinger
2013-08-27  6:00   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).