From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Gross Subject: Re: Unused Variable in xl code for CPU Pool Date: Thu, 02 Feb 2012 06:37:03 +0100 Message-ID: <4F2A20FF.90607@ts.fujitsu.com> References: <17723C07-9B25-4C6C-A5F7-609545EDB856@gmail.com> <1328107728.17444.81.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1328107728.17444.81.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: John McDermott , Andre Przywara , "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On 02/01/2012 03:48 PM, Ian Campbell wrote: > On Thu, 2012-01-26 at 13:15 +0000, John McDermott wrote: >> Xen Developers, >> >> FYI, in 4.1-testing, tools/libxl/xl_cmdimpl.c, in function >> main_cpupoollist, the variable opt_long is set but not used. Tools >> won't make with this warning. > Our test system compilers obviously don't generate this particular > warning so it slipped through. Thanks for reporting. > > Looks like fallout from 22838:aab67c1c6b87 which removed the (nop) > implementation of that option. > > The following just nukes it altogether, the generic handling of > unsupported options already prints something. > > Ian. > > # HG changeset patch > # User Ian Campbell > # Date 1328107525 0 > # Node ID 6e1db0380ba3467e26128706a62195bf2816e00e > # Parent 667da384457b0ec5f8f2ea4ec3c1ee43008e7ed5 > xl: Drop -l option to xl cpupool-list > > The implementation (which was a nop) was removed back in 22838:aab67c1c6b87 but > this now causes "set but not used" warnings from some compilers. Might as well > just nuke the option entirely. > > Signed-off-by: Ian Campbell Acked-by: juergen.gross@ts.fujitsu.com > diff -r 667da384457b -r 6e1db0380ba3 tools/libxl/xl_cmdimpl.c > --- a/tools/libxl/xl_cmdimpl.c Wed Feb 01 14:45:25 2012 +0000 > +++ b/tools/libxl/xl_cmdimpl.c Wed Feb 01 14:45:25 2012 +0000 > @@ -5538,11 +5538,9 @@ int main_cpupoollist(int argc, char **ar > int option_index = 0; > static struct option long_options[] = { > {"help", 0, 0, 'h'}, > - {"long", 0, 0, 'l'}, > {"cpus", 0, 0, 'c'}, > {0, 0, 0, 0} > }; > - int opt_long = 0; > int opt_cpus = 0; > const char *pool = NULL; > libxl_cpupoolinfo *poolinfo; > @@ -5552,7 +5550,7 @@ int main_cpupoollist(int argc, char **ar > int ret = 0; > > while (1) { > - opt = getopt_long(argc, argv, "hlc", long_options,&option_index); > + opt = getopt_long(argc, argv, "hc", long_options,&option_index); > if (opt == -1) > break; > > @@ -5560,9 +5558,6 @@ int main_cpupoollist(int argc, char **ar > case 'h': > help("cpupool-list"); > return 0; > - case 'l': > - opt_long = 1; > - break; > case 'c': > opt_cpus = 1; > break; > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > -- Juergen Gross Principal Developer Operating Systems PDG ES&S SWE OS6 Telephone: +49 (0) 89 3222 2967 Fujitsu Technology Solutions e-mail: juergen.gross@ts.fujitsu.com Domagkstr. 28 Internet: ts.fujitsu.com D-80807 Muenchen Company details: ts.fujitsu.com/imprint.html