linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] treewide: Fix format strings that misuse continuations
@ 2010-01-31 20:02 Joe Perches
  2010-01-31 20:02 ` [PATCH 09/10] mm/slab.c: Fix continuation line formats Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2010-01-31 20:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mike Frysinger, Benjamin Herrenschmidt, Paul Mackerras,
	David S. Miller, James E.J. Bottomley, Sonic Zhang,
	Greg Kroah-Hartman, Christoph Lameter, Pekka Enberg, Matt Mackall,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	uclinux-dist-devel, linuxppc-dev, linux-ide, netdev, linux-scsi,
	devel, linux-mm, alsa-devel

Format strings that are continued with \ are frequently misused.
Change them to use mostly single line formats, some longer than 80 chars.
Fix a few miscellaneous typos at the same time.

Joe Perches (10):
  arch/powerpc: Fix continuation line formats
  arch/blackfin: Fix continuation line formats
  drivers/ide: Fix continuation line formats
  drivers/serial/bfin_5xx.c: Fix continuation line formats
  drivers/scsi/arcmsr: Fix continuation line formats
  drivers/staging: Fix continuation line formats
  drivers/net/amd8111e.c: Fix continuation line formats
  fs/proc/array.c: Fix continuation line formats
  mm/slab.c: Fix continuation line formats
  sound/soc/blackfin: Fix continuation line formats

 arch/blackfin/mach-common/smp.c                    |    4 +-
 arch/powerpc/kernel/nvram_64.c                     |    6 +-
 arch/powerpc/platforms/pseries/hotplug-cpu.c       |    8 ++--
 arch/powerpc/platforms/pseries/smp.c               |    4 +-
 drivers/ide/au1xxx-ide.c                           |    4 +-
 drivers/ide/pmac.c                                 |    4 +-
 drivers/net/amd8111e.c                             |    3 +-
 drivers/scsi/arcmsr/arcmsr_hba.c                   |   49 +++++++++----------
 drivers/serial/bfin_5xx.c                          |    6 +--
 drivers/staging/dream/qdsp5/audio_mp3.c            |    3 +-
 .../rtl8187se/ieee80211/ieee80211_softmac_wx.c     |    3 +-
 drivers/staging/rtl8187se/r8180_core.c             |    3 +-
 drivers/staging/sep/sep_driver.c                   |    3 +-
 fs/proc/array.c                                    |    7 ++-
 mm/slab.c                                          |    4 +-
 sound/soc/blackfin/bf5xx-ac97-pcm.c                |    8 +--
 sound/soc/blackfin/bf5xx-i2s-pcm.c                 |    3 +-
 sound/soc/blackfin/bf5xx-tdm-pcm.c                 |    3 +-
 18 files changed, 55 insertions(+), 70 deletions(-)

--
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	[flat|nested] 7+ messages in thread

* [PATCH 09/10] mm/slab.c: Fix continuation line formats
  2010-01-31 20:02 [PATCH 00/10] treewide: Fix format strings that misuse continuations Joe Perches
@ 2010-01-31 20:02 ` Joe Perches
  2010-01-31 20:08   ` Matt Mackall
  2010-01-31 20:32   ` Frans Pop
  0 siblings, 2 replies; 7+ messages in thread
From: Joe Perches @ 2010-01-31 20:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: Christoph Lameter, Pekka Enberg, Matt Mackall, linux-mm

String constants that are continued on subsequent lines with \
are not good.

The characters between seq_printf elements are tabs.
That was probably not intentional, but isn't being changed.
It's behind an #ifdef, so it could probably become a single space.

Signed-off-by: Joe Perches <joe@perches.com>
---
 mm/slab.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 7451bda..9964619 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -4228,8 +4228,8 @@ static int s_show(struct seq_file *m, void *p)
 		unsigned long node_frees = cachep->node_frees;
 		unsigned long overflows = cachep->node_overflow;
 
