Skip to content

Commit 671314f

Browse files
makelinuxlenticularis39
authored andcommitted
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>
1 parent 04fa6bf commit 671314f

4 files changed

Lines changed: 4 additions & 16 deletions

File tree

tools/tracing/rtla/src/osnoise_hist.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,8 @@ static struct common_params
524524
{0, 0, 0, 0}
525525
};
526526

527-
/* getopt_long stores the option index here. */
528-
int option_index = 0;
529-
530527
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);
532529

533530
/* detect the end of the options. */
534531
if (c == -1)

tools/tracing/rtla/src/osnoise_top.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,8 @@ struct common_params *osnoise_top_parse_args(int argc, char **argv)
376376
{0, 0, 0, 0}
377377
};
378378

379-
/* getopt_long stores the option index here. */
380-
int option_index = 0;
381-
382379
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);
384381

385382
/* Detect the end of the options. */
386383
if (c == -1)

tools/tracing/rtla/src/timerlat_hist.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,11 +840,8 @@ static struct common_params
840840
{0, 0, 0, 0}
841841
};
842842

843-
/* getopt_long stores the option index here. */
844-
int option_index = 0;
845-
846843
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);
848845

849846
/* detect the end of the options. */
850847
if (c == -1)

tools/tracing/rtla/src/timerlat_top.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,11 +604,8 @@ static struct common_params
604604
{0, 0, 0, 0}
605605
};
606606

607-
/* getopt_long stores the option index here. */
608-
int option_index = 0;
609-
610607
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);
612609

613610
/* detect the end of the options. */
614611
if (c == -1)

0 commit comments

Comments
 (0)