aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2021-03-22 11:07:25 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-04-09 13:05:25 +0200
commitbe8cd6cccf0e3d42f61040bc341ac92a9adde08b (patch)
tree455dd8bcc2e7b8ea0e01b3f4bdeabd5df70205d2 /drivers/media/usb
parentmedia: flexcop: avoid -Wempty-body warning (diff)
downloadlinux-dev-be8cd6cccf0e3d42f61040bc341ac92a9adde08b.tar.xz
linux-dev-be8cd6cccf0e3d42f61040bc341ac92a9adde08b.zip
media: dvb-usb: avoid -Wempty-body warnings
Building with 'make W=1' shows many warnings -Wempty-body warnings like drivers/media/usb/dvb-usb/vp702x-fe.c: In function 'vp702x_fe_set_frontend': drivers/media/usb/dvb-usb/vp702x-fe.c:190:46: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 190 | deb_fe("tuning succeeded.\n"); drivers/media/usb/dvb-usb/dtt200u.c: In function 'dtt200u_rc_query': drivers/media/usb/dvb-usb/dtt200u.c:124:58: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 124 | deb_info("st->data: %*ph\n", 5, st->data); drivers/media/usb/dvb-usb/m920x.c: In function 'm920x_rc_query': drivers/media/usb/dvb-usb/m920x.c:207:58: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 207 | deb("Unknown rc key %02x\n", rc_state[1]); Change the empty dprintk() macros to no_printk(), which avoids this warning and adds format string checking. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/dvb-usb/dvb-usb.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/usb/dvb-usb/dvb-usb.h b/drivers/media/usb/dvb-usb/dvb-usb.h
index 4b6eac0c60b8..0990aa4a17bb 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb.h
+++ b/drivers/media/usb/dvb-usb/dvb-usb.h
@@ -28,18 +28,19 @@
/* debug */
#ifdef CONFIG_DVB_USB_DEBUG
-#define dprintk(var,level,args...) \
- do { if ((var & level)) { printk(args); } } while (0)
+#define dprintk(var, level, args...) \
+ do { if (((var) & (level))) { printk(args); } } while (0)
-#define debug_dump(b,l,func) {\
+#define debug_dump(b, l, func) {\
int loop_; \
- for (loop_ = 0; loop_ < l; loop_++) func("%02x ", b[loop_]); \
+ for (loop_ = 0; loop_ < (l); loop_++) \
+ func("%02x ", b[loop_]); \
func("\n");\
}
#define DVB_USB_DEBUG_STATUS
#else
-#define dprintk(args...)
-#define debug_dump(b,l,func)
+#define dprintk(var, level, args...) no_printk(args)
+#define debug_dump(b, l, func) do { } while (0)
#define DVB_USB_DEBUG_STATUS " (debugging is not enabled)"