Skip to content

Commit

Permalink
[POWERPC] More DCR native fixups
Browse files Browse the repository at this point in the history
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>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
David Gibson authored and Paul Mackerras committed Feb 16, 2007
1 parent 087d7ec commit c91ef59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asm-powerpc/dcr-native.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c91ef59

Please sign in to comment.