-		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu \
-				%4lu %4lu %4lu %4lu %4lu", allocs, high, grown,
+		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu 				%4lu %4lu %4lu %4lu %4lu",
+				allocs, high, grown,
 				reaped, errors, max_freeable, node_allocs,
 				node_frees, overflows);
 	}
-- 
1.6.6.rc0.57.gad7a

--
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] 7+ messages in thread

* Re: [PATCH 09/10] mm/slab.c: Fix continuation line formats
  2010-01-31 20:02 ` [PATCH 09/10] mm/slab.c: Fix continuation line formats Joe Perches
@ 2010-01-31 20:08   ` Matt Mackall
  2010-01-31 20:13     ` Joe Perches
  2010-01-31 20:32   ` Frans Pop
  1 sibling, 1 reply; 7+ messages in thread
From: Matt Mackall @ 2010-01-31 20:08 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, Christoph Lameter, Pekka Enberg, linux-mm

On Sun, 2010-01-31 at 12:02 -0800, Joe Perches wrote:
> String constants that are continued on subsequent lines with \
> are not good.

> The characters between seq_printf elements are tabs.
> That was probably not intentional, but isn't being changed.
> It's behind an #ifdef, so it could probably become a single space.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  mm/slab.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index 7451bda..9964619 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -4228,8 +4228,8 @@ static int s_show(struct seq_file *m, void *p)
>  		unsigned long node_frees = cachep->node_frees;
>  		unsigned long overflows = cachep->node_overflow;
>  
> -		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu \
> -				%4lu %4lu %4lu %4lu %4lu", allocs, high, grown,
> +		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu 				%4lu %4lu %4lu %4lu %4lu",
> +				allocs, high, grown,

Yuck. The right way to do this is by mergeable adjacent strings, eg:

printk("part 1..."
       " part 2...", ...);

-- 
http://selenic.com : development and support for Mercurial and Linux


--
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	[flat|nested] 7+ messages in thread

* Re: [PATCH 09/10] mm/slab.c: Fix continuation line formats
  2010-01-31 20:08   ` Matt Mackall
@ 2010-01-31 20:13     ` Joe Perches
  0 siblings, 0 replies; 7+ messages in thread
From: Joe Perches @ 2010-01-31 20:13 UTC (permalink / raw)
  To: Matt Mackall; +Cc: linux-kernel, Christoph Lameter, Pekka Enberg, linux-mm

On Sun, 2010-01-31 at 14:08 -0600, Matt Mackall wrote:
> On Sun, 2010-01-31 at 12:02 -0800, Joe Perches wrote:
> > diff --git a/mm/slab.c b/mm/slab.c
> > index 7451bda..9964619 100644
> > --- a/mm/slab.c
> > +++ b/mm/slab.c
> > @@ -4228,8 +4228,8 @@ static int s_show(struct seq_file *m, void *p)
> >  		unsigned long node_frees = cachep->node_frees;
> >  		unsigned long overflows = cachep->node_overflow;
> >  
> > -		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu \
> > -				%4lu %4lu %4lu %4lu %4lu", allocs, high, grown,
> > +		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu 				%4lu %4lu %4lu %4lu %4lu",
> > +				allocs, high, grown,
> 
> Yuck. The right way to do this is by mergeable adjacent strings, eg:
> 
> printk("part 1..."
>        " part 2...", ...);

Yuck indeed.

I think format strings shouldn't be split across multiple lines and
the right thing to do is to use a single space instead of the tabs.



--
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	[flat|nested] 7+ messages in thread

* Re: [PATCH 09/10] mm/slab.c: Fix continuation line formats
  2010-01-31 20:02 ` [PATCH 09/10] mm/slab.c: Fix continuation line formats Joe Perches
  2010-01-31 20:08   ` Matt Mackall
@ 2010-01-31 20:32   ` Frans Pop
  2010-01-31 20:38     ` Joe Perches
  1 sibling, 1 reply; 7+ messages in thread
From: Frans Pop @ 2010-01-31 20:32 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, cl, penberg, mpm, linux-mm

