From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] smc91111_eeprom: fix compile warning
Date: Mon, 09 Nov 2009 13:41:03 -0800 [thread overview]
Message-ID: <4AF88C6F.20602@gmail.com> (raw)
In-Reply-To: <200911091636.54896.vapier@gentoo.org>
Mike Frysinger wrote:
> On Monday 09 November 2009 16:19:58 Ben Warren wrote:
>
>> smc91111_eeprom.c:278: warning: suggest parentheses around + or - in
>> operand
>> smc91111_eeprom.c:281: warning: suggest parentheses around + or -
>> in operand
>>
>> for (i = 0; i < 5; i++) {
>> - printf ("%02x:", SMC_inb (dev, ADDR0_REG + i));
>> + printf ("%02x:", SMC_inb (dev, (ADDR0_REG + i)));
>> }
>>
>
> erm, this says to me that the SMC inb macro is broken. it should be using
> paren when expanding the second argument. so lets fix that instead.
> -mike
>
Yeah, I see where it is:
#define SMC_inb(a,p) ({ \
unsigned int __p = (unsigned int)((a)->iobase + (p<<1)); \
unsigned int __v = *(volatile unsigned short *)((__p) & ~2); \
if (__p & 2) __v >>= 8; \
else __v &= 0xff; \
__v; })
(p<<1) --> ((p)<<1)
Thanks for pointing this out. Patch coming up.
regards,
Ben
prev parent reply other threads:[~2009-11-09 21:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-09 21:19 [U-Boot] [PATCH] smc91111_eeprom: fix compile warning Ben Warren
2009-11-09 21:36 ` Mike Frysinger
2009-11-09 21:41 ` Ben Warren [this message]
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=4AF88C6F.20602@gmail.com \
--to=biggerbadderben@gmail.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