Skip to content

Commit

Permalink
[media] rc-core.h: Surround macro with do {} while (0)
Browse files Browse the repository at this point in the history
Macros coded with if statements should be do { if... } while (0)
so the macros can be used in other if tests.

Use ##__VA_ARGS__ for variadic macro as well.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Joe Perches authored and Mauro Carvalho Chehab committed Sep 3, 2011
1 parent 44d0b80 commit 86b0dbe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/media/rc-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
#include <media/rc-map.h>

extern int rc_core_debug;
#define IR_dprintk(level, fmt, arg...) if (rc_core_debug >= level) \
printk(KERN_DEBUG "%s: " fmt , __func__, ## arg)
#define IR_dprintk(level, fmt, ...) \
do { \
if (rc_core_debug >= level) \
pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \
} while (0)

enum rc_driver_type {
RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */
Expand Down

0 comments on commit 86b0dbe

Please sign in to comment.