[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081224212903.GA16018@susedev.qlogic.org>
Date: Wed, 24 Dec 2008 13:29:03 -0800
From: Ron Mercer <ron.mercer@...gic.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Ben Hutchings <bhutchings@...arflare.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 3/5] qlge: bugfix: Fix endian issue regarding shadow registers.
On Wed, Dec 24, 2008 at 01:15:21PM -0800, Christoph Hellwig wrote:
> > I think that should be:
> > ???return le32_to_cpu(*(const volatile __le32 *)addr);
>
> No. It needs more love than that.
>
> ql_read_sh_reg is only used to access .prod_idx_sh_reg in the rx_ring
> structure, which is an offset from the .rx_ring_shadow_reg_area member.
> So instead of all this werid casting .prod_idx_sh_reg should simply
> be a __le32 pointer, whithout volatile and the other mess, and then
> you can use le32_to_cpu directly and kill the helper.
Yes, .prod_idx_sh_reg should be an __le32 *, but the volatile modifier
was used since the memory location is modified by the chip and read by
the driver. Isn't that a case where it should be used?
>
> And please verify the whole driver for endianess issues using sparse
> while you're at it...
Will do...
--
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