[PATCH v2 2/3] tools/mm/slabinfo: remove dead assignment in get_obj_and_str()
From: Xuewen Wang
Date: Mon May 18 2026 - 02:33:11 EST
The assignment `x = NULL` sets the local parameter variable instead of
`*x`, which is a no-op since `*x` was already set to NULL on the line
above. Remove the dead assignment.
Signed-off-by: Xuewen Wang <wangxuewen@xxxxxxxxxx>
---
tools/mm/slabinfo.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/mm/slabinfo.c b/tools/mm/slabinfo.c
index 39f7eae7eecd..685bcdd03568 100644
--- a/tools/mm/slabinfo.c
+++ b/tools/mm/slabinfo.c
@@ -193,10 +193,9 @@ static unsigned long get_obj_and_str(const char *name, char **x)
*x = NULL;
- if (!read_obj(name)) {
- x = NULL;
+ if (!read_obj(name))
return 0;
- }
+
result = strtoul(buffer, &p, 10);
while (*p == ' ')
p++;
--
2.25.1