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

Configure Feed

Select the types of activity you want to include in your feed.

[media] rc-core.h: Surround macro with do {} while (0)

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>

authored by

Joe Perches and committed by
Mauro Carvalho Chehab
86b0dbef 44d0b80e

+5 -2
+5 -2
include/media/rc-core.h
··· 23 23 #include <media/rc-map.h> 24 24 25 25 extern int rc_core_debug; 26 - #define IR_dprintk(level, fmt, arg...) if (rc_core_debug >= level) \ 27 - printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) 26 + #define IR_dprintk(level, fmt, ...) \ 27 + do { \ 28 + if (rc_core_debug >= level) \ 29 + pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \ 30 + } while (0) 28 31 29 32 enum rc_driver_type { 30 33 RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */