Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/rtla: Remove unused optional option_index

The longindex argument of getopt_long() is optional
and tied to the unused local variable option_index.

Remove it to shorten the four longest functions
and make the code neater.

Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
Reviewed-by: Tomas Glozar <tglozar@redhat.com>
Link: https://lore.kernel.org/r/20251002123553.389467-2-costa.shul@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>

authored by

Costa Shulyupin and committed by
Tomas Glozar
671314fc 04fa6bf3

+4 -16
+1 -4
tools/tracing/rtla/src/osnoise_hist.c
··· 524 524 {0, 0, 0, 0} 525 525 }; 526 526 527 - /* getopt_long stores the option index here. */ 528 - int option_index = 0; 529 - 530 527 c = getopt_long(argc, argv, "a:c:C::b:d:e:E:DhH:p:P:r:s:S:t::T:01234:5:6:7:", 531 - long_options, &option_index); 528 + long_options, NULL); 532 529 533 530 /* detect the end of the options. */ 534 531 if (c == -1)
+1 -4
tools/tracing/rtla/src/osnoise_top.c
··· 376 376 {0, 0, 0, 0} 377 377 }; 378 378 379 - /* getopt_long stores the option index here. */ 380 - int option_index = 0; 381 - 382 379 c = getopt_long(argc, argv, "a:c:C::d:De:hH:p:P:qr:s:S:t::T:0:1:2:3:", 383 - long_options, &option_index); 380 + long_options, NULL); 384 381 385 382 /* Detect the end of the options. */ 386 383 if (c == -1)
+1 -4
tools/tracing/rtla/src/timerlat_hist.c
··· 840 840 {0, 0, 0, 0} 841 841 }; 842 842 843 - /* getopt_long stores the option index here. */ 844 - int option_index = 0; 845 - 846 843 c = getopt_long(argc, argv, "a:c:C::b:d:e:E:DhH:i:knp:P:s:t::T:uU0123456:7:8:9\1\2:\3:", 847 - long_options, &option_index); 844 + long_options, NULL); 848 845 849 846 /* detect the end of the options. */ 850 847 if (c == -1)
+1 -4
tools/tracing/rtla/src/timerlat_top.c
··· 604 604 {0, 0, 0, 0} 605 605 }; 606 606 607 - /* getopt_long stores the option index here. */ 608 - int option_index = 0; 609 - 610 607 c = getopt_long(argc, argv, "a:c:C::d:De:hH:i:knp:P:qs:t::T:uU0:1:2:345:6:7:", 611 - long_options, &option_index); 608 + long_options, NULL); 612 609 613 610 /* detect the end of the options. */ 614 611 if (c == -1)