tools/mm/slabinfo: Fix --partial long option mapping
Subsystems (2)
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
@@ -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
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_optionsmapping 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
Signed-off-by Kaushlendra Kumar <[email protected]>
Thanks,
SJ
[...]