Skip to content

Commit 8d49313

Browse files
maddy-kerneldevgregkh
authored andcommitted
powerpc/kvm: Fix ifdef to remove build warning
[ Upstream commit 88688a2 ] When compiling for pseries or powernv defconfig with "make C=1", these warning were reported bu sparse tool in powerpc/kernel/kvm.c arch/powerpc/kernel/kvm.c:635:9: warning: switch with no cases arch/powerpc/kernel/kvm.c:646:9: warning: switch with no cases Currently #ifdef were added after the switch case which are specific for BOOKE and PPC_BOOK3S_32. These are not enabled in pseries/powernv defconfig. Fix it by moving the #ifdef before switch(){} Fixes: cbe487f ("KVM: PPC: Add mtsrin PV code") Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20250518044107.39928-1-maddy@linux.ibm.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9a94e9d commit 8d49313

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/powerpc/kernel/kvm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,28 +632,28 @@ static void __init kvm_check_ins(u32 *inst, u32 features)
632632
#endif
633633
}
634634

635-
switch (inst_no_rt & ~KVM_MASK_RB) {
636635
#ifdef CONFIG_PPC_BOOK3S_32
636+
switch (inst_no_rt & ~KVM_MASK_RB) {
637637
case KVM_INST_MTSRIN:
638638
if (features & KVM_MAGIC_FEAT_SR) {
639639
u32 inst_rb = _inst & KVM_MASK_RB;
640640
kvm_patch_ins_mtsrin(inst, inst_rt, inst_rb);
641641
}
642642
break;
643-
#endif
644643
}
644+
#endif
645645

646-
switch (_inst) {
647646
#ifdef CONFIG_BOOKE
647+
switch (_inst) {
648648
case KVM_INST_WRTEEI_0:
649649
kvm_patch_ins_wrteei_0(inst);
650650
break;
651651

652652
case KVM_INST_WRTEEI_1:
653653
kvm_patch_ins_wrtee(inst, 0, 1);
654654
break;
655-
#endif
656655
}
656+
#endif
657657
}
658658

659659
extern u32 kvm_template_start[];

0 commit comments

Comments
 (0)