From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Sat, 19 Nov 2011 13:59:25 +0100 Subject: [U-Boot] [PATCH 09/12] drivers/i2c/davinci_i2c.c: Fix GCC 4.6 warning In-Reply-To: References: <1321399263-13826-1-git-send-email-agust@denx.de> <1321399263-13826-10-git-send-email-agust@denx.de> Message-ID: <20111119135925.7ebf82b3@wker> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 16 Nov 2011 08:42:07 -0700 Tom Rini wrote: ... > > --- a/drivers/i2c/davinci_i2c.c > > +++ b/drivers/i2c/davinci_i2c.c > > @@ -78,13 +78,11 @@ static int poll_i2c_irq(int mask) > > > > ?void flush_rx(void) > > ?{ > > - ? ? ? int ? ? dummy; > > - > > ? ? ? ?while (1) { > > ? ? ? ? ? ? ? ?if (!(REG(I2C_STAT) & I2C_STAT_RRDY)) > > ? ? ? ? ? ? ? ? ? ? ? ?break; > > > > - ? ? ? ? ? ? ? dummy = REG(I2C_DRR); > > + ? ? ? ? ? ? ? (void)REG(I2C_DRR); > > This becomes: > (void)(*(volatile unsigned int *)(I2C_DDR)) > > So we don't need that cast. Also, can we at get a comment about what > / why we're doing this? Ah, thanks for the pointer. Fixed in patch v2. I think that the code is self-explanatory and we don't need a comment. As long there is something shifted in and placed in data reception register we read and throw it away since this is a flush_rx(). Anatolij