[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1232847955.2808.4.camel@hashbaz.i.decadent.org.uk>
Date: Sun, 25 Jan 2009 01:45:55 +0000
From: Ben Hutchings <bhutchings@...arflare.com>
To: Ron Mercer <ron.mercer@...gic.com>
Cc: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 01/21] [next] qlge: Change to device ID 8000 and
corresponding flash access.
On Sat, 2009-01-24 at 11:29 -0800, Ron Mercer wrote:
> On Fri, Jan 23, 2009 at 03:28:59PM -0800, Ben Hutchings wrote:
> > On Fri, 2009-01-23 at 07:16 -0800, Ron Mercer wrote:
> > [...]
> > > diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
> > > index 16eb9dd..a530f5b 100644
> > > --- a/drivers/net/qlge/qlge_main.c
> > > +++ b/drivers/net/qlge/qlge_main.c
> > [...]
> > > @@ -657,28 +680,38 @@ static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data)
> > > if (status)
> > > goto exit;
> > > /* get the data */
> > > - *data = ql_read32(qdev, FLASH_DATA);
> > > + *data = cpu_to_le32(ql_read32(qdev, FLASH_DATA));
> > [...]
> >
> > Should be le32_to_cpu not cpu_to_le32.
> >
> > Ben.
>
> Ben,
> The flash_param is stored in flash as an array of __le32 elements. I tried this a number
> of ways and what I came up with is the only combination (I could find)
> that didn't generate compile or sparse warnings and that works on big
> and little endian machines.
> You'll note that I've defined the flash_param using little endian.
But the type of *data is u32, not __le32.
> If I use cpu_to_le32 it would work fine but will produce sparse
> warnings.
> Would it be acceptable if I used a better comment about that I'm doing?
OK, cpu_to_le32() is right but the parameter type should be __le32 *
(and ql_get_flash_params() should be consistent with that).
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
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