alsa-devel.alsa-project.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 10/10] sound/soc/blackfin: Fix continuation line formats Joe Perches
  0 siblings, 1 reply; 6+ 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(-)


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

* [PATCH 10/10] sound/soc/blackfin: 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-02-01 14:47   ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2010-01-31 20:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	alsa-devel

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

Signed-off-by: Joe Perches <joe@perches.com>
---
 sound/soc/blackfin/bf5xx-ac97-pcm.c |    8 ++------
 sound/soc/blackfin/bf5xx-i2s-pcm.c  |    3 +--
 sound/soc/blackfin/bf5xx-tdm-pcm.c  |    3 +--
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c
index cf0dfb7..67cbfe7 100644
--- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
+++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
@@ -349,9 +349,7 @@ static int bf5xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
 			sport_handle->tx_dma_buf = dma_alloc_coherent(NULL, \
 				size, &sport_handle->tx_dma_phy, GFP_KERNEL);
 			if (!sport_handle->tx_dma_buf) {
-				pr_err("Failed to allocate memory for tx dma \
-					buf - Please increase uncached DMA \
-					memory region\n");
+				pr_err("Failed to allocate memory for tx dma buf - Please increase uncached DMA memory region\n");
 				return -ENOMEM;
 			} else
 				memset(sport_handle->tx_dma_buf, 0, size);
@@ -362,9 +360,7 @@ static int bf5xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
 			sport_handle->rx_dma_buf = dma_alloc_coherent(NULL, \
 				size, &sport_handle->rx_dma_phy, GFP_KERNEL);
 			if (!sport_handle->rx_dma_buf) {
-				pr_err("Failed to allocate memory for rx dma \
-					buf - Please increase uncached DMA \
-					memory region\n");
+				pr_err("Failed to allocate memory for rx dma buf - Please increase uncached DMA memory region\n");
 				return -ENOMEM;
 			} else
 				memset(sport_handle->rx_dma_buf, 0, size);
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c
index 62fbb84..c6c6a4a 100644
--- a/sound/soc/blackfin/bf5xx-i2s-pcm.c
+++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
@@ -207,8 +207,7 @@ static int bf5xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
 	buf->area = dma_alloc_coherent(pcm->card->dev, size,
 			&buf->addr, GFP_KERNEL);
 	if (!buf->area) {
-		pr_err("Failed to allocate dma memory \
-			Please increase uncached DMA memory region\n");
+		pr_err("Failed to allocate dma memory - Please increase uncached DMA memory region\n");
 		return -ENOMEM;
 	}
 	buf->bytes = size;
diff --git a/sound/soc/blackfin/bf5xx-tdm-pcm.c b/sound/soc/blackfin/bf5xx-tdm-pcm.c
index a8c73cb..5e03bb2 100644
--- a/sound/soc/blackfin/bf5xx-tdm-pcm.c
+++ b/sound/soc/blackfin/bf5xx-tdm-pcm.c
@@ -244,8 +244,7 @@ static int bf5xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
 	buf->area = dma_alloc_coherent(pcm->card->dev, size * 4,
 		&buf->addr, GFP_KERNEL);
 	if (!buf->area) {
-		pr_err("Failed to allocate dma memory \
-			Please increase uncached DMA memory region\n");
+		pr_err("Failed to allocate dma memory - Please increase uncached DMA memory region\n");
 		return -ENOMEM;
 	}
 	buf->bytes = size;
-- 
1.6.6.rc0.57.gad7a

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

* Re: [PATCH 10/10] sound/soc/blackfin: Fix continuation line formats
  2010-01-31 20:02 ` [PATCH 10/10] sound/soc/blackfin: Fix continuation line formats Joe Perches
@ 2010-02-01 14:47   ` Mark Brown
  2010-02-01 17:08     ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2010-02-01 14:47 UTC (permalink / raw)
  To: Joe Perches; +Cc: Takashi Iwai, alsa-devel, linux-kernel, Liam Girdwood

On Sun, Jan 31, 2010 at 12:02:12PM -0800, Joe Perches wrote:
> String constants that are continued on subsequent lines with \
> are not good.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Gah, I thought I'd caught most of these when reviewing.  If you're using
a script to pick this stuff up it'd be worth checking for extraneous
continuations in the middle of code - outside of macros there's little
call for it.

Applied, thanks.

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

