[PATCH 08/23] selftests/nolibc: Rename w to written in expect_vfprintf()

From: david . laight . linux

Date: Mon Mar 02 2026 - 05:21:17 EST


From: David Laight <david.laight.linux@xxxxxxxxx>

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@xxxxxxxxx>
---

V4: Split out from patch 4.

tools/testing/selftests/nolibc/nolibc-test.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 51390b709af1..9ebebe4ff253 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -1669,7 +1669,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);
@@ -1677,7 +1677,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);
@@ -1700,8 +1700,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;
}
--
2.39.5