[PATCH v2 1/4] clk: k210: Fix checking if ulongs are less than 0

Leo Liang ycliang at andestech.com
Tue Sep 14 10:39:40 CEST 2021


On Sat, Sep 11, 2021 at 01:20:00PM -0400, Sean Anderson wrote:
> The PLL functions take ulong arguments for rate, but still check if that
> rate is negative (which is never true). The correct way to handle this is
> to use IS_ERR_VALUE (like is already done in k210_clk_set_rate). While
> we're at it, we can move the error checking up into the caller of the pll
> set/get rate functions.  This also protects our other calculations from
> using bogus values for rate.
>
> Fixes: 609bd60b94 ("clk: k210: Rewrite to remove CCF")
> Reported-by: Coverity Scan <scan-admin at coverity.com>
> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
> ---
>
> Changes in v2:
> - Reworked patch to use IS_ERR_VALUE instead of changing arguments to long
>
>  drivers/clk/clk_kendryte.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
Reviewed-by: Leo Yu-Chi Liang <ycliang at andestech.com>
CONFIDENTIALITY NOTICE:

This e-mail (and its attachments) may contain confidential and legally privileged information or information protected from disclosure. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein is strictly prohibited. In this case, please immediately notify the sender by return e-mail, delete the message (and any accompanying documents) and destroy all printed hard copies. Thank you for your cooperation.

Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.


More information about the U-Boot mailing list