public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Anubhav Shelat <ashelat@redhat.com>
Cc: linux-rt-users@vger.kernel.org, kcarcia@redhat.com
Subject: Re: [PATCH v2 1/2] rt-tests: hackbench: removed extra use of optind
Date: Wed, 22 May 2024 13:17:50 -0400 (EDT)	[thread overview]
Message-ID: <b55f25cc-f919-b717-e85e-e917c7a25c5a@redhat.com> (raw)
In-Reply-To: <20240522144347.13281-1-ashelat@redhat.com>



On Wed, 22 May 2024, Anubhav Shelat wrote:

> Currently, using the -s option displays the usage message, even if the
> option is properly used.
> 
> This is because Commit 778a02b7c519 ("rt-tests: hackbench: drop incorrect
> and unnecessary usage of optind") forgot to drop a use of optind when
> processing option 's' which was fixed in this commit.
> 
> Now the -s option works correctly with the proper arguments.
> 
> Note: The next commit in this patchset fixes "ERROR: do not use
> assignment in if condition" on line 459.
> 
> Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
> ---
>  src/hackbench/hackbench.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c
> index d4924b3cc129..fec8357bef81 100644
> --- a/src/hackbench/hackbench.c
> +++ b/src/hackbench/hackbench.c
> @@ -456,7 +456,7 @@ static void process_options(int argc, char *argv[])
>  			use_inet = 1;
>  			break;
>  		case 's':
> -			if (!(argv[optind] && (datasize = atoi(optarg)) > 0)) {
> +			if ((datasize = atoi(optarg)) <= 0) {
>  				fprintf(stderr, "%s: --datasize|-s requires an integer > 0\n", argv[0]);
>  				print_usage_exit(1);
>  			}
> -- 

Signed-off-by: John Kacur <jkacur@redhat.com>


      parent reply	other threads:[~2024-05-22 17:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22 14:43 [PATCH v2 1/2] rt-tests: hackbench: removed extra use of optind Anubhav Shelat
2024-05-22 14:43 ` [PATCH v2 2/2] rt-tests: hackbench: properly recognize when integer arguments are negative Anubhav Shelat
2024-05-22 17:17   ` John Kacur
2024-05-22 17:17 ` John Kacur [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=b55f25cc-f919-b717-e85e-e917c7a25c5a@redhat.com \
    --to=jkacur@redhat.com \
    --cc=ashelat@redhat.com \
    --cc=kcarcia@redhat.com \
    --cc=linux-rt-users@vger.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