Re: [PATCH] clk: use ULONG_MAX as the initial value for the iteration in clk_mux_determine_rate_flags()

From: Stephen Boyd
Date: Mon Apr 24 2023 - 21:24:53 EST


Quoting Yang Xiwen via B4 Relay (2023-04-21 08:56:38)
> From: Yang Xiwen <forbidden405@xxxxxxxxxxx>
>
> Currently, clk_mux_determine_rate_flags() use 0 as the initial value for
> selecting the best matching parent. However, this will choose a
> non-existant rate(0) if the requested rate is closer to 0 than the
> minimum rate the parents have.
>
> Fix that by initializing the initial value to ULONG_MAX and treat it as a
> magic number.

Can you add a unit test to clk_test.c as well?