All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] [PATCH] cpuset_hotplug: fix cpuset_list_compute
Date: Wed, 14 Nov 2018 15:32:41 +0100	[thread overview]
Message-ID: <20181114143241.GA23777@rei> (raw)
In-Reply-To: <20181114142147.38221-1-cristian.marussi@arm.com>

Hi!
> cpuset_hotplug failed with:
> 
> Usage : cpuset_list_compute [-a|s] list1 [list2]
> 
>         -a|s   list1 add/subtract list2.[default: -a]
> 
>         -h     Help.
> cpuset_hotplug 1 TFAIL: root group's cpus isn't expected(Result: 0,2-5, Expect: ).
> 
> It turned out that helper cpuset_list_compute was always failing because it was
> improperly handling getopt retval.

It's working on intel, but I suppose that it overflows on arm since char
is smaller than int there. It would be a bit better if something along
these lines was written here. Otherwise the patch itself looks good.

> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
> ---
>  .../cpuset/cpuset_hotplug_test/cpuset_list_compute.c           | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c b/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c
> index 1b55f4b30..b9f176af4 100644
> --- a/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c
> +++ b/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c
> @@ -29,8 +29,7 @@ static void usage(char *prog_name, int status)
>  
>  static void checkopt(int argc, char **argv)
>  {
> -	char c = '\0';
> -	int optc = 0;
> +	int c, optc = 0;
>  
>  	while ((c = getopt(argc, argv, "ahs")) != -1) {
>  		switch (c) {
> -- 
> 2.17.1
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

  parent reply	other threads:[~2018-11-14 14:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 14:21 [LTP] [PATCH 1/2] [PATCH] cpuset_hotplug: fix cpuset_list_compute Cristian Marussi
2018-11-14 14:21 ` [LTP] [PATCH 2/2] [PATCH] cpuset_list_compute fix exit value Cristian Marussi
2018-11-14 14:34   ` Cyril Hrubis
2018-11-14 14:32 ` Cyril Hrubis [this message]
2018-11-14 14:39   ` [LTP] [PATCH 1/2] [PATCH] cpuset_hotplug: fix cpuset_list_compute Cristian Marussi

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=20181114143241.GA23777@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.