Message ID | 20240627082426.394937-2-pengfei.li_1@nxp.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | clk: imx93: Move IMX93_CLK_END macro to clk driver | expand |
On 27/06/2024 10:24, Pengfei Li wrote: > IMX93_CLK_END was previously defined in imx93-clock.h to indicate > the number of clocks, but it is not part of the ABI, so it should > be moved to clk driver. > > Signed-off-by: Pengfei Li <pengfei.li_1@nxp.com> > --- > > Notes: > Change for v2: > - Use pre-processor define to simplify code. > > drivers/clk/imx/clk-imx93.c | 2 ++ > 1 file changed, 2 insertions(+) Are you sure this builds fine? If you need to define it here, it means some part of that unit file already uses the define. If so, you include the header. If you include the header, you should see fat warning. Really, people, just build your patches... Best regards, Krzysztof
On Fri, Jun 28, 2024 at 09:38:54AM +0200, Krzysztof Kozlowski wrote: > On 27/06/2024 10:24, Pengfei Li wrote: > > IMX93_CLK_END was previously defined in imx93-clock.h to indicate > > the number of clocks, but it is not part of the ABI, so it should > > be moved to clk driver. > > > > Signed-off-by: Pengfei Li <pengfei.li_1@nxp.com> > > --- > > > > Notes: > > Change for v2: > > - Use pre-processor define to simplify code. > > > > drivers/clk/imx/clk-imx93.c | 2 ++ > > 1 file changed, 2 insertions(+) > > Are you sure this builds fine? If you need to define it here, it means > some part of that unit file already uses the define. If so, you include > the header. If you include the header, you should see fat warning. > > Really, people, just build your patches... > > Best regards, > Krzysztof > > Hi Krzysztof, Yes, you're right, this macro definition has indeed been used. But this clk-imx93.c driver file is the only place where this macro is used. So maybe it would be more appropriate to define this macro in C rather than in the header file. Meanwhile, I also built my patch, but no warnings were found. BR, Pengfei Li
diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c index c6a9bc8ecc1f..c8b65146e76e 100644 --- a/drivers/clk/imx/clk-imx93.c +++ b/drivers/clk/imx/clk-imx93.c @@ -15,6 +15,8 @@ #include "clk.h" +#define IMX93_CLK_END 202 + enum clk_sel { LOW_SPEED_IO_SEL, NON_IO_SEL,
IMX93_CLK_END was previously defined in imx93-clock.h to indicate the number of clocks, but it is not part of the ABI, so it should be moved to clk driver. Signed-off-by: Pengfei Li <pengfei.li_1@nxp.com> --- Notes: Change for v2: - Use pre-processor define to simplify code. drivers/clk/imx/clk-imx93.c | 2 ++ 1 file changed, 2 insertions(+)