Skip to contentSkip to conversation

tools/mm/slabinfo: Fix --partial long option mapping

PATCH Applied Kaushlendra Kumar 2 participants 2 messages Dec 8, 2025 – Dec 10, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tools/mm/slabinfo: Fix --partial long option mapping

The long option "--partial" was incorrectly mapped to lowercase 'p' in the opts[] array, but the getopt string and switch case handle uppercase 'P'. This mismatch caused --partial to be rejected.

Fix the long_options mapping to use 'P' so --partial works correctly alongside the existing -P short option.

---
v2: Keep existing -P behavior instead of changing to -p per review feedback

 tools/mm/slabinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/mm/slabinfo.c +1 -1
index 7c51d283504d..39f7eae7eecd 100644
@@ -1405,7 +1405,7 @@ struct option opts[] = {
 	{ "numa", no_argument, NULL, 'n' },
 	{ "lines", required_argument, NULL, 'N'},
 	{ "ops", no_argument, NULL, 'o' },
-	{ "partial", no_argument, NULL, 'p'},
+	{ "partial", no_argument, NULL, 'P'},
 	{ "report", no_argument, NULL, 'r' },
 	{ "shrink", no_argument, NULL, 's' },
 	{ "Size", no_argument, NULL, 'S'},
Signature · 1 line
2.34.1
Reviewed-by Tested-by on v2 1/1
#1 lore raw
Quoted 6 lines · On Mon, 8 Dec 2025 16:22:40 +0530 Kaushlendra Kumar…

The long option "--partial" was incorrectly mapped to lowercase 'p' in the opts[] array, but the getopt string and switch case handle uppercase 'P'. This mismatch caused --partial to be rejected.

Fix the long_options mapping to use 'P' so --partial works correctly alongside the existing -P short option.

Looks nice finding and fix to me! I also confirmed the issue exists, and this patch fixes it.

Quoted 2 lines

Thanks,
SJ

[...]