summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDavid Laight <david.laight.linux@gmail.com>2026-03-08 14:37:27 +0300
committerThomas Weißschuh <linux@weissschuh.net>2026-03-20 19:46:07 +0300
commitab7cd329a837711b88600e5d776836f16a0e8de8 (patch)
tree66e45225215d8334733265dee54fb27fe4fae09a /tools
parent6702425cd50ebb9a71d6b441df4b0df4f58d160a (diff)
downloadlinux-ab7cd329a837711b88600e5d776836f16a0e8de8.tar.xz
selftests/nolibc: Rename w to written in expect_vfprintf()
Single character variable names don't make code easy to read. Rename 'w' (used for the return value from snprintf()) 'written'. Signed-off-by: David Laight <david.laight.linux@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://patch.msgid.link/20260308113742.12649-3-david.laight.linux@gmail.com Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/nolibc/nolibc-test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 5e7b5c8ec13b..5c3bf96f57bb 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -1677,7 +1677,7 @@ static int expect_vfprintf(int llen, const char *expected, const char *fmt, ...)
char buf[VFPRINTF_LEN + 80];
unsigned int cmp_len;
va_list args;
- ssize_t w, expected_len;
+ ssize_t written, expected_len;
/* Fill and terminate buf[] to check for overlong/absent writes */
memset(buf, 0xa5, sizeof(buf) - 1);
@@ -1685,7 +1685,7 @@ static int expect_vfprintf(int llen, const char *expected, const char *fmt, ...)
va_start(args, fmt);
/* Limit buffer length to test truncation */
- w = vsnprintf(buf, VFPRINTF_LEN + 1, fmt, args);
+ written = vsnprintf(buf, VFPRINTF_LEN + 1, fmt, args);
va_end(args);
llen += printf(" \"%s\"", buf);
@@ -1708,8 +1708,8 @@ static int expect_vfprintf(int llen, const char *expected, const char *fmt, ...)
return 1;
}
- if (w != expected_len) {
- llen += printf(" written(%d) != %d", (int)w, (int)expected_len);
+ if (written != expected_len) {
+ llen += printf(" written(%d) != %d", (int)written, (int)expected_len);
result(llen, FAIL);
return 1;
}