[PATCH 5/6] fbdev: pm[23]fb.c: fix -Wextra build warnings and errors

From: Randy Dunlap
Date: Sun Mar 15 2020 - 03:15:36 EST


When 'DEBUG' is not defined, modify the DPRINTK() macro to use the
no_printk() macro instead of using <empty>.
This fixes build warnings when -Wextra is used and provides
printk format checking:

../drivers/video/fbdev/pm2fb.c:227:38: warning: suggest braces around empty body in an âifâ statement [-Wempty-body]
../drivers/video/fbdev/pm3fb.c:1039:33: warning: suggest braces around empty body in an âelseâ statement [-Wempty-body]

Also drop one argument in two DPRINTK() macro uses to provide the
correct number of arguments and use the correct field in one case
to fix a build error:

../drivers/video/fbdev/pm3fb.c:353:9: error: âstruct fb_infoâ has no member named âcurrent_parâ
info->current_par->depth);

Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@xxxxxxxxxxx>
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: linux-fbdev@xxxxxxxxxxxxxxx
---
Alternative: use pr_debug() so that CONFIG_DYNAMIC_DEBUG can be used
at these sites.

drivers/video/fbdev/pm2fb.c | 2 +-
drivers/video/fbdev/pm3fb.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)

--- linux-next-20200313.orig/drivers/video/fbdev/pm2fb.c
+++ linux-next-20200313/drivers/video/fbdev/pm2fb.c
@@ -54,7 +54,7 @@
#define DPRINTK(a, b...) \
printk(KERN_DEBUG "pm2fb: %s: " a, __func__ , ## b)
#else
-#define DPRINTK(a, b...)
+#define DPRINTK(a, b...) no_printk(a, ##b)
#endif

#define PM2_PIXMAP_SIZE (1600 * 4)
--- linux-next-20200313.orig/drivers/video/fbdev/pm3fb.c
+++ linux-next-20200313/drivers/video/fbdev/pm3fb.c
@@ -44,7 +44,7 @@
#define DPRINTK(a, b...) \
printk(KERN_DEBUG "pm3fb: %s: " a, __func__ , ## b)
#else
-#define DPRINTK(a, b...)
+#define DPRINTK(a, b...) no_printk(a, ##b)
#endif

#define PM3_PIXMAP_SIZE (2048 * 4)
@@ -306,7 +306,7 @@ static void pm3fb_init_engine(struct fb_
PM3PixelSize_GLOBAL_32BIT);
break;
default:
- DPRINTK(1, "Unsupported depth %d\n",
+ DPRINTK("Unsupported depth %d\n",
info->var.bits_per_pixel);
break;
}
@@ -349,8 +349,8 @@ static void pm3fb_init_engine(struct fb_
(1 << 10) | (0 << 3));
break;
default:
- DPRINTK(1, "Unsupported depth %d\n",
- info->current_par->depth);
+ DPRINTK("Unsupported depth %d\n",
+ info->var.bits_per_pixel);
break;
}
}