Re: [PATCH RESEND] clk: nuvoton: ma35d1-divider: simplify allocation

From: a0987203069

Date: Sun Sep 13 2026 - 23:23:43 EST


Hi Rosen,

On Fri, Sep 11, 2026 at 05:23:26PM -0700, Rosen Penev wrote:
> Use a flexible array member instead of kcalloc + pointer that is not
> actually const.
>
> Simplifies allocation slightly.

Thanks for the patch, and sorry for the slow reply.

We're already working on a different fix for this driver internally:
the ADC divider register actually implements a simple closed-form
relationship (rate = parent_rate / (2 * (N + 1))), so building and
scanning a clk_div_table with up to 2^width entries via the generic
divider_recalc_rate()/divider_determine_rate()/divider_get_val()
helpers is unnecessary overhead in the first place -- we're replacing
the table entirely with direct arithmetic in recalc_rate()/
determine_rate()/set_rate() instead of just changing how it's
allocated.

Since our patch removes the table (and the unrelated mask_bit
mechanism, which has an out-of-range shift bug at its only call site)
rather than reshaping it, we won't be adopting this patch, but we do
appreciate you catching the allocation issue. We'll post our fix
shortly for review.

Thanks again,
Joey