[PATCH] arm: sunxi: Correct warning in board_fit_config_name_match
Simon Glass
sjg at google.com
Wed Jul 19 03:08:05 CEST 2023
Hi Tom,
On Mon, 17 Jul 2023 at 13:29, Tom Rini <trini at konsulko.com> wrote:
>
> When building this with clang, we get a warning about having excess
> parenthesis here, or that we're incorrectly using "==" when we want "=".
> Correct these by using parenthesis around our multiplication of
> constants as this is what was likely intended originally, even if not
> strictly required.
>
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
> Cc: Andre Przywara <andre.przywara at arm.com>
> ---
> board/sunxi/board.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> index f321cd58a6e6..643e8db185b4 100644
> --- a/board/sunxi/board.c
> +++ b/board/sunxi/board.c
> @@ -957,7 +957,7 @@ int board_fit_config_name_match(const char *name)
> #ifdef CONFIG_PINE64_DT_SELECTION
> if (strstr(best_dt_name, "-pine64-plus")) {
> /* Differentiate the Pine A64 boards by their DRAM size. */
> - if ((gd->ram_size == 512 * 1024 * 1024))
> + if (gd->ram_size == (512 * 1024 * 1024))
Reviewed-by: Simon Glass <sjg at chromium.org>
But I suggest:
if (gd->ram_size == 512 * 1024 * 1024) // or SZ_512M
since the extra brackets might confuse people about the operator precedence.
> best_dt_name = "sun50i-a64-pine64";
> }
> #endif
> --
> 2.34.1
>
Regards,
Simon
More information about the U-Boot
mailing list