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

Blackfin: fix addr type with bfin_write_{or,and} helpers

Since the bfin_write() func needs proper type information in order to
expand into the right bfin_writeX() variant, preserve the addr's type
when setting up the local __addr. Otherwise the helpers will detect
the variant based upon sizeof(void) which is almost never right.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

+2 -2
+2 -2
arch/blackfin/include/asm/def_LPBlackfin.h
··· 69 69 70 70 #define bfin_write_or(addr, bits) \ 71 71 do { \ 72 - void *__addr = (void *)(addr); \ 72 + typeof(addr) __addr = (addr); \ 73 73 bfin_write(__addr, bfin_read(__addr) | (bits)); \ 74 74 } while (0) 75 75 76 76 #define bfin_write_and(addr, bits) \ 77 77 do { \ 78 - void *__addr = (void *)(addr); \ 78 + typeof(addr) __addr = (addr); \ 79 79 bfin_write(__addr, bfin_read(__addr) & (bits)); \ 80 80 } while (0) 81 81