Skip to content

Commit fd38dd6

Browse files
Mirsad Todorovactiwai
authored andcommitted
kselftest/alsa - conf: Stringify the printed errno in sysfs_get()
GCC 13.2.0 reported the warning of the print format specifier: conf.c: In function ‘sysfs_get’: conf.c:181:72: warning: format ‘%s’ expects argument of type ‘char *’, \ but argument 3 has type ‘int’ [-Wformat=] 181 | ksft_exit_fail_msg("sysfs: unable to read value '%s': %s\n", | ~^ | | | char * | %d The fix passes strerror(errno) as it was intended, like in the sibling error exit message. Fixes: aba51cd ("selftests: alsa - add PCM test") Cc: Mark Brown <[email protected]> Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Cc: Shuah Khan <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Mirsad Todorovac <[email protected]> Acked-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent f77a255 commit fd38dd6

File tree

1 file changed

+1
-1
lines changed
  • tools/testing/selftests/alsa

1 file changed

+1
-1
lines changed

tools/testing/selftests/alsa/conf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static char *sysfs_get(const char *sysfs_root, const char *id)
179179
close(fd);
180180
if (len < 0)
181181
ksft_exit_fail_msg("sysfs: unable to read value '%s': %s\n",
182-
path, errno);
182+
path, strerror(errno));
183183
while (len > 0 && path[len-1] == '\n')
184184
len--;
185185
path[len] = '\0';

0 commit comments

Comments
 (0)