public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] fsl: sys_eeprom: Fix 'may be used uninitialized' warning
Date: Tue, 01 Sep 2009 13:09:26 -0500	[thread overview]
Message-ID: <4A9D6356.9090304@freescale.com> (raw)
In-Reply-To: <20090901180613.GA10489@oksana.dev.rtsoft.ru>

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

  reply	other threads:[~2009-09-01 18:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01 16:59 [U-Boot] [PATCH 2/2] fsl: sys_eeprom: Fix 'may be used uninitialized' warning Anton Vorontsov
2009-09-01 17:30 ` Kumar Gala
2009-09-01 17:38   ` Anton Vorontsov
2009-09-01 17:59     ` [U-Boot] invalid core multipliers? Kári Davíðsson
2009-09-04 20:57       ` Wolfgang Denk
2009-09-01 18:06     ` [U-Boot] [PATCH 2/2] fsl: sys_eeprom: Fix 'may be used uninitialized' warning Anton Vorontsov
2009-09-01 18:09       ` Timur Tabi [this message]
2009-09-01 18:27         ` [U-Boot] [PATCH 2/2] fsl: sys_eeprom: Fix 'may be used uninitialized' warningп Anton Vorontsov
2009-09-01 19:22       ` [U-Boot] [PATCH 2/2] fsl: sys_eeprom: Fix 'may be used uninitialized' warning Wolfgang Denk
2009-09-01 18:16 ` Wolfgang Denk
2009-09-01 18:29   ` Anton Vorontsov
2009-09-01 19:42     ` Wolfgang Denk
2009-09-01 18:38 ` Timur Tabi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A9D6356.9090304@freescale.com \
    --to=timur@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox