diff mbox series

[1/2] fbdev: omapfb: avoid -Wempty-body warning

Message ID 20210322105307.1291840-1-arnd@kernel.org
State New
Headers show
Series [1/2] fbdev: omapfb: avoid -Wempty-body warning | expand

Commit Message

Arnd Bergmann March 22, 2021, 10:52 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>


Building with 'make W=1' shows a few harmless warnings:

drivers/video/fbdev/omap2/omapfb/omapfb-main.c: In function 'omapfb_calc_addr':
drivers/video/fbdev/omap2/omapfb/omapfb-main.c:823:56: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  823 |                     var->xoffset, var->yoffset, offset);
      |                                                        ^
drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c: In function 'omapfb_ioctl':
drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c:911:45: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  911 |                 DBG("ioctl failed: %d\n", r);

Avoid these by using no_printk(), which adds format string checking as
well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/video/fbdev/omap2/omapfb/omapfb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.29.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Comments

Geert Uytterhoeven March 22, 2021, 3:05 p.m. UTC | #1
On Mon, Mar 22, 2021 at 11:54 AM Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>

>

> Building with 'make W=1' shows a few harmless warnings:

>

> drivers/video/fbdev/omap2/omapfb/omapfb-main.c: In function 'omapfb_calc_addr':

> drivers/video/fbdev/omap2/omapfb/omapfb-main.c:823:56: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

>   823 |                     var->xoffset, var->yoffset, offset);

>       |                                                        ^

> drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c: In function 'omapfb_ioctl':

> drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c:911:45: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

>   911 |                 DBG("ioctl failed: %d\n", r);

>

> Avoid these by using no_printk(), which adds format string checking as

> well.

>

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>


Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb.h b/drivers/video/fbdev/omap2/omapfb/omapfb.h
index d27abccb37bc..1c1b5201c8b6 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb.h
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb.h
@@ -29,7 +29,7 @@  extern bool omapfb_debug;
 			printk(KERN_DEBUG "OMAPFB: " format, ## __VA_ARGS__); \
 	} while (0)
 #else
-#define DBG(format, ...)
+#define DBG(format, ...) no_printk(format, ## __VA_ARGS__)
 #endif
 
 #define FB2OFB(fb_info) ((struct omapfb_info *)(fb_info->par))