Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[POWERPC] More DCR native fixups

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>

authored by

David Gibson and committed by
Paul Mackerras
c91ef598 087d7ecd

+2 -2
+2 -2
include/asm-powerpc/dcr-native.h
··· 26 26 27 27 #define DCR_MAP_OK(host) (1) 28 28 29 - #define dcr_map(dev, dcr_n, dcr_c) {} 30 - #define dcr_unmap(host, dcr_n, dcr_c) {} 29 + #define dcr_map(dev, dcr_n, dcr_c) ((dcr_host_t){}) 30 + #define dcr_unmap(host, dcr_n, dcr_c) do {} while (0) 31 31 #define dcr_read(host, dcr_n) mfdcr(dcr_n) 32 32 #define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) 33 33