Skip to content

Commit

Permalink
Blackfin: debug-mmrs: prevent macro arg from expanding
Browse files Browse the repository at this point in the history
Passing a non-simple expression in as the addr arg could incorrectly
apply the pointer cast resulting in misbehavior.  Add proper paren.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Mike Frysinger committed Jul 23, 2011
1 parent 7595ac0 commit 94674b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/blackfin/kernel/debug-mmrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define PORT_MUX BFIN_PORT_MUX
#endif

#define _d(name, bits, addr, perms) debugfs_create_x##bits(name, perms, parent, (u##bits *)addr)
#define _d(name, bits, addr, perms) debugfs_create_x##bits(name, perms, parent, (u##bits *)(addr))
#define d(name, bits, addr) _d(name, bits, addr, S_IRUSR|S_IWUSR)
#define d_RO(name, bits, addr) _d(name, bits, addr, S_IRUSR)
#define d_WO(name, bits, addr) _d(name, bits, addr, S_IWUSR)
Expand Down

0 comments on commit 94674b1

Please sign in to comment.