All of lore.kernel.org
 help / color / mirror / Atom feed
* More DCR native fixups
@ 2007-02-09  3:07 David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2007-02-09  3:07 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Paulus, please apply

Getting BenH's new EMAC driver working on 440GP, I found some more
problems in the native mode paths of the new DCR code.  Here's a fix.

Signed-off-by: David Gibson <dwg@au1.ibm.com>

Index: working-2.6/include/asm-powerpc/dcr-native.h
===================================================================
--- working-2.6.orig/include/asm-powerpc/dcr-native.h	2007-02-09 13:59:07.000000000 +1100
+++ working-2.6/include/asm-powerpc/dcr-native.h	2007-02-09 13:59:36.000000000 +1100
@@ -26,8 +26,8 @@ typedef struct {} dcr_host_t;
 
 #define DCR_MAP_OK(host)	(1)
 
-#define dcr_map(dev, dcr_n, dcr_c)	{}
-#define dcr_unmap(host, dcr_n, dcr_c)	{}
+#define dcr_map(dev, dcr_n, dcr_c)	((dcr_host_t){})
+#define dcr_unmap(host, dcr_n, dcr_c)	do {} while (0)
 #define dcr_read(host, dcr_n)		mfdcr(dcr_n)
 #define dcr_write(host, dcr_n, value)	mtdcr(dcr_n, value)
 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

* More DCR native fixups
@ 2007-02-15  3:38 David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2007-02-15  3:38 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Paulus, resent with better description.  Please apply.

Getting BenH's new EMAC driver working on 440GP, I found some more
problems in the native mode paths of the new DCR code:
	- dcr_map() is supposed to return a dcr_host_t, but the native
version is a macro that doesn't expand to an expression.  With native
DCRs, dcr_host_t is an empty structure, so we just use a constructor
expression instead.
	- dcr_unmap() uses {} instead of the safer do {} while (0)
idiom to implement a no-op

Here's a fix.

Signed-off-by: David Gibson <dwg@au1.ibm.com>

Index: working-2.6/include/asm-powerpc/dcr-native.h
===================================================================
--- working-2.6.orig/include/asm-powerpc/dcr-native.h	2007-02-09 13:59:07.000000000 +1100
+++ working-2.6/include/asm-powerpc/dcr-native.h	2007-02-09 13:59:36.000000000 +1100
@@ -26,8 +26,8 @@ typedef struct {} dcr_host_t;
 
 #define DCR_MAP_OK(host)	(1)
 
-#define dcr_map(dev, dcr_n, dcr_c)	{}
-#define dcr_unmap(host, dcr_n, dcr_c)	{}
+#define dcr_map(dev, dcr_n, dcr_c)	((dcr_host_t){})
+#define dcr_unmap(host, dcr_n, dcr_c)	do {} while (0)
 #define dcr_read(host, dcr_n)		mfdcr(dcr_n)
 #define dcr_write(host, dcr_n, value)	mtdcr(dcr_n, value)
 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

end of thread, other threads:[~2007-02-15  3:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-09  3:07 More DCR native fixups David Gibson
2007-02-15  3:38 David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.