[alsa-devel] [PATCH 00/10] treewide: Fix format strings that misuse continuations
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(-)
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;
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.
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.
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
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).
participants (3)
-
Joe Perches
-
Mark Brown
-
Mike Frysinger