From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Date: Tue, 01 Sep 2009 13:09:26 -0500 Subject: [U-Boot] [PATCH 2/2] fsl: sys_eeprom: Fix 'may be used uninitialized' warning In-Reply-To: <20090901180613.GA10489@oksana.dev.rtsoft.ru> References: <20090901165902.GA6435@oksana.dev.rtsoft.ru> <607BBB57-C4BD-4E89-A70D-7AD1A8109F5C@kernel.crashing.org> <20090901173814.GA4471@oksana.dev.rtsoft.ru> <20090901180613.GA10489@oksana.dev.rtsoft.ru> Message-ID: <4A9D6356.9090304@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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@Freescale