Re: [v2 4/4] clk: x86: Support RV architecture

From: Stephen Boyd
Date: Tue Jul 21 2020 - 04:05:53 EST


Quoting Akshu Agrawal (2020-07-19 22:04:59)
> diff --git a/drivers/clk/x86/clk-fch.c b/drivers/clk/x86/clk-fch.c
> index b252f0cf0628..d68bca7b213f 100644
> --- a/drivers/clk/x86/clk-fch.c
> +++ b/drivers/clk/x86/clk-fch.c
[...]
>
> static int fch_clk_remove(struct platform_device *pdev)
> {
> - int i;
> + int i, clks;
> + struct fch_clk_data *fch_data;
>
> - for (i = 0; i < ST_MAX_CLKS; i++)
> + fch_data = dev_get_platdata(&pdev->dev);
> +
> + clks = (!fch_data->is_rv) ? ST_MAX_CLKS : RV_MAX_CLKS;

Useless parenthesis and negation, just write:

num = fch_data->is_rv ? RV_MAX_CLKS : ST_MAX_CLKS;

> +
> + for (i = 0; i < clks; i++)
> clk_hw_unregister(hws[i]);
> +
> return 0;
> }
>