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

Re: [Xen-devel] [PATCH v5 05/14] tools/libxc: unused attribute in DECLARE_HYPERCALL_BUFFER_SHADOW





On 05/13/2015 11:57 PM, Ian Campbell wrote:
On Wed, 2015-05-13 at 09:53 +0800, Yang Hongyang wrote:
There are cases that we only need to use the hypercall buffer data,

"cases where"
and do not use the xc_hypercall_buffer_t struct.
DECLARE_HYPERCALL_BUFFER_SHADOW define a user pointer that can allow

"defines a user pointer"

us to access the hypercall buffer data but it also define a

"defines"

xc_hypercall_buffer_t that we don't use, the compiler will report arg
unused error.
add __attribute__((unused)) before xc_hypercall_buffer_t to avoid
the compiler error.

The cases for example:

"Example cases:"

In send_all_pages(), we only need to use the haypercall buffer data

"hypercall"

which is a dirty bitmap, we set the dirty bitmap to all dirty and call
send_dirty_pages, we will not use the xc_hypercall_buffer_t and hypercall
to retrive the dirty bitmap.

"retrieve"

In send_some_pages(), we will also only need to use the dirty_bitmap.
the retrive dirty bitmap hypercall are done by the caller.

and again.


Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
  tools/libxc/include/xenctrl.h | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index a689caf..0804257 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -284,11 +284,15 @@ typedef struct xc_hypercall_buffer xc_hypercall_buffer_t;
   * Useful when a hypercall buffer is passed to a function and access
   * via the user pointer is required.
   *
+ * The shadow xc_hypercall_buffer_t may be unused, add
+ * __attribute__((unused)) to avoid compiler error.

No need for this comment IMHO.

   * See DECLARE_HYPERCALL_BUFFER_ARGUMENT() if the user pointer is not
   * required.
   */
  #define DECLARE_HYPERCALL_BUFFER_SHADOW(_type, _name, _hbuf)   \
      _type *(_name) = (_hbuf)->hbuf;                            \
+    __attribute__((unused))                                    \

This is a somewhat unconventional location for such a tagm but putting
it elsewhere would involve faff-some rewrapping.

So apart from the typos looks good.

Will fix those typos, thank you!



      xc_hypercall_buffer_t XC__HYPERCALL_BUFFER_NAME(_name) = { \
          .hbuf = (void *)-1,                                    \
          .param_shadow = (_hbuf),                               \


.


--
Thanks,
Yang.

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