linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gianfar: Use memset instead of cacheable_memzero
@ 2009-04-28 14:14 Kumar Gala
  2009-04-28 15:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Kumar Gala @ 2009-04-28 14:14 UTC (permalink / raw)
  To: David Miller; +Cc: linuxppc-dev, netdev

cacheable_memzero() is completely overkill for the clearing out the FCB
block which is only 8-bytes.  The compiler should easily optimize this
with memset.  Additionally, cacheable_memzero() only exists on ppc32 and
thus breaks builds of gianfar on ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 drivers/net/gianfar.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index dae1437..2bb038b 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1207,7 +1207,8 @@ static int gfar_enet_open(struct net_device *dev)
 static inline struct txfcb *gfar_add_fcb(struct sk_buff *skb)
 {
 	struct txfcb *fcb = (struct txfcb *)skb_push(skb, GMAC_FCB_LEN);
-	cacheable_memzero(fcb, GMAC_FCB_LEN);
+
+	memset(fcb, 0, GMAC_FCB_LEN);
 
 	return fcb;
 }
-- 
1.6.0.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gianfar: Use memset instead of cacheable_memzero
  2009-04-28 14:14 [PATCH] gianfar: Use memset instead of cacheable_memzero Kumar Gala
@ 2009-04-28 15:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-04-28 15:04 UTC (permalink / raw)
  To: galak; +Cc: linuxppc-dev, netdev

From: Kumar Gala <galak@kernel.crashing.org>
Date: Tue, 28 Apr 2009 09:14:01 -0500

> cacheable_memzero() is completely overkill for the clearing out the FCB
> block which is only 8-bytes.  The compiler should easily optimize this
> with memset.  Additionally, cacheable_memzero() only exists on ppc32 and
> thus breaks builds of gianfar on ppc64.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Applied to net-next-2.6, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-28 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-28 14:14 [PATCH] gianfar: Use memset instead of cacheable_memzero Kumar Gala
2009-04-28 15:04 ` David Miller

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).