Skip to contentSkip to conversation

ALSA: don't push static constants on stack for %*ph

PATCH Applied Andy Shevchenko 2 participants 2 messages Aug 7, 2013 – Aug 8, 2013 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: don't push static constants on stack for %*ph

There is no need to pass constants via stack. The width may be explicitly specified in the format.

---
 sound/isa/gus/interwave.c  | 3 +--
 sound/usb/6fire/firmware.c | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
sound/isa/gus/interwave.c +1 -2
index 9942691..afef0d7 100644
@@ -443,8 +443,7 @@ static void snd_interwave_detect_memory(struct snd_gus_card *gus)
 		for (i = 0; i < 8; ++i)
 			iwave[i] = snd_gf1_peek(gus, bank_pos + i);
 #ifdef CONFIG_SND_DEBUG_ROM
-		printk(KERN_DEBUG "ROM at 0x%06x = %*phC\n", bank_pos,
-				  8, iwave);
+		printk(KERN_DEBUG "ROM at 0x%06x = %8phC\n", bank_pos, iwave);
 #endif
 		if (strncmp(iwave, "INTRWAVE", 8))
 			continue;	/* first check */
sound/usb/6fire/firmware.c +2 -2
index b9defcd..780bf3f 100644
@@ -346,10 +346,10 @@ static int usb6fire_fw_check(u8 *version)
 		if (!memcmp(version, known_fw_versions + i, 2))
 			return 0;
 
-	snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %*ph. "
+	snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %4ph. "
 			"please reconnect to power. if this failure "
 			"still happens, check your firmware installation.",
-			4, version);
+			version);
 	return -EINVAL;
 }
 
Signature · 1 line
1.8.4.rc1
Applied
#1 lore raw

At Wed, 7 Aug 2013 17:55:14 +0300,

Quoted 5 lines · Andy Shevchenko

There is no need to pass constants via stack. The width may be explicitly specified in the format.

Thanks, applied.

Takashi

Quoted 39 lines
---
 sound/isa/gus/interwave.c  | 3 +--
 sound/usb/6fire/firmware.c | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
sound/isa/gus/interwave.c +1 -2
index 9942691..afef0d7 100644
@@ -443,8 +443,7 @@ static void snd_interwave_detect_memory(struct snd_gus_card *gus)
 		for (i = 0; i < 8; ++i)
 			iwave[i] = snd_gf1_peek(gus, bank_pos + i);
 #ifdef CONFIG_SND_DEBUG_ROM
-		printk(KERN_DEBUG "ROM at 0x%06x = %*phC\n", bank_pos,
-				  8, iwave);
+		printk(KERN_DEBUG "ROM at 0x%06x = %8phC\n", bank_pos, iwave);
 #endif
 		if (strncmp(iwave, "INTRWAVE", 8))
 			continue;	/* first check */
sound/usb/6fire/firmware.c +2 -2
index b9defcd..780bf3f 100644
@@ -346,10 +346,10 @@ static int usb6fire_fw_check(u8 *version)
 		if (!memcmp(version, known_fw_versions + i, 2))
 			return 0;
 
-	snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %*ph. "
+	snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %4ph. "
 			"please reconnect to power. if this failure "
 			"still happens, check your firmware installation.",
-			4, version);
+			version);
 	return -EINVAL;
 }
 
Signature · 1 line
1.8.4.rc1