[U-Boot] [PATCH] fsl: Fix compiler warnings from gcc-4.4 in sys_eeprom code

Timur Tabi timur at tabi.org
Fri Aug 30 15:43:21 CEST 2013


On Mon, Jul 6, 2009 at 10:11 AM, Kumar Gala <galak at kernel.crashing.org> wrote:
>
>  #ifdef CONFIG_SYS_I2C_EEPROM_NXID
>  /* Is this a valid NXID EEPROM? */
> -#define is_valid (*((u32 *)e.id) == (('N' << 24) | ('X' << 16) | ('I' << 8) | 'D'))
> +#define is_valid ((e.id[0] == 'N') || (e.id[1] == 'X') || \
> +                 (e.id[2] == 'I') || (e.id[3] == 'D'))
>  #endif

Four years later, I just noticed that this code is wrong.  It should
be && instead of ||.


More information about the U-Boot mailing list