* [PATCH] powerpc/kvm: no need to initialise statics to 0
@ 2021-12-20 3:02 Jason Wang
2022-02-18 2:09 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Jason Wang @ 2021-12-20 3:02 UTC (permalink / raw)
To: mpe; +Cc: paulus, linuxppc-dev, wangborong, linux-kernel
Static variables do not need to be initialised to 0, because compiler
will initialise all uninitialised statics to 0. Thus, remove the
unneeded initialization.
Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
---
arch/powerpc/kvm/book3s_64_mmu_host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c
index c3e31fef0be1..1ae09992c9ea 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_host.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_host.c
@@ -228,7 +228,7 @@ static struct kvmppc_sid_map *create_sid_map(struct kvm_vcpu *vcpu, u64 gvsid)
struct kvmppc_sid_map *map;
struct kvmppc_vcpu_book3s *vcpu_book3s = to_book3s(vcpu);
u16 sid_map_mask;
- static int backwards_map = 0;
+ static int backwards_map;
if (kvmppc_get_msr(vcpu) & MSR_PR)
gvsid |= VSID_PR;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/kvm: no need to initialise statics to 0
2021-12-20 3:02 [PATCH] powerpc/kvm: no need to initialise statics to 0 Jason Wang
@ 2022-02-18 2:09 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2022-02-18 2:09 UTC (permalink / raw)
To: Jason Wang, mpe; +Cc: linuxppc-dev, linux-kernel, paulus
On Mon, 20 Dec 2021 11:02:43 +0800, Jason Wang wrote:
> Static variables do not need to be initialised to 0, because compiler
> will initialise all uninitialised statics to 0. Thus, remove the
> unneeded initialization.
>
>
Applied to powerpc/topic/ppc-kvm.
[1/1] powerpc/kvm: no need to initialise statics to 0
https://git.kernel.org/powerpc/c/8e0f353a44ff3d65d933b8c0e4fb15dc89d46617
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-18 2:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20 3:02 [PATCH] powerpc/kvm: no need to initialise statics to 0 Jason Wang
2022-02-18 2:09 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).