Re: [PATCH v3 1/3] clk: zynqmp: Use firmware specific common clock flags

From: Stephen Boyd
Date: Thu Aug 13 2020 - 16:11:40 EST


Quoting Amit Sunil Dhamne (2020-08-03 23:44:15)
> diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c
> index db8d0d7..d813c34 100644
> --- a/drivers/clk/zynqmp/clkc.c
> +++ b/drivers/clk/zynqmp/clkc.c
> @@ -271,6 +271,33 @@ static int zynqmp_pm_clock_get_topology(u32 clock_id, u32 index,
> return ret;
> }
>
> +unsigned long zynqmp_clk_map_common_ccf_flags(const u32 zynqmp_flag)
> +{
> + unsigned long ccf_flag = 0;
> +
> + ccf_flag |= (zynqmp_flag & ZYNQMP_CLK_SET_RATE_GATE) ?

Please use an if condition instead

if (zynqmp_flag & ZYNQMP_CLK_SET_RATE_GATE)
ccf_flag |= CLK_SET_RATE_GATE;
if (zynqmp_flag & ...)

> + CLK_SET_RATE_GATE : 0;
> + ccf_flag |= (zynqmp_flag & ZYNQMP_CLK_SET_PARENT_GATE) ?
> + CLK_SET_PARENT_GATE : 0;
> + ccf_flag |= (zynqmp_flag & ZYNQMP_CLK_SET_RATE_PARENT) ?
> + CLK_SET_RATE_PARENT : 0;
> + ccf_flag |= (zynqmp_flag & ZYNQMP_CLK_IGNORE_UNUSED) ?
> + CLK_IGNORE_UNUSED : 0;
> + ccf_flag |= (zynqmp_flag & ZYNQMP_CLK_GET_RATE_NOCACHE) ?