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

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

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@infradead.org>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200315041002.24473-6-rdunlap@infradead.org

authored by

Randy Dunlap and committed by
Bartlomiej Zolnierkiewicz
1a56b9fa 5194480c

+5 -5
+1 -1
drivers/video/fbdev/pm2fb.c
··· 54 54 #define DPRINTK(a, b...) \ 55 55 printk(KERN_DEBUG "pm2fb: %s: " a, __func__ , ## b) 56 56 #else 57 - #define DPRINTK(a, b...) 57 + #define DPRINTK(a, b...) no_printk(a, ##b) 58 58 #endif 59 59 60 60 #define PM2_PIXMAP_SIZE (1600 * 4)
+4 -4
drivers/video/fbdev/pm3fb.c
··· 44 44 #define DPRINTK(a, b...) \ 45 45 printk(KERN_DEBUG "pm3fb: %s: " a, __func__ , ## b) 46 46 #else 47 - #define DPRINTK(a, b...) 47 + #define DPRINTK(a, b...) no_printk(a, ##b) 48 48 #endif 49 49 50 50 #define PM3_PIXMAP_SIZE (2048 * 4) ··· 306 306 PM3PixelSize_GLOBAL_32BIT); 307 307 break; 308 308 default: 309 - DPRINTK(1, "Unsupported depth %d\n", 309 + DPRINTK("Unsupported depth %d\n", 310 310 info->var.bits_per_pixel); 311 311 break; 312 312 } ··· 349 349 (1 << 10) | (0 << 3)); 350 350 break; 351 351 default: 352 - DPRINTK(1, "Unsupported depth %d\n", 353 - info->current_par->depth); 352 + DPRINTK("Unsupported depth %d\n", 353 + info->var.bits_per_pixel); 354 354 break; 355 355 } 356 356 }