Joe Perches wrote:
> String constants that are continued on subsequent lines with \
> are not good.

Fun. I'd done the same grep earlier today. AFAICT you've got all the
ones I had.

> The characters between seq_printf elements are tabs.
> That was probably not intentional, but isn't being changed.
> It's behind an #ifdef, so it could probably become a single space.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  mm/slab.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index 7451bda..9964619 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -4228,8 +4228,8 @@ static int s_show(struct seq_file *m, void *p)
>  unsigned long node_frees = cachep->node_frees;
>  unsigned long overflows = cachep->node_overflow;
>  
> -		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu \
> -				%4lu %4lu %4lu %4lu %4lu", allocs, high, grown,
> +		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu 				%4lu %4lu %4lu %4lu %4lu",
> +				allocs, high, grown,
>  				reaped, errors, max_freeable, node_allocs,
>  				node_frees, overflows);
>  }

If that spacing part is really needed (is it?), wouldn't it be more
readable as:
> +		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu"
> +				" 				"
> +				"%4lu %4lu %4lu %4lu %4lu",  
> +				allocs, high, grown,

Also, are there supposed to be tabs in that spacing part?

Cheers,
FJP

--
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	[flat|nested] 7+ messages in thread

* Re: [PATCH 09/10] mm/slab.c: Fix continuation line formats
  2010-01-31 20:32   ` Frans Pop
@ 2010-01-31 20:38     ` Joe Perches
  2010-01-31 23:53       ` Frans Pop
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2010-01-31 20:38 UTC (permalink / raw)
  To: Frans Pop; +Cc: linux-kernel, cl, penberg, mpm, linux-mm

On Sun, 2010-01-31 at 21:32 +0100, Frans Pop wrote:
> If that spacing part is really needed (is it?), wouldn't it be more
> readable as:
> > +		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu"
> > +				" 				"
> > +				"%4lu %4lu %4lu %4lu %4lu",  
> > +				allocs, high, grown,

If it's required (most likely not, but it's a seq_printf and
some people think those should never be modified because it's
a public interface), it should probably be explicit:

" : globalstat %7lu %6lu %5lu %4lu \t\t\t\t%4lu %4lu %4lu %4lu %4lu"



--
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	[flat|nested] 7+ messages in thread

* Re: [PATCH 09/10] mm/slab.c: Fix continuation line formats
  2010-01-31 20:38     ` Joe Perches
@ 2010-01-31 23:53       ` Frans Pop
  0 siblings, 0 replies; 7+ messages in thread
From: Frans Pop @ 2010-01-31 23:53 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, cl, penberg, mpm, linux-mm

On Sunday 31 January 2010, Joe Perches wrote:
> On Sun, 2010-01-31 at 21:32 +0100, Frans Pop wrote:
> > If that spacing part is really needed (is it?), wouldn't it be more
> >
> > readable as:
> > > +		seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu"
> > > +				" 				"
> > > +				"%4lu %4lu %4lu %4lu %4lu",
> > > +				allocs, high, grown,
>
> If it's required (most likely not, but it's a seq_printf and
> some people think those should never be modified because it's
> a public interface), it should probably be explicit:
>
> " : globalstat %7lu %6lu %5lu %4lu \t\t\t\t%4lu %4lu %4lu %4lu %4lu"

Yes, would be better. And if it is kept for compatibility it probably 
deserves a comment explaining the weirdness.

Cheers,
FJP

--
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	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-01-31 23:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-31 20:02 [PATCH 00/10] treewide: Fix format strings that misuse continuations Joe Perches
2010-01-31 20:02 ` [PATCH 09/10] mm/slab.c: Fix continuation line formats Joe Perches
2010-01-31 20:08   ` Matt Mackall
2010-01-31 20:13     ` Joe Perches
2010-01-31 20:32   ` Frans Pop
2010-01-31 20:38     ` Joe Perches
2010-01-31 23:53       ` Frans Pop

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).