[coreboot] [PATCH] Remove warnings for s2892
Myles Watson
mylesgw at gmail.com
Fri May 1 15:02:54 CEST 2009
> -----Original Message-----
> From: Stefan Reinauer [mailto:stepan at coresystems.de]
> Sent: Friday, May 01, 2009 3:06 AM
> To: Myles Watson
> Cc: coreboot
> Subject: Re: [coreboot] [PATCH] Remove warnings for s2892
>
> Awesome patch!
Thanks.
> On 01.05.2009 0:22 Uhr, Myles Watson wrote:
> > if (!eeprom_valid) {
> > unsigned long mac_pos;
> > mac_pos = 0xffffffd0; /* See romstrap.inc and romstrap.lds.
*/
> > - mac_l = readl(mac_pos) + nic_index;
> > - mac_h = readl(mac_pos + 4);
> > + mac_l = readl((uint8_t*)mac_pos) + nic_index;
> > + mac_h = readl((uint8_t*)mac_pos + 4);
> > }
> >
> One could put that slightly simpler as
>
> if (!eeprom_valid) {
> u8 *mac_pos;
> mac_pos = 0xffffffd0; /* See romstrap.inc and romstrap.lds.
*/
I think you still need a cast, but it is nicer than two casts.
mac_pos = (u8*) 0xffffffd0; /* See romstrap.inc and
romstrap.lds. */
> mac_l = readl(mac_pos) + nic_index;
> mac_h = readl(mac_pos + 4);
> }
I wasn't sure if we wanted to convert types from uint8_t to u8 in old files,
so I didn't do any of that.
Acked-by: Myles Watson <mylesgw at gmail.com>
Thanks,
Myles
More information about the coreboot
mailing list