6ce2fc42db
When 'VIAFB_DEBUG' and 'VIAFB_WARN' are not defined, modify the DEBUG_MSG() &WARN_MSG() macros to use the no_printk() macro instead of using <empty>. This fixes a build warning when -Wextra is used and provides printk format checking: ../drivers/video/fbdev/via/ioctl.c:88:47: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body] Also use %lu to print an unsigned long instead of just %l, to fix a printk format warning: ../drivers/video/fbdev/via/viafbdev.c: In function ‘viafb_dvp0_proc_write’: ../drivers/video/fbdev/via/viafbdev.c:1148:14: warning: unknown conversion type character ‘]’ in format [-Wformat=] DEBUG_MSG("DVP0:reg_val[%l]=:%x\n", i, 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-7-rdunlap@infradead.org
30 lines
592 B
C
30 lines
592 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
|
|
* Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
|
|
|
|
*/
|
|
#ifndef __DEBUG_H__
|
|
#define __DEBUG_H__
|
|
|
|
#include <linux/printk.h>
|
|
|
|
#ifndef VIAFB_DEBUG
|
|
#define VIAFB_DEBUG 0
|
|
#endif
|
|
|
|
#if VIAFB_DEBUG
|
|
#define DEBUG_MSG(f, a...) printk(f, ## a)
|
|
#else
|
|
#define DEBUG_MSG(f, a...) no_printk(f, ## a)
|
|
#endif
|
|
|
|
#define VIAFB_WARN 0
|
|
#if VIAFB_WARN
|
|
#define WARN_MSG(f, a...) printk(f, ## a)
|
|
#else
|
|
#define WARN_MSG(f, a...) no_printk(f, ## a)
|
|
#endif
|
|
|
|
#endif /* __DEBUG_H__ */
|