From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claudiu Manoil Date: Fri, 4 Oct 2013 11:35:56 +0300 Subject: [U-Boot] [PATCH 7/9] net: tsec: Use portable types and accessors for BDs In-Reply-To: References: <1380534287-4569-1-git-send-email-claudiu.manoil@freescale.com> <1380534287-4569-8-git-send-email-claudiu.manoil@freescale.com> Message-ID: <524E7DEC.6020202@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/4/2013 6:12 AM, Timur Tabi wrote: > On Mon, Sep 30, 2013 at 4:44 AM, Claudiu Manoil > wrote: >> +#define GET_BD_STAT(T, i) be16_to_cpu((__force __be16)T##BD(i).status) >> +#define SET_BD_STAT(T, i, v) T##BD(i).status = (__force __u16)cpu_to_be16(v) >> +#define GET_BD_BLEN(T, i) be16_to_cpu((__force __be16)T##BD(i).length) >> +#define SET_BD_BLEN(T, i, v) T##BD(i).length = (__force __u16)cpu_to_be16(v) >> +#define GET_BD_BPTR(T, i) be32_to_cpu((__force __be32)T##BD(i).bufptr) >> +#define SET_BD_BPTR(T, i, v) T##BD(i).bufptr = (__force __u32)cpu_to_be32(v) > > This is pretty ugly. There's got to be a better way to handle this. > Are you going to be doing stuff like this for every driver for > bi-endian hardware? > > Some time ago I suggest that we re-purpose iowrite() and ioread() to > be native-endian, and not just little endian. I think something like > that would make more sense than hacky macros like this. > > Hi Timur, We dropped these macros in favor of the in_be/out_be() I/O accessors (see http://patchwork.ozlabs.org/patch/280285/). Regards, Claudiu