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

Sean Christopherson
2024-01-30T23:25:01Z

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.