Skip to content

Commit 7590ac2

Browse files
arndbtiwai
authored andcommitted
ALSA: aoa: avoid false-positive format truncation warning
clang warns about what it interprets as a truncated snprintf: sound/aoa/soundbus/i2sbus/core.c:171:6: error: 'snprintf' will always be truncated; specified size is 6, but format string expands to at least 7 [-Werror,-Wformat-truncation-non-kprintf] The actual problem here is that it does not understand the special %pOFn format string and assumes that it is a pointer followed by the string "OFn", which would indeed not fit. Slightly increasing the size of the buffer to its natural alignment avoids the warning, as it is now long enough for the correct and the incorrect interprations. Fixes: b917d58 ("ALSA: aoa: Convert to using %pOFn instead of device_node.name") Signed-off-by: Arnd Bergmann <[email protected]> Message-ID: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 051e084 commit 7590ac2

File tree

1 file changed

+1
-1
lines changed
  • sound/aoa/soundbus/i2sbus

1 file changed

+1
-1
lines changed

sound/aoa/soundbus/i2sbus/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
158158
struct device_node *child, *sound = NULL;
159159
struct resource *r;
160160
int i, layout = 0, rlen, ok = force;
161-
char node_name[6];
161+
char node_name[8];
162162
static const char *rnames[] = { "i2sbus: %pOFn (control)",
163163
"i2sbus: %pOFn (tx)",
164164
"i2sbus: %pOFn (rx)" };

0 commit comments

Comments
 (0)