xen/arm: Remove stray semicolon at VREG_REG_HELPERS/TLB_HELPER* callers
PATCH 1/1 xen/arm: Remove stray semicolon at VREG_REG_HELPERS/TLB_HELPER* callers
This is inconsistent with the rest of the code where macros are used to define functions, as it results in an empty declaration (i.e. semicolon with nothing before it) after function definition. This is also not allowed by C99.
Take the opportunity to undefine TLB_HELPER* macros after last use.
---
Discussion:
https://lore.kernel.org/xen-devel/[email protected]/
Other empty declarations appear at callers of TYPE_SAFE and Linux module macros like EXPORT_SYMBOL for which we need some sort of agreement.
--- xen/arch/arm/include/asm/arm32/flushtlb.h | 12 +++++++----- xen/arch/arm/include/asm/arm64/flushtlb.h | 17 ++++++++++------- xen/arch/arm/include/asm/vreg.h | 4 ++-- 3 files changed, 19 insertions(+), 14 deletions(-)
xen/arch/arm/include/asm/arm32/flushtlb.h +7 -5
@@ -29,19 +29,21 @@ static inline void name(void) \ }/* Flush local TLBs, current VMID only */ -TLB_HELPER (flush_guest_tlb_local,TLBIALL , nsh); +TLB_HELPER (flush_guest_tlb_local,TLBIALL , nsh) /* Flush inner shareable TLBs, current VMID only */ -TLB_HELPER (flush_guest_tlb,TLBIALLIS , ish); +TLB_HELPER (flush_guest_tlb,TLBIALLIS , ish) /* Flush local TLBs, all VMIDs, non-hypervisor mode */ -TLB_HELPER (flush_all_guests_tlb_local,TLBIALLNSNH , nsh); +TLB_HELPER (flush_all_guests_tlb_local,TLBIALLNSNH , nsh) /* Flush innershareable TLBs, all VMIDs, non-hypervisor mode */ -TLB_HELPER (flush_all_guests_tlb,TLBIALLNSNHIS , ish); +TLB_HELPER (flush_all_guests_tlb,TLBIALLNSNHIS , ish) /* Flush all hypervisor mappings from the TLB of the local processor. */ -TLB_HELPER (flush_xen_tlb_local,TLBIALLH , nsh); +TLB_HELPER(flush_xen_tlb_local, TLBIALLH, nsh) + +#undef TLB_HELPER/* Flush TLB of local processor for address va. */ static inline void __flush_xen_tlb_one_local (vaddr_t va)
xen/arch/arm/include/asm/arm64/flushtlb.h +10 -7
@@ -67,25 +67,28 @@ static inline void name(vaddr_t va) \ }/* Flush local TLBs, current VMID only. */ -TLB_HELPER (flush_guest_tlb_local, vmalls12e1, nsh); +TLB_HELPER (flush_guest_tlb_local, vmalls12e1, nsh) /* Flush innershareable TLBs, current VMID only */ -TLB_HELPER (flush_guest_tlb, vmalls12e1is, ish); +TLB_HELPER (flush_guest_tlb, vmalls12e1is, ish) /* Flush local TLBs, all VMIDs, non-hypervisor mode */ -TLB_HELPER (flush_all_guests_tlb_local, alle1, nsh); +TLB_HELPER (flush_all_guests_tlb_local, alle1, nsh) /* Flush innershareable TLBs, all VMIDs, non-hypervisor mode */ -TLB_HELPER (flush_all_guests_tlb, alle1is, ish); +TLB_HELPER (flush_all_guests_tlb, alle1is, ish) /* Flush all hypervisor mappings from the TLB of the local processor. */ -TLB_HELPER (flush_xen_tlb_local, alle2, nsh); +TLB_HELPER (flush_xen_tlb_local, alle2, nsh) /* Flush TLB of local processor for address va. */ -TLB_HELPER_VA (__flush_xen_tlb_one_local, vae2); +TLB_HELPER_VA (__flush_xen_tlb_one_local, vae2) /* Flush TLB of all processors in the inner-shareable domain for address va. */ -TLB_HELPER_VA (__flush_xen_tlb_one, vae2is); +TLB_HELPER_VA(__flush_xen_tlb_one, vae2is) + +#undef TLB_HELPER +#undef TLB_HELPER_VA#endif /* __ASM_ARM_ARM64_FLUSHTLB_H__ */ /*
xen/arch/arm/include/asm/vreg.h +2 -2
@@ -140,8 +140,8 @@ static inline void vreg_reg##sz##_clearbits(uint##sz##_t *reg, \ *reg &= ~(((uint##sz##_t)bits & mask) << shift); \ } -VREG_REG_HELPERS (64 ,0x7 ); -VREG_REG_HELPERS (32 ,0x3 ); +VREG_REG_HELPERS(64, 0x7) +VREG_REG_HELPERS(32, 0x3)#undef VREG_REG_HELPERS
base-commit: 2f69ef96801f0d2b9646abf6396e60f99c56e3a0
Signature · 1 line
2.25.1
Quoted 7 lines · Michal Orzel
This is inconsistent with the rest of the code where macros are used to define functions, as it results in an empty declaration (i.e. semicolon with nothing before it) after function definition. This is also not allowed by C99.
Take the opportunity to undefine TLB_HELPER* macros after last use.
Quoted 7 lines
Signed-off-by Michal Orzel <[email protected]>---
Discussion:
https://lore.kernel.org/xen-devel/[email protected]/Other empty declarations appear at callers of
TYPE_SAFEand Linux module macros likeEXPORT_SYMBOLfor which we need some sort of agreement.
As said elsewhere, I think we should finally get rid of EXPORT_SYMBOL().
For TYPE_SAFE() I think some re-arrangement of the macros can address the Misra concern.
Jan
Quoted 8 lines · Michal Orzel
This is inconsistent with the rest of the code where macros are used to define functions, as it results in an empty declaration (i.e. semicolon with nothing before it) after function definition. This is also not allowed by C99.
Take the opportunity to undefine TLB_HELPER* macros after last use.
Signed-off-by Michal Orzel <[email protected]>
Quoted 103 lines
---
Discussion:
https://lore.kernel.org/xen-devel/[email protected]/Other empty declarations appear at callers of
TYPE_SAFEand Linux module macros likeEXPORT_SYMBOLfor which we need some sort of agreement.--- xen/arch/arm/include/asm/arm32/flushtlb.h | 12 +++++++----- xen/arch/arm/include/asm/arm64/flushtlb.h | 17 ++++++++++------- xen/arch/arm/include/asm/vreg.h | 4 ++-- 3 files changed, 19 insertions(+), 14 deletions(-)xen/arch/arm/include/asm/arm32/flushtlb.h +7
-5@@ -29,19 +29,21 @@ static inline void name(void) \ }/* Flush local TLBs, current VMID only */ -TLB_HELPER (flush_guest_tlb_local,TLBIALL , nsh); +TLB_HELPER (flush_guest_tlb_local,TLBIALL , nsh) /* Flush inner shareable TLBs, current VMID only */ -TLB_HELPER (flush_guest_tlb,TLBIALLIS , ish); +TLB_HELPER (flush_guest_tlb,TLBIALLIS , ish) /* Flush local TLBs, all VMIDs, non-hypervisor mode */ -TLB_HELPER (flush_all_guests_tlb_local,TLBIALLNSNH , nsh); +TLB_HELPER (flush_all_guests_tlb_local,TLBIALLNSNH , nsh) /* Flush innershareable TLBs, all VMIDs, non-hypervisor mode */ -TLB_HELPER (flush_all_guests_tlb,TLBIALLNSNHIS , ish); +TLB_HELPER (flush_all_guests_tlb,TLBIALLNSNHIS , ish) /* Flush all hypervisor mappings from the TLB of the local processor. */ -TLB_HELPER (flush_xen_tlb_local,TLBIALLH , nsh); +TLB_HELPER(flush_xen_tlb_local, TLBIALLH, nsh) + +#undef TLB_HELPER/* Flush TLB of local processor for address va. */ static inline void __flush_xen_tlb_one_local (vaddr_t va)xen/arch/arm/include/asm/arm64/flushtlb.h +10
-7@@ -67,25 +67,28 @@ static inline void name(vaddr_t va) \ }/* Flush local TLBs, current VMID only. */ -TLB_HELPER (flush_guest_tlb_local, vmalls12e1, nsh); +TLB_HELPER (flush_guest_tlb_local, vmalls12e1, nsh) /* Flush innershareable TLBs, current VMID only */ -TLB_HELPER (flush_guest_tlb, vmalls12e1is, ish); +TLB_HELPER (flush_guest_tlb, vmalls12e1is, ish) /* Flush local TLBs, all VMIDs, non-hypervisor mode */ -TLB_HELPER (flush_all_guests_tlb_local, alle1, nsh); +TLB_HELPER (flush_all_guests_tlb_local, alle1, nsh) /* Flush innershareable TLBs, all VMIDs, non-hypervisor mode */ -TLB_HELPER (flush_all_guests_tlb, alle1is, ish); +TLB_HELPER (flush_all_guests_tlb, alle1is, ish) /* Flush all hypervisor mappings from the TLB of the local processor. */ -TLB_HELPER (flush_xen_tlb_local, alle2, nsh); +TLB_HELPER (flush_xen_tlb_local, alle2, nsh) /* Flush TLB of local processor for address va. */ -TLB_HELPER_VA (__flush_xen_tlb_one_local, vae2); +TLB_HELPER_VA (__flush_xen_tlb_one_local, vae2) /* Flush TLB of all processors in the inner-shareable domain for address va. */ -TLB_HELPER_VA (__flush_xen_tlb_one, vae2is); +TLB_HELPER_VA(__flush_xen_tlb_one, vae2is) + +#undef TLB_HELPER +#undef TLB_HELPER_VA#endif /* __ASM_ARM_ARM64_FLUSHTLB_H__ */ /* xen/arch/arm/include/asm/vreg.h +2
-2@@ -140,8 +140,8 @@ static inline void vreg_reg##sz##_clearbits(uint##sz##_t *reg, \ *reg &= ~(((uint##sz##_t)bits & mask) << shift); \ } -VREG_REG_HELPERS (64 ,0x7 ); -VREG_REG_HELPERS (32 ,0x3 ); +VREG_REG_HELPERS(64, 0x7) +VREG_REG_HELPERS(32, 0x3)#undef VREG_REG_HELPERSbase-commit:
2f69ef96801f0d2b9646abf6396e60f99c56e3a0Signature · 1 line
2.25.1
Hi,
Quoted 11 lines · Stefano Stabellini
Quoted 8 lines · Michal Orzel
This is inconsistent with the rest of the code where macros are used to define functions, as it results in an empty declaration (i.e. semicolon with nothing before it) after function definition. This is also not allowed by C99.
Take the opportunity to undefine TLB_HELPER* macros after last use.
Signed-off-by Michal Orzel <[email protected]>Reviewed-by Stefano Stabellini <[email protected]>
I have committed the patch.
Cheers,
Signature · 1 line
Julien Grall