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

Anton Vorontsov avorontsov at ru.mvista.com
Tue Sep 1 20:27:41 CEST 2009


On Tue, Sep 01, 2009 at 01:09:26PM -0500, Timur Tabi wrote:
> 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?

I guess "udelay(5000);	/* 5ms write cycle timing */" hints that
it's EEPROM chip dependant, so has nothing to do with i2c controller
capabilities.

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2


More information about the U-Boot mailing list