Skip to content

Commit 377f71f

Browse files
bjdooks-ctavpatel
authored andcommitted
riscv: kvm: define vcpu_sbi_ext_pmu in header
Sparse is giving a warning about vcpu_sbi_ext_pmu not being defined, so add a definition to the relevant header to fix the following: arch/riscv/kvm/vcpu_sbi_pmu.c:81:37: warning: symbol 'vcpu_sbi_ext_pmu' was not declared. Should it be static? Fixes: cbddc4c ("RISC-V: KVM: Add SBI PMU extension support") Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reviewed-by: Anup Patel <anup@brainfault.org> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Anup Patel <anup@brainfault.org>
1 parent 5463091 commit 377f71f

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

arch/riscv/include/asm/kvm_vcpu_sbi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,7 @@ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_hsm;
7272
extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_experimental;
7373
extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_vendor;
7474

75+
#ifdef CONFIG_RISCV_PMU_SBI
76+
extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu;
77+
#endif
7578
#endif /* __RISCV_KVM_VCPU_SBI_H__ */

arch/riscv/kvm/vcpu_sbi.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 = {
2020
};
2121
#endif
2222

23-
#ifdef CONFIG_RISCV_PMU_SBI
24-
extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu;
25-
#else
23+
#ifndef CONFIG_RISCV_PMU_SBI
2624
static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_pmu = {
2725
.extid_start = -1UL,
2826
.extid_end = -1UL,

0 commit comments

Comments
 (0)