From: Shuah Khan <skhan@linuxfoundation.org>
To: bajing <bajing@cmss.chinamobile.com>, shuah@kernel.org
Cc: lizhijian@fujitsu.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] watchdog-test.c: Remove unused variable in main
Date: Tue, 12 Aug 2025 13:27:55 -0600 [thread overview]
Message-ID: <ba9f7752-ceb2-4fcd-acaa-b5afa77eecda@linuxfoundation.org> (raw)
In-Reply-To: <20250812075345.872-1-bajing@cmss.chinamobile.com>
On 8/12/25 01:53, bajing wrote:
> Since $optind is not used in the subsequent code, the variable
> should be removed.
>
> Signed-off-by: bajing <bajing@cmss.chinamobile.com>
> ---
> tools/testing/selftests/watchdog/watchdog-test.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c
> index a1f506ba5578..837001a9e3a0 100644
> --- a/tools/testing/selftests/watchdog/watchdog-test.c
> +++ b/tools/testing/selftests/watchdog/watchdog-test.c
> @@ -209,8 +209,6 @@ int main(int argc, char *argv[])
> exit(ret);
> }
>
> - optind = 0;
Removing the assignment soles based on looking at the subsequent
is incorrect.
Explain why this needs to be removed? Did you happen to check
getopt_long() and how it uses optind before making this change?
> -
> while ((c = getopt_long(argc, argv, sopts, lopts, NULL)) != -1) {
> switch (c) {
> case 'b':
thanks,
-- Shuah
prev parent reply other threads:[~2025-08-12 19:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 7:53 bajing
2025-08-12 19:27 ` Shuah Khan [this message]
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=ba9f7752-ceb2-4fcd-acaa-b5afa77eecda@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=bajing@cmss.chinamobile.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lizhijian@fujitsu.com \
--cc=shuah@kernel.org \
/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
all inboxes | Powered by JetHome®