* [net-next] gianfar: use more portable i/o accessors
@ 2013-01-11 22:18 Kim Phillips
2013-01-11 23:59 ` David Miller
2013-01-12 13:44 ` Tabi Timur-B04825
0 siblings, 2 replies; 4+ messages in thread
From: Kim Phillips @ 2013-01-11 22:18 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller
in/out_be32 accessors are Power arch centric whereas
ioread/writebe32 are available in other arches. Also, unlike
in/out_be32, ioread/writebe32 expect non-volatile address arguments.
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
drivers/net/ethernet/freescale/gianfar.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 1b6a67c..91bb2de 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -1136,16 +1136,16 @@ static inline int gfar_has_errata(struct gfar_private *priv,
return priv->errata & err;
}
-static inline u32 gfar_read(volatile unsigned __iomem *addr)
+static inline u32 gfar_read(unsigned __iomem *addr)
{
u32 val;
- val = in_be32(addr);
+ val = ioread32be(addr);
return val;
}
-static inline void gfar_write(volatile unsigned __iomem *addr, u32 val)
+static inline void gfar_write(unsigned __iomem *addr, u32 val)
{
- out_be32(addr, val);
+ iowrite32be(val, addr);
}
static inline void gfar_write_filer(struct gfar_private *priv,
--
1.8.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net-next] gianfar: use more portable i/o accessors
2013-01-11 22:18 [net-next] gianfar: use more portable i/o accessors Kim Phillips
@ 2013-01-11 23:59 ` David Miller
2013-01-12 13:44 ` Tabi Timur-B04825
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2013-01-11 23:59 UTC (permalink / raw)
To: kim.phillips; +Cc: netdev
From: Kim Phillips <kim.phillips@freescale.com>
Date: Fri, 11 Jan 2013 16:18:21 -0600
> in/out_be32 accessors are Power arch centric whereas
> ioread/writebe32 are available in other arches. Also, unlike
> in/out_be32, ioread/writebe32 expect non-volatile address arguments.
>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net-next] gianfar: use more portable i/o accessors
2013-01-11 22:18 [net-next] gianfar: use more portable i/o accessors Kim Phillips
2013-01-11 23:59 ` David Miller
@ 2013-01-12 13:44 ` Tabi Timur-B04825
2013-01-12 15:57 ` Richard Cochran
1 sibling, 1 reply; 4+ messages in thread
From: Tabi Timur-B04825 @ 2013-01-12 13:44 UTC (permalink / raw)
To: Phillips Kim-R1AAHA; +Cc: netdev@vger.kernel.org, David S. Miller
On Fri, Jan 11, 2013 at 4:18 PM, Kim Phillips
<kim.phillips@freescale.com> wrote:
> in/out_be32 accessors are Power arch centric whereas
> ioread/writebe32 are available in other arches. Also, unlike
> in/out_be32, ioread/writebe32 expect non-volatile address arguments.
I was under the impression that the "volatile" in in/out_be32() is so
that the functions can accept a volatile pointer, not that it expects
one. Otherwise, if you pass in a volatile, you'll get a compiler
warning.
>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
> drivers/net/ethernet/freescale/gianfar.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
> index 1b6a67c..91bb2de 100644
> --- a/drivers/net/ethernet/freescale/gianfar.h
> +++ b/drivers/net/ethernet/freescale/gianfar.h
> @@ -1136,16 +1136,16 @@ static inline int gfar_has_errata(struct gfar_private *priv,
> return priv->errata & err;
> }
>
> -static inline u32 gfar_read(volatile unsigned __iomem *addr)
> +static inline u32 gfar_read(unsigned __iomem *addr)
> {
> u32 val;
> - val = in_be32(addr);
> + val = ioread32be(addr);
> return val;
> }
Can't we just get rid of these functions altogether? Or at least, get
rid of the local variable?
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net-next] gianfar: use more portable i/o accessors
2013-01-12 13:44 ` Tabi Timur-B04825
@ 2013-01-12 15:57 ` Richard Cochran
0 siblings, 0 replies; 4+ messages in thread
From: Richard Cochran @ 2013-01-12 15:57 UTC (permalink / raw)
To: Tabi Timur-B04825
Cc: Phillips Kim-R1AAHA, netdev@vger.kernel.org, David S. Miller
On Sat, Jan 12, 2013 at 01:44:43PM +0000, Tabi Timur-B04825 wrote:
>
> Can't we just get rid of these functions altogether?
Since they are already in place, I would leave them there. Watching
the kernel development over time, every few years these IO access
idioms tend to change form, and having helper functions avoids huge
change sets when updating.
> Or at least, get
> rid of the local variable?
Okay, sure.
Thanks,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-12 15:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-11 22:18 [net-next] gianfar: use more portable i/o accessors Kim Phillips
2013-01-11 23:59 ` David Miller
2013-01-12 13:44 ` Tabi Timur-B04825
2013-01-12 15:57 ` Richard Cochran
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).