[U-Boot] [PATCH 2/2] fsl: sys_eeprom: Fix 'may be used uninitialized' warning

Timur Tabi timur at freescale.com
Tue Sep 1 20:09:26 CEST 2009


Anton Vorontsov wrote:

> -	for (i = 0, p = &e; i < sizeof(e); i += 8, p += 8) {
> +	do {
>  		ret = i2c_write(CONFIG_SYS_I2C_EEPROM_ADDR, i, CONFIG_SYS_I2C_EEPROM_ADDR_LEN,
> -			p, min((sizeof(e) - i), 8));
> +			(void *)&e + i, min((sizeof(e) - i), 8));
>  		if (ret)
>  			break;
>  		udelay(5000);	/* 5ms write cycle timing */
> -	}
> +		i += 8;
> +	} while (i < sizeof(e));

Or we could remove the loop altogether and just do the write in one shot.  Is there any reason to believe that any of Freescale's 8[356]xx boards can't handle a large I2C block write of about 50 bytes or so?

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list