Re: [PATCH 1/5] KVM: selftests: Generalize check_clocksource() from kvm_clock_test

From: Sean Christopherson
Date: Tue Jan 30 2024 - 18:25:21 EST


On Tue, Jan 09, 2024, Vitaly Kuznetsov wrote:
> +bool sys_clocksource_is_tsc(void)
> +{
> + char *clk_name = sys_get_cur_clocksource();
> + bool ret = false;
> +
> + if (!strcmp(clk_name, "tsc\n"))
> + ret = true;

This can more simply be:

bool ret = !strcmp(clk_name, "tsc\n");

and then

bool ret = !strcmp(clk_name, "tsc\n") ||
!strcmp(clk_name, "hyperv_clocksource_tsc_page\n");

when the Hyper-V variant comes along. I'll fixup when applying unless you
violently disagree.