提交 7a7a430f 编写于 作者: M Mike Frysinger

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: NMike Frysinger <vapier@gentoo.org>
上级 934fe05b
...@@ -69,13 +69,13 @@ do { \ ...@@ -69,13 +69,13 @@ do { \
#define bfin_write_or(addr, bits) \ #define bfin_write_or(addr, bits) \
do { \ do { \
void *__addr = (void *)(addr); \ typeof(addr) __addr = (addr); \
bfin_write(__addr, bfin_read(__addr) | (bits)); \ bfin_write(__addr, bfin_read(__addr) | (bits)); \
} while (0) } while (0)
#define bfin_write_and(addr, bits) \ #define bfin_write_and(addr, bits) \
do { \ do { \
void *__addr = (void *)(addr); \ typeof(addr) __addr = (addr); \
bfin_write(__addr, bfin_read(__addr) & (bits)); \ bfin_write(__addr, bfin_read(__addr) & (bits)); \
} while (0) } while (0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册