xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Dongli Zhang <dongli.zhang@oracle.com>
Cc: ross.lagerwall@citrix.com, ian.jackson@eu.citrix.com,
	wei.liu2@citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH v2 1/1] tools/livepatch: cleanup unnecessary "j = ARRAY_SIZE(action_options); "
Date: Wed, 15 Jun 2016 09:52:17 +0100	[thread overview]
Message-ID: <20160615085217.GV28116@citrix.com> (raw)
In-Reply-To: <1465951278-17811-1-git-send-email-dongli.zhang@oracle.com>

On Wed, Jun 15, 2016 at 08:41:18AM +0800, Dongli Zhang wrote:
> Local variable "j" would be used only when "i == ARRAY_SIZE(main_options)"
> is true. Thus, it is not necessary to update "j" when "i ==
> ARRAY_SIZE(main_options)" is false.
> 
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>

Your original patch has been committed. That's why Olaf is seeing
compilation error. It is currently in staging branch. Osstest (the CI
system) will test it (well, in fact there is not yet a test case). If
the test succeeds, all the patches tested will be pushed to master
branch.

To fix the breakage, please check out staging branch and write a patch
to fix it. And maybe the commit message should say something like
"initialise j to 0 to make some versions of gcc happy".

If you have further question, feel free to ask. :-)

Wei.

> ---
>  tools/misc/xen-livepatch.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c
> index 28f339a..62c072e 100644
> --- a/tools/misc/xen-livepatch.c
> +++ b/tools/misc/xen-livepatch.c
> @@ -412,7 +412,7 @@ struct {
>  
>  int main(int argc, char *argv[])
>  {
> -    int i, j, ret;
> +    int i, j = 0, ret;
>  
>      if ( argc  <= 1 )
>      {
> @@ -435,8 +435,7 @@ int main(int argc, char *argv[])
>                     "'xen-livepatch help'\n", argv[1]);
>              return 1;
>          }
> -    } else
> -        j = ARRAY_SIZE(action_options);
> +    }
>  
>      xch = xc_interface_open(0,0,0);
>      if ( !xch )
> -- 
> 1.9.1
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-06-15  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15  0:41 [PATCH v2 1/1] tools/livepatch: cleanup unnecessary "j = ARRAY_SIZE(action_options); " Dongli Zhang
2016-06-15  8:52 ` Wei Liu [this message]
2016-06-15  9:04   ` Olaf Hering
2016-06-15  9:10     ` Wei Liu

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=20160615085217.GV28116@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=dongli.zhang@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).