From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 09/12] drivers/i2c/davinci_i2c.c: Fix GCC 4.6 warning
Date: Sat, 19 Nov 2011 13:59:25 +0100 [thread overview]
Message-ID: <20111119135925.7ebf82b3@wker> (raw)
In-Reply-To: <CA+M6bXmVhyzv9arKk1b82Bj8zUdihLemDKNFX_qZrJuAzBeNxQ@mail.gmail.com>
On Wed, 16 Nov 2011 08:42:07 -0700
Tom Rini <tom.rini@gmail.com> 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
next prev parent reply other threads:[~2011-11-19 12:59 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-15 23:20 [U-Boot] [PATCH 00/12] Some GCC 4.6 build warning fixes Anatolij Gustschin
2011-11-15 23:20 ` [U-Boot] [PATCH 01/12] drivers/spi/atmel_spi.c: Fix GCC 4.6 warning Anatolij Gustschin
2011-11-16 20:28 ` Wolfgang Denk
2011-11-15 23:20 ` [U-Boot] [PATCH 02/12] drivers/mtd/dataflash.c: " Anatolij Gustschin
2011-11-16 20:28 ` Wolfgang Denk
2011-11-15 23:20 ` [U-Boot] [PATCH 03/12] drivers/net/at91_emac.c: " Anatolij Gustschin
2011-11-16 20:28 ` Wolfgang Denk
2011-11-15 23:20 ` [U-Boot] [PATCH 04/12] drivers/net/enc28j60.c: Fix GCC 4.6 warnings Anatolij Gustschin
2011-11-16 15:58 ` Mike Frysinger
2011-11-16 20:30 ` Wolfgang Denk
2011-11-16 20:29 ` Wolfgang Denk
2011-11-15 23:20 ` [U-Boot] [PATCH 05/12] board/cm41xx/flash.c: " Anatolij Gustschin
2011-11-16 20:35 ` Wolfgang Denk
2011-11-15 23:20 ` [U-Boot] [PATCH 06/12] board/cm4008/flash.c: " Anatolij Gustschin
2011-11-16 20:35 ` Wolfgang Denk
2011-11-15 23:20 ` [U-Boot] [PATCH 07/12] drivers/video/da8xx-fb.c: Fix GCC 4.6 warning Anatolij Gustschin
2011-11-16 20:36 ` Wolfgang Denk
2011-11-15 23:20 ` [U-Boot] [PATCH 08/12] drivers/video/bus_vcxk.c: " Anatolij Gustschin
2011-11-16 20:36 ` Wolfgang Denk
2011-11-15 23:21 ` [U-Boot] [PATCH 09/12] drivers/i2c/davinci_i2c.c: " Anatolij Gustschin
2011-11-16 6:31 ` Heiko Schocher
2011-11-16 15:42 ` Tom Rini
2011-11-19 12:59 ` Anatolij Gustschin [this message]
2011-11-19 12:51 ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2011-11-23 8:12 ` Anatolij Gustschin
2011-11-23 8:28 ` Heiko Schocher
2011-11-15 23:21 ` [U-Boot] [PATCH 10/12] arch/arm/cpu/armv7/s5p-common/pwm.c: fix " Anatolij Gustschin
2011-11-16 20:37 ` Wolfgang Denk
2011-11-15 23:21 ` [U-Boot] [PATCH 11/12] fs/yaffs2/yaffs_guts.c: Fix some GCC 4.6 warnings Anatolij Gustschin
2011-11-16 20:37 ` Wolfgang Denk
2011-11-15 23:21 ` [U-Boot] [PATCH 12/12] drivers/rtc/s3c24x0_rtc.c: fix " Anatolij Gustschin
2011-11-16 20:37 ` Wolfgang Denk
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=20111119135925.7ebf82b3@wker \
--to=agust@denx.de \
--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