Re: [PATCH] [v7] net: emac: emac gigabit ethernet controller driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Timur Tabi wrote:
I used to work on PowerPC, so I respect making things work for both
endians.  However, even I think that this is overkill for my driver.
First, there's no way this driver will ever be used on a big-endian
system.  Second, I'm pretty sure there are lots of places that would
need cpu_to_le32() in order to make this driver big-endian compatible.
It would be a huge mess.

#define TPD_BUFFER_ADDR_H_SET(tpd, val)    BITS_SET((tpd)->word[3], 18,
30, val)

This macros sets specific bits based on the definition of the register.
  I could change it to this:

#define TPD_BUFFER_ADDR_H_SET(tpd, val) BITS_SET((tpd)->word[3], 18, 30,
cpu_to_le32(val))

But I honestly don't see what good that will do.  There are still
thousands of other places that assume little-endian.

Ok, so I took another look at this, and even though I still think that it's useless, it seems to be much less difficult to implement than I initially thought.

I think all I need to do is to modify the BITS_GET() and BITS_SET() macros in emac-mac.h, as well as any of the RRD_xxx and TPD_xxx macros that do not use BITS_GET() or BITS_SET(). This is a minor change which I will implement in v8 of the patch.

Every other hardware access uses readl/writel, which is already endian-safe.

--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux