[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200708130059.00117.mb@bu3sch.de>
Date: Mon, 13 Aug 2007 00:58:59 +0200
From: Michael Buesch <mb@...sch.de>
To: Michael Trimarchi <trimarchi@...dalf.sssup.it>
Cc: jgarzik@...ox.com, netdev@...r.kernel.org
Subject: Re: dm9000: add set_mac_address() v2
On Monday 13 August 2007 00:45:17 Michael Trimarchi wrote:
>
> >> + return -EBUSY;
> >> +
> >> + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
> >> +
> >> + for (i = 0; i < 3; i++)
> >> + write_srom_word(db, i,
> >> + cpu_to_le16(((u16 *) (addr->sa_data))[i]));
> >>
> >
> > Nope.
> >
> > write_srom_word(db, i, le16_to_cpu(((__le16 *) (addr->sa_data))[i]));
> >
> >
> Are you sure?
Yes I am. cpu_to_le16 simply doesn't make any sense at all here,
while le16_to_cpu does make sense and is indeed correct.
Though they both generate the same asm code. Running sparse
also tells you more about this. ;)
--
Greetings Michael.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists