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

Re: [Xen-devel] [PATCH 13/20] libxl: Allow AO_GC and EGC_GC even if not used



On Fri, 2012-04-13 at 19:40 +0100, Ian Jackson wrote:
> Mark the gc produced by AO_GC and EGC_GC with the gcc feature
> __attribute__((unused)).  This allows the use of EGC_INIT and
> STATE_AO_GC by functions which do actually use the gc.
> 
> This is convenient because those functions might want to use the ao or
> egc, rather than the gc; and also because it means that functions
> which morally ought to be fishing any gc they use out of an egc or
> state structure can be written do so regardless of whether the gc is
> actually used right then.
> 
> Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

Needed this for one of my patches (just sent, with a reference to this
patch). So:

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> ---
>  tools/libxl/libxl_internal.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 4cfb8d5..74dc2c5 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -1280,7 +1280,7 @@ libxl__device_model_version_running(libxl__gc *gc, 
> uint32_t domid);
>  /* useful for all functions which take an egc: */
>  
>  #define EGC_GC                                  \
> -    libxl__gc *const gc = &egc->gc
> +    libxl__gc *const gc __attribute__((unused)) = &egc->gc
>  
>  /* egc initialisation and destruction: */
>  
> @@ -1383,7 +1383,7 @@ _hidden void libxl__egc_cleanup(libxl__egc *egc);
>      })
>  
>  #define AO_GC                                   \
> -    libxl__gc *const gc = &ao->gc
> +    libxl__gc *const gc __attribute__((unused)) = &ao->gc
>  
>  #define STATE_AO_GC(op_ao)                      \
>      libxl__ao *const ao = (op_ao);              \



_______________________________________________
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®.