* [PATCH] KVM: arm64: remove the unnecessary function check
@ 2018-08-31 9:42 Shaokun Zhang
2018-10-08 16:18 ` Marc Zyngier
0 siblings, 1 reply; 2+ messages in thread
From: Shaokun Zhang @ 2018-08-31 9:42 UTC (permalink / raw)
To: linux-arm-kernel
init_common_resources always return 0 and it is redundant to check the
return value, let's make it void to simplify the code.
Cc: Christoffer Dall <christoffer.dall@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
---
virt/kvm/arm/arm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
index c92053b..66a29c9 100644
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -1406,13 +1406,11 @@ static inline void hyp_cpu_pm_exit(void)
}
#endif
-static int init_common_resources(void)
+static void init_common_resources(void)
{
/* set size of VMID supported by CPU */
kvm_vmid_bits = kvm_get_vmid_bits();
kvm_info("%d-bit VMID\n", kvm_vmid_bits);
-
- return 0;
}
static int init_subsystems(void)
@@ -1655,9 +1653,7 @@ int kvm_arch_init(void *opaque)
}
}
- err = init_common_resources();
- if (err)
- return err;
+ init_common_resources();
in_hyp_mode = is_kernel_in_hyp_mode();
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] KVM: arm64: remove the unnecessary function check
2018-08-31 9:42 [PATCH] KVM: arm64: remove the unnecessary function check Shaokun Zhang
@ 2018-10-08 16:18 ` Marc Zyngier
0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2018-10-08 16:18 UTC (permalink / raw)
To: linux-arm-kernel
On 31/08/18 10:42, Shaokun Zhang wrote:
> init_common_resources always return 0 and it is redundant to check the
> return value, let's make it void to simplify the code.
>
> Cc: Christoffer Dall <christoffer.dall@arm.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
> ---
> virt/kvm/arm/arm.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
> index c92053b..66a29c9 100644
> --- a/virt/kvm/arm/arm.c
> +++ b/virt/kvm/arm/arm.c
> @@ -1406,13 +1406,11 @@ static inline void hyp_cpu_pm_exit(void)
> }
> #endif
>
> -static int init_common_resources(void)
> +static void init_common_resources(void)
> {
> /* set size of VMID supported by CPU */
> kvm_vmid_bits = kvm_get_vmid_bits();
> kvm_info("%d-bit VMID\n", kvm_vmid_bits);
> -
> - return 0;
> }
>
> static int init_subsystems(void)
> @@ -1655,9 +1653,7 @@ int kvm_arch_init(void *opaque)
> }
> }
>
> - err = init_common_resources();
> - if (err)
> - return err;
> + init_common_resources();
>
> in_hyp_mode = is_kernel_in_hyp_mode();
>
>
Although I agree this looks pretty superfluous at the moment, I'd rather
keep init_common_resources as it is at the moment, as we may well end-up
with more stuff in it, which could fail.
Another possibility would be to merge everything in init_subsystems, but
that'd require careful investigation, specially with the stuff that is
currently pending for 4.20.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-08 16:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-31 9:42 [PATCH] KVM: arm64: remove the unnecessary function check Shaokun Zhang
2018-10-08 16:18 ` Marc Zyngier
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).