[PATCH v7 2/3] selftests: cgroup: Add KB() helper

From: Albert Esteve

Date: Tue Nov 17 2026 - 08:28:25 EST


cgroup_util.h already has MB() and GB() for size
literals. Add KB() in the same style so tests can
spell kilobyte values without in-code shifts.

Tested-by: R Nageswara Sastry <rnsastry@xxxxxxxxxxxxx>
Signed-off-by: Albert Esteve <aesteve@xxxxxxxxxx>
---
tools/testing/selftests/cgroup/lib/include/cgroup_util.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/cgroup/lib/include/cgroup_util.h b/tools/testing/selftests/cgroup/lib/include/cgroup_util.h
index 5307f3bf32a0..455e52a516da 100644
--- a/tools/testing/selftests/cgroup/lib/include/cgroup_util.h
+++ b/tools/testing/selftests/cgroup/lib/include/cgroup_util.h
@@ -6,6 +6,7 @@
#define BUF_SIZE 4096
#endif

+#define KB(x) (x << 10)
#define MB(x) (x << 20)
#define GB(x) ((unsigned long long)(x) << 30)


--
2.55.0