Skip to content

Commit 4ac2145

Browse files
committed
KVM: MMU: mark role_regs and role accessors as maybe unused
It is reasonable for these functions to be used only in some configurations, for example only if the host is 64-bits (and therefore supports 64-bit guests). It is also reasonable to keep the role_regs and role accessors in sync even though some of the accessors may be used only for one of the two sets (as is the case currently for CR4.LA57).. Because clang reports warnings for unused inlines declared in a .c file, mark both sets of accessors as __maybe_unused. Reported-by: kernel test robot <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent a3cf527 commit 4ac2145

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ struct kvm_mmu_role_regs {
204204
* the single source of truth for the MMU's state.
205205
*/
206206
#define BUILD_MMU_ROLE_REGS_ACCESSOR(reg, name, flag) \
207-
static inline bool ____is_##reg##_##name(struct kvm_mmu_role_regs *regs)\
207+
static inline bool __maybe_unused ____is_##reg##_##name(struct kvm_mmu_role_regs *regs)\
208208
{ \
209209
return !!(regs->reg & flag); \
210210
}
@@ -226,7 +226,7 @@ BUILD_MMU_ROLE_REGS_ACCESSOR(efer, lma, EFER_LMA);
226226
* and the vCPU may be incorrect/irrelevant.
227227
*/
228228
#define BUILD_MMU_ROLE_ACCESSOR(base_or_ext, reg, name) \
229-
static inline bool is_##reg##_##name(struct kvm_mmu *mmu) \
229+
static inline bool __maybe_unused is_##reg##_##name(struct kvm_mmu *mmu) \
230230
{ \
231231
return !!(mmu->mmu_role. base_or_ext . reg##_##name); \
232232
}

0 commit comments

Comments
 (0)