Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Cleanup and fix tools/mm/slabinfo utility
@ 2026-05-18  6:21 Xuewen Wang
  2026-05-18  6:21 ` [PATCH v2 1/3] tools/mm/slabinfo: Fix trace disable logic inversion Xuewen Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Xuewen Wang @ 2026-05-18  6:21 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Xuewen Wang

This series fixes one bug and cleans up two code quality issues in tools/mm/slabinfo:

1. Fix trace disable logic inversion: when the user intends to disable
   tracing (!tracing) and it is currently enabled (s->trace),
   set_obj() was called with 1 instead of 0, which is opposite to
   the intended behavior. All other options (sanity_checks, red_zone,
   poison, store_user) in the same function use 0 for the disable
   case.

2. Remove dead assignment in get_obj_and_str(): `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.

3. Remove redundant slab->partial assignment in read_slab_dir():
   slab->partial is assigned by get_obj("partial") and then
   immediately overwritten by get_obj_and_str("partial", &t).

Xuewen Wang (3):
  tools/mm/slabinfo: Fix trace disable logic inversion
  tools/mm/slabinfo: remove dead assignment in get_obj_and_str()
  tools/mm/slabinfo: remove redundant slab->partial assignment

 tools/mm/slabinfo.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

---
Changes in v2:
- Fix author email mismatch
- Add Fixes tag for the bug fix (patch 1)
- Remove unnecessary braces in patch 2 per reviewer suggestion

Patches 1/3 and 3/3 carry Reviewed-by tag from SeongJae Park.

v1:
    https://lore.kernel.org/all/20260515065325.4009527-1-18810879172@163.com/

-- 
2.25.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-19  0:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18  6:21 [PATCH v2 0/3] Cleanup and fix tools/mm/slabinfo utility Xuewen Wang
2026-05-18  6:21 ` [PATCH v2 1/3] tools/mm/slabinfo: Fix trace disable logic inversion Xuewen Wang
2026-05-18  6:21 ` [PATCH v2 2/3] tools/mm/slabinfo: remove dead assignment in get_obj_and_str() Xuewen Wang
2026-05-19  0:32   ` SeongJae Park
2026-05-18  6:21 ` [PATCH v2 3/3] tools/mm/slabinfo: remove redundant slab->partial assignment Xuewen Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox