[U-Boot] [PATCH 5/9] rockchip: rk3368: change type of ram-size field for a min()-calculation

Simon Glass sjg at chromium.org
Thu Aug 2 20:36:15 UTC 2018


Hi Phiipp,

On 26 July 2018 at 07:59, Philipp Tomsich
<philipp.tomsich at theobroma-systems.com> wrote:
> With the recent changes of the underlying types for the ram size, we need
> to cast the constant used in clamping to u64 instead of size_t.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
> ---
>
>  drivers/ram/rockchip/dmc-rk3368.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg at chromium.org>

>
> diff --git a/drivers/ram/rockchip/dmc-rk3368.c b/drivers/ram/rockchip/dmc-rk3368.c
> index 8d1b9fa..35d7605 100644
> --- a/drivers/ram/rockchip/dmc-rk3368.c
> +++ b/drivers/ram/rockchip/dmc-rk3368.c
> @@ -960,7 +960,7 @@ static int rk3368_dmc_probe(struct udevice *dev)
>         * is SoC register space (i.e. reserved), and 0xfe000000~0xfeffffff is
>         * inaccessible for some IP controller.
>         */
> -       priv->info.size = min(priv->info.size, (size_t)0xfe000000);
> +       priv->info.size = min(priv->info.size, (u64)0xfe000000);

Why case at all? Is it because min() is a macro?

>
>         return 0;
>  }
> --
> 2.1.4
>

Regards,
Simon


More information about the U-Boot mailing list