lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <28c405ed255b42d09307274fccbec41e@BN1PR03MB220.namprd03.prod.outlook.com>
Date:	Wed, 25 Jun 2014 14:16:33 +0000
From:	"bhupesh.sharma@...escale.com" <bhupesh.sharma@...escale.com>
To:	Marc Kleine-Budde <mkl@...gutronix.de>,
	"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>
CC:	"wg@...ndegger.com" <wg@...ndegger.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH] net: can: Remodel FlexCAN register read/write APIs for BE
 instances

> -----Original Message-----
> From: Marc Kleine-Budde [mailto:mkl@...gutronix.de]
> Sent: Wednesday, June 25, 2014 4:38 PM
> To: Sharma Bhupesh-B45370; linux-can@...r.kernel.org
> Cc: wg@...ndegger.com; netdev@...r.kernel.org
> Subject: Re: [PATCH] net: can: Remodel FlexCAN register read/write APIs
> for BE instances
> 
> On 06/25/2014 01:01 PM, bhupesh.sharma@...escale.com wrote:
> >> What about function pointers in the priv? So that flexcan_read()
> >> becomes
> >> priv->read().
> 
> > That's what I propose (similar to what I did for C_CAN driver for
> > 16-bit and 32-bit reg interfaces using platform data):
> 
> Yes...but...
> 
> > bool module_is_be = false;
> 
> ...module_is_be is not that simple, on PPC true must be the default to be
> compatible with existing dts.

How does this look (a bit messed up, so I am open for comments):

#if defined(CONFIG_ARM)
static inline u32 flexcan_read_ip_is_be(void __iomem *addr)
{
	return ioread32be(addr);
}

static inline u32 flexcan_read_ip_is_le(void __iomem *addr)
{
	return ioread32(addr);
}
#endif

#if defined(CONFIG_PPC)
static inline u32 flexcan_read_ip_is_be(void __iomem *addr)
{
	return ioread32(addr);
}

static inline u32 flexcan_read_ip_is_le(void __iomem *addr)
{
	return ioread32be(addr);
}
#endif

[.. snip]

Regards,
Bhupesh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