* Re: [PATCH 10/10] sound/soc/blackfin: Fix continuation line formats
  2010-02-01 14:47   ` Mark Brown
@ 2010-02-01 17:08     ` Joe Perches
  2010-02-02  4:13       ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2010-02-01 17:08 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	alsa-devel

On Mon, 2010-02-01 at 14:47 +0000, Mark Brown wrote:
> On Sun, Jan 31, 2010 at 12:02:12PM -0800, Joe Perches wrote:
> > String constants that are continued on subsequent lines with \
> > are not good.
> > 
> > Signed-off-by: Joe Perches <joe@perches.com>
> 
> Gah, I thought I'd caught most of these when reviewing.  If you're using
> a script to pick this stuff up it'd be worth checking for extraneous
> continuations in the middle of code - outside of macros there's little
> call for it.
> 
> Applied, thanks.

There are a few false positives and probably a few missing using

        grep -rP --include=*.[ch] '".*\\$' * | \
        awk '{ if ((gsub("\"", "\"") % 2) == 1) print $0; }'
        
Most of the uses are __asm__ __volatile__ which could be
considered unsightly but don't impact logging messages.

The rest could/should be fixed.

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

* Re: [PATCH 10/10] sound/soc/blackfin: Fix continuation line formats
  2010-02-01 17:08     ` Joe Perches
@ 2010-02-02  4:13       ` Mike Frysinger
  2010-02-02 11:08         ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2010-02-02  4:13 UTC (permalink / raw)
  To: Joe Perches
  Cc: alsa-devel, Takashi Iwai, Mark Brown, linux-kernel, Liam Girdwood

On Mon, Feb 1, 2010 at 12:08, Joe Perches wrote:
> On Mon, 2010-02-01 at 14:47 +0000, Mark Brown wrote:
>> On Sun, Jan 31, 2010 at 12:02:12PM -0800, Joe Perches wrote:
>> > String constants that are continued on subsequent lines with \
>> > are not good.
>> >
>> > Signed-off-by: Joe Perches <joe@perches.com>
>>
>> Gah, I thought I'd caught most of these when reviewing.  If you're using
>> a script to pick this stuff up it'd be worth checking for extraneous
>> continuations in the middle of code - outside of macros there's little
>> call for it.
>>
>> Applied, thanks.
>
> There are a few false positives and probably a few missing using
>
>        grep -rP --include=*.[ch] '".*\\$' * | \
>        awk '{ if ((gsub("\"", "\"") % 2) == 1) print $0; }'
>
> Most of the uses are __asm__ __volatile__ which could be
> considered unsightly but don't impact logging messages.
>
> The rest could/should be fixed.

*cough* checkpatch.pl *cough*

the Blackfin alsa fixes all look good to me, thanks
-mike
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH 10/10] sound/soc/blackfin: Fix continuation line formats
  2010-02-02  4:13       ` Mike Frysinger
@ 2010-02-02 11:08         ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2010-02-02 11:08 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: alsa-devel, Takashi Iwai, linux-kernel, Joe Perches,
	Liam Girdwood

On Mon, Feb 01, 2010 at 11:13:04PM -0500, Mike Frysinger wrote:
> On Mon, Feb 1, 2010 at 12:08, Joe Perches wrote:

> > There are a few false positives and probably a few missing using

> >        grep -rP --include=*.[ch] '".*\\$' * | \
> >        awk '{ if ((gsub("\"", "\"") % 2) == 1) print $0; }'

> > Most of the uses are __asm__ __volatile__ which could be
> > considered unsightly but don't impact logging messages.

> > The rest could/should be fixed.

My point was that it'd be good to also check for just regular use of
continuations in code other than macro definitions.  These are just a
style nit but if there's a script that filters out false positives from
the macros that'd be handy...

> the Blackfin alsa fixes all look good to me, thanks

Running "grep ' \\$' sound/soc/blackfin/*.[ch]" suggests that there's
still some of the continuations I mentioned above in there (plus a lot
of false positives from macros).

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

end of thread, other threads:[~2010-02-02 11:08 UTC | newest]

Thread overview: 6+ 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 10/10] sound/soc/blackfin: Fix continuation line formats Joe Perches
2010-02-01 14:47   ` Mark Brown
2010-02-01 17:08     ` Joe Perches
2010-02-02  4:13       ` Mike Frysinger
2010-02-02 11:08         ` Mark Brown

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