]> Gentwo Git Trees - linux/.git/commitdiff
tools/rtla: Remove unused optional option_index
authorCosta Shulyupin <costa.shul@redhat.com>
Thu, 2 Oct 2025 12:35:39 +0000 (15:35 +0300)
committerTomas Glozar <tglozar@redhat.com>
Thu, 20 Nov 2025 12:15:53 +0000 (13:15 +0100)
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>
tools/tracing/rtla/src/osnoise_hist.c
tools/tracing/rtla/src/osnoise_top.c
tools/tracing/rtla/src/timerlat_hist.c
tools/tracing/rtla/src/timerlat_top.c

index 844f0468953c5be3057277874bafa114366d2977..df0657b789804e54ddd4b3da57af4b1099f17542 100644 (file)
@@ -524,11 +524,8 @@ static struct common_params
                        {0, 0, 0, 0}
                };
 
-               /* getopt_long stores the option index here. */
-               int option_index = 0;
-
                c = getopt_long(argc, argv, "a:c:C::b:d:e:E:DhH:p:P:r:s:S:t::T:01234:5:6:7:",
-                                long_options, &option_index);
+                                long_options, NULL);
 
                /* detect the end of the options. */
                if (c == -1)
index defa1eb63bee0a171c68a68eb1f76fc894e2a283..1b5181e66b175486c9e869ada0b045c1a06c0b07 100644 (file)
@@ -376,11 +376,8 @@ struct common_params *osnoise_top_parse_args(int argc, char **argv)
                        {0, 0, 0, 0}
                };
 
-               /* getopt_long stores the option index here. */
-               int option_index = 0;
-
                c = getopt_long(argc, argv, "a:c:C::d:De:hH:p:P:qr:s:S:t::T:0:1:2:3:",
-                                long_options, &option_index);
+                                long_options, NULL);
 
                /* Detect the end of the options. */
                if (c == -1)
index 02d3ffd2cf4b1b8dcfe9d1b779741aff02d3ca8e..c432ef5f59e7feeeea1859ed10c3670f95023f3e 100644 (file)
@@ -840,11 +840,8 @@ static struct common_params
                        {0, 0, 0, 0}
                };
 
-               /* getopt_long stores the option index here. */
-               int option_index = 0;
-
                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:",
-                                long_options, &option_index);
+                                long_options, NULL);
 
                /* detect the end of the options. */
                if (c == -1)
index 607b57f2f231c7cd9f05c70d32cbc74e93a71e6b..82e227d27af7a847f39018d1102dbcb11b39fbf2 100644 (file)
@@ -604,11 +604,8 @@ static struct common_params
                        {0, 0, 0, 0}
                };
 
-               /* getopt_long stores the option index here. */
-               int option_index = 0;
-
                c = getopt_long(argc, argv, "a:c:C::d:De:hH:i:knp:P:qs:t::T:uU0:1:2:345:6:7:",
-                                long_options, &option_index);
+                                long_options, NULL);
 
                /* detect the end of the options. */
                if (c == -1)