[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 1/1] tools/livepatch: cleanup unnecessary "j = ARRAY_SIZE(action_options); "



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@xxxxxxxxxx>

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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.