KVM: arm64: pmu: Drop redundant check for non-NULL kvm_pmu_events
authorAnshuman Khandual <anshuman.khandual@arm.com>
Thu, 12 Oct 2023 06:46:17 +0000 (12:16 +0530)
committerMarc Zyngier <maz@kernel.org>
Thu, 12 Oct 2023 15:13:39 +0000 (16:13 +0100)
commit60197a4631b907b30343e25af702257d92f359cf
tree0c44d466c6ca1145f020b21fd2c553ce779a768d
parent373beef00f7d781a000b12c31fb17a5a9c25969c
KVM: arm64: pmu: Drop redundant check for non-NULL kvm_pmu_events

There is an allocated and valid struct kvm_pmu_events for each cpu on the
system via DEFINE_PER_CPU(). Hence there cannot be a NULL pointer accessed
via this_cpu_ptr() in the helper kvm_get_pmu_events(). Hence non-NULL check
for pmu in such places are redundant and can be dropped.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: James Morse <james.morse@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: kvmarm@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20231012064617.897346-1-anshuman.khandual@arm.com
arch/arm64/kvm/pmu.c