have __DEFINE_COMPAT_HANDLE() generate const versions

Both DEFINE_XEN_GUEST_HANDLE() and __DEFINE_XEN_GUEST_HANDLE()
each produce both const and non-const handles,
only DEFINE_COMPAT_HANDLE() does (__DEFINE_COMPAT_HANDLE()
does not). This patch has __DEFINE_COMPAT_HANDLE() also
produce a const handle.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Razvan Cojocaru authored and Jan Beulich committed 2016-09-05 12:47:46 +02:00
1 parent af74f65ef1
commit 698d0f377d
1 file changed
+6 -3
+6 -3
View File
@@ -15,11 +15,14 @@
typedef struct { \
compat_ptr_t c; \
type *_[0] __packed; \
} __compat_handle_ ## name
} __compat_handle_ ## name; \
typedef struct { \
compat_ptr_t c; \
const type *_[0] __packed; \
} __compat_handle_const_ ## name
#define DEFINE_COMPAT_HANDLE(name) \
__DEFINE_COMPAT_HANDLE(name, name); \
__DEFINE_COMPAT_HANDLE(const_ ## name, const name)
__DEFINE_COMPAT_HANDLE(name, name)
#define COMPAT_HANDLE(name) __compat_handle_ ## name
/* NB: it is assumed that if an arch uses the compat layer it does not
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.