Re: [PATCH v2 6/8] RISC-V: Add required checks during clock source init
From: Christoph Hellwig
Date: Tue Jan 15 2019 - 08:54:50 EST
> hartid = riscv_of_processor_hartid(n);
> + if (hartid < 0) {
> + pr_warn("Not valid hartid for node [%pOF] error = [%d]\n",
> + n, hartid);
> + return hartid;
> + }
> cpuid = riscv_hartid_to_cpuid(hartid);
>
> + if (cpuid < 0) {
> + pr_warn("Invalid cpuid for hartid [%d]\n", hartid);
> + return cpuid;
> + }
> +
No need for the empty line after the riscv_hartid_to_cpuid call.
> - clocksource_register_hz(cs, riscv_timebase);
> + error = clocksource_register_hz(cs, riscv_timebase);
>
> + if (error) {
Same here.