Commit fd38dd6a authored by Mirsad Todorovac's avatar Mirsad Todorovac Committed by Takashi Iwai

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: aba51cd0 ("selftests: alsa - add PCM test")
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-sound@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarMirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240107173704.937824-5-mirsad.todorovac@alu.unizg.hrSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f77a255e
...@@ -179,7 +179,7 @@ static char *sysfs_get(const char *sysfs_root, const char *id) ...@@ -179,7 +179,7 @@ static char *sysfs_get(const char *sysfs_root, const char *id)
close(fd); close(fd);
if (len < 0) if (len < 0)
ksft_exit_fail_msg("sysfs: unable to read value '%s': %s\n", ksft_exit_fail_msg("sysfs: unable to read value '%s': %s\n",
path, errno); path, strerror(errno));
while (len > 0 && path[len-1] == '\n') while (len > 0 && path[len-1] == '\n')
len--; len--;
path[len] = '\0'; path[len] = '\0';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment