Re: [PATCH v9 08/12] clk: zte: Introduce a driver for zx297520v3 top clocks
[email protected] Sun, 02 Aug 2026 20:59:48 +0000
| Newsgroups | dev.linux.lists.mfd,org.infradead.lists.linux-phy,org.kernel.vger.linux-devicetree |
|---|---|
| Message-ID | <[email protected]> |
Thank you for your contribution! Sashiko AI review found 1 potential issue(= s) to consider: - [Low] Using `const` struct variables to initialize fields of a static arr= ay causes a build failure. -- --- Patch [8]: [PATCH v9 08/12] clk: zte: Introduce a driver for zx297520v3= top clocks --- commit 0a378a36878d451d9e58d093344b7ead86ae6042 Author: Stefan D=C3=B6singer <[email protected]> clk: zte: Introduce a driver for zx297520v3 top clocks This commit introduces a new clock driver for the ZTE zx297520v3 SoC's top and matrix controllers. It adds definitions for PLLs, fixed dividers, muxes, and gates used by core devices on the board. > diff --git a/drivers/clk/zte/clk-zx297520v3.c b/drivers/clk/zte/clk-zx297= 520v3.c > new file mode 100644 > index 0000000000000..f9915582f261a > --- /dev/null > +++ b/drivers/clk/zte/clk-zx297520v3.c [ ... ] > +/* Used for gates where we don't know the parent input(s). Assume genera= l oscillator */ > +static const struct zx_parent_desc clk_unknown =3D PARENT_FW("osc26m"); > + > +/* For clocks that are known to use the ungated osc26m input */ > +static const struct zx_parent_desc clk_main[] =3D { > + PARENT_FW("osc26m"), > +}; [ ... ] > +static const struct zx_clock zx297520v3_top_clocks[] =3D { [ ... ] > + /* osc26m division for clk_outX */ > + [ZX_CLK_OSC26M_D2] =3D FIXED_DIV("osc26m-d2", clk_main[0], 2), [Severity: Low] Does this code cause a compiler error about initializer elements not being constant? In C, const qualified struct variables and array elements like clk_main[0] are not considered constant expressions. Since zx297520v3_top_clocks has st= atic storage duration, using them here might result in a build failure. [ ... ] > + /* > + * How does this RTC work? I don't know, the ZTE kernel does not talk t= o it. The actual RTC > + * is on the I2C-connected PMIC. > + */ > + [ZX_CLK_RTC_WCLK] =3D GATE("rtc-wclk", clk_unknown, 0x54, 1, 0), [Severity: Low] Is this initialization also affected by the same "initializer element is not constant" compiler error when using clk_unknown? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260802-zx29clk-v9= [email protected]?part=3D8