lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ba9f7752-ceb2-4fcd-acaa-b5afa77eecda@linuxfoundation.org>
Date: Tue, 12 Aug 2025 13:27:55 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: bajing <bajing@...s.chinamobile.com>, shuah@...nel.org
Cc: lizhijian@...itsu.com, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org, Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] watchdog-test.c: Remove unused variable in main

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@...s.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