The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>, John Kacur <jkacur@redhat.com>,
	Costa Shulyupin <costa.shul@redhat.com>
Subject: [for-next][PATCH 02/16] tools/rtla: Remove unused optional option_index
Date: Thu, 20 Nov 2025 18:23:25 -0500	[thread overview]
Message-ID: <20251120232707.612143662@kernel.org> (raw)
In-Reply-To: 20251120232323.271532418@kernel.org

From: Costa Shulyupin <costa.shul@redhat.com>

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  | 5 +----
 tools/tracing/rtla/src/osnoise_top.c   | 5 +----
 tools/tracing/rtla/src/timerlat_hist.c | 5 +----
 tools/tracing/rtla/src/timerlat_top.c  | 5 +----
 4 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c
index 844f0468953c..df0657b78980 100644
--- a/tools/tracing/rtla/src/osnoise_hist.c
+++ b/tools/tracing/rtla/src/osnoise_hist.c
@@ -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)
diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c
index defa1eb63bee..1b5181e66b17 100644
--- a/tools/tracing/rtla/src/osnoise_top.c
+++ b/tools/tracing/rtla/src/osnoise_top.c
@@ -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)
diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c
index 02d3ffd2cf4b..c432ef5f59e7 100644
--- a/tools/tracing/rtla/src/timerlat_hist.c
+++ b/tools/tracing/rtla/src/timerlat_hist.c
@@ -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)
diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c
index 607b57f2f231..82e227d27af7 100644
--- a/tools/tracing/rtla/src/timerlat_top.c
+++ b/tools/tracing/rtla/src/timerlat_top.c
@@ -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)
-- 
2.51.0



  parent reply	other threads:[~2025-11-20 23:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 23:23 [for-next][PATCH 00/16] rtla: Updates for v6.19 Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 01/16] tools/rtla: Add for_each_monitored_cpu() helper Steven Rostedt
2025-11-20 23:23 ` Steven Rostedt [this message]
2025-11-20 23:23 ` [for-next][PATCH 03/16] tools/rtla: Fix unassigned nr_cpus Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 04/16] rtla/timerlat_bpf: Stop tracing on user latency Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 05/16] tools/rtla: Fix --on-threshold always triggering Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 06/16] rtla/tests: Extend action tests to 5s Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 07/16] rtla/tests: Fix osnoise test calling timerlat Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 08/16] tools/rtla: Add fatal() and replace error handling pattern Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 09/16] tools/rtla: Replace timerlat_top_usage("...") with fatal("...") Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 10/16] tools/rtla: Replace timerlat_hist_usage("...") " Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 11/16] tools/rtla: Replace osnoise_top_usage("...") " Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 12/16] tools/rtla: Replace osnoise_hist_usage("...") " Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 13/16] rtla: Fix -C/--cgroup interface Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 14/16] rtla: Fix -a overriding -t argument Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 15/16] rtla/tests: Dont rely on matching ^1ALL Steven Rostedt
2025-11-20 23:23 ` [for-next][PATCH 16/16] rtla/timerlat: Exit top main loop on any non-zero wait_retval Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251120232707.612143662@kernel.org \
    --to=rostedt@kernel.org \
    --cc=costa.shul@redhat.com \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglozar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox