xen/gen_hypercall: Fix if indent
PATCH 1/1 xen/gen_hypercall: Fix if indent
On x86, the opening if of call_handlers_*() is indented 4 spaces which
breaks alignment. The alignment is broken by printf(" "), but
that actually aligns ARM's opening "if ( likely() )". Move the indent to the if that needs it.
This results in x86 hypercall-defs.h changes like:
#define call_handlers_hvm64(num, ret, a1, a2, a3, a4, a5) \
({ \
uint64_t mask = (num) > 63 ? 0 : 1ULL << (num); \
- if ( likely(mask & ((1ULL << __HYPERVISOR_vcpu_op) | (1ULL << __HYPERVISOR_event_channel_op))) ) \
+ if ( likely(mask & ((1ULL << __HYPERVISOR_vcpu_op) | (1ULL << __HYPERVISOR_event_channel_op))) ) \
{ \
if ( (num) == __HYPERVISOR_vcpu_op ) \ARM's hypercall-defs.h does not change.
--- xen/scripts/gen_hypercall.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen/scripts/gen_hypercall.awk +2 -2
@@ -266,7 +266,7 @@ END { printf("({ \\\n"); if (need_mask) printf(" uint64_t mask = (num) > 63 ? 0 : 1ULL << (num); \\\n"); - printf(" "); + for (pl = 1; pl <= n_prios[ca]; pl++) { if (prios[ca, p_list[pl]] > 1) { if (pl < n_prios[ca]) {
@@ -292,7 +292,7 @@ END { } else { for (i = 1; i <= nc; i++) if (call[i] == ca && call_prio[i] == p_list[pl]) { - printf("if ( likely((num) == __HYPERVISOR_%s) ) \\\n", fn[call_fn[i]]); + printf(" if ( likely((num) == __HYPERVISOR_%s) ) \\\n", fn[call_fn[i]]); do_call(call_fn[i], call_p[i]); } }
Signature · 1 line
2.51.1
Quoted 15 lines · Jason Andryuk
On x86, the opening if of call_handlers_*() is indented 4 spaces which
breaks alignment. The alignment is broken byprintf(" "), but
that actually aligns ARM's opening "if (likely())". Move the indent to the if that needs it.This results in x86
hypercall-defs.hchanges like:#define
call_handlers_hvm64(num, ret, a1, a2, a3, a4, a5)\({ \ uint64_t mask = (num) > 63 ? 0 : 1ULL << (num); \(quoted diff) +1
-1- if ( likely(mask & ((1ULL << __HYPERVISOR_vcpu_op) | (1ULL << __HYPERVISOR_event_channel_op))) ) \ + if ( likely(mask & ((1ULL << __HYPERVISOR_vcpu_op) | (1ULL << __HYPERVISOR_event_channel_op))) ) \ { \ if ( (num) == __HYPERVISOR_vcpu_op ) \
Quoted 3 lines
ARM's
hypercall-defs.hdoes not change.Signed-off-by Jason Andryuk <[email protected]>