dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* fbdev: fix -Wextra build warnings
@ 2020-03-15  4:09 ` Randy Dunlap
  2020-03-15  4:09   ` [PATCH 1/6] fbdev: fbmon: " Randy Dunlap
                     ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Randy Dunlap @ 2020-03-15  4:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-fbdev, Florian Tobias Schandinat, Randy Dunlap, dri-devel,
	Bartlomiej Zolnierkiewicz

This patch series fixes warnings in fbdev that are found when
-Wextra is used. In fixing these, there were a few other build
errors discovered (mostly caused by bitrot) and fixed.

[PATCH 1/6] fbdev: fbmon: fix -Wextra build warnings
[PATCH 2/6] fbdev: aty: fix -Wextra build warning
[PATCH 3/6] fbdev: matrox: fix -Wextra build warnings
[PATCH 4/6] fbdev: savage: fix -Wextra build warning
[PATCH 5/6] fbdev: pm[23]fb.c: fix -Wextra build warnings and errors
[PATCH 6/6] fbdev: via: fix -Wextra build warning and format warning

 drivers/video/fbdev/aty/atyfb_base.c       |    2 +-
 drivers/video/fbdev/core/fbmon.c           |    2 +-
 drivers/video/fbdev/matrox/matroxfb_base.h |    2 +-
 drivers/video/fbdev/pm2fb.c                |    2 +-
 drivers/video/fbdev/pm3fb.c                |    8 ++++----
 drivers/video/fbdev/savage/savagefb.h      |    2 +-
 drivers/video/fbdev/via/debug.h            |    6 ++++--
 drivers/video/fbdev/via/viafbdev.c         |    2 +-
 8 files changed, 14 insertions(+), 12 deletions(-)
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/6] fbdev: fbmon: fix -Wextra build warnings
  2020-03-15  4:09 ` fbdev: fix -Wextra build warnings Randy Dunlap
@ 2020-03-15  4:09   ` Randy Dunlap
  2020-03-15  4:09   ` [PATCH 2/6] fbdev: aty: fix -Wextra build warning Randy Dunlap
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2020-03-15  4:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-fbdev, Florian Tobias Schandinat, Randy Dunlap, dri-devel,
	Bartlomiej Zolnierkiewicz

When 'DEBUG' is not defined, modify the DPRINTK() macro 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/core/fbmon.c:812:47: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
../drivers/video/fbdev/core/fbmon.c:842:24: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
../drivers/video/fbdev/core/fbmon.c:847:24: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
---
Alternative: use pr_debug() so that CONFIG_DYNAMIC_DEBUG can be used
at these sites.

 drivers/video/fbdev/core/fbmon.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200313.orig/drivers/video/fbdev/core/fbmon.c
+++ linux-next-20200313/drivers/video/fbdev/core/fbmon.c
@@ -44,7 +44,7 @@
 #ifdef DEBUG
 #define DPRINTK(fmt, args...) printk(fmt,## args)
 #else
-#define DPRINTK(fmt, args...)
+#define DPRINTK(fmt, args...) no_printk(fmt, ##args)
 #endif
 
 #define FBMON_FIX_HEADER  1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/6] fbdev: aty: fix -Wextra build warning
  2020-03-15  4:09 ` fbdev: fix -Wextra build warnings Randy Dunlap
  2020-03-15  4:09   ` [PATCH 1/6] fbdev: fbmon: " Randy Dunlap
@ 2020-03-15  4:09   ` Randy Dunlap
  2020-03-15  4:09   ` [PATCH 3/6] fbdev: matrox: fix -Wextra build warnings Randy Dunlap
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2020-03-15  4:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-fbdev, Florian Tobias Schandinat, Randy Dunlap, dri-devel,
	Bartlomiej Zolnierkiewicz

When 'DEBUG' is not defined, modify the DPRINTK() macro 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/aty/atyfb_base.c:784:61: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
---
Alternative: use pr_debug() so that CONFIG_DYNAMIC_DEBUG can be used
at these sites.

 drivers/video/fbdev/aty/atyfb_base.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200313.orig/drivers/video/fbdev/aty/atyfb_base.c
+++ linux-next-20200313/drivers/video/fbdev/aty/atyfb_base.c
@@ -126,7 +126,7 @@
 #ifdef DEBUG
 #define DPRINTK(fmt, args...)	printk(KERN_DEBUG "atyfb: " fmt, ## args)
 #else
-#define DPRINTK(fmt, args...)
+#define DPRINTK(fmt, args...)	no_printk(fmt, ##args)
 #endif
 
 #define PRINTKI(fmt, args...)	printk(KERN_INFO "atyfb: " fmt, ## args)
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/6] fbdev: matrox: fix -Wextra build warnings
  2020-03-15  4:09 ` fbdev: fix -Wextra build warnings Randy Dunlap
  2020-03-15  4:09   ` [PATCH 1/6] fbdev: fbmon: " Randy Dunlap
  2020-03-15  4:09   ` [PATCH 2/6] fbdev: aty: fix -Wextra build warning Randy Dunlap
@ 2020-03-15  4:09   ` Randy Dunlap
  2020-03-15  4:10   ` [PATCH 4/6] fbdev: savage: fix -Wextra build warning Randy Dunlap
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2020-03-15  4:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-fbdev, Florian Tobias Schandinat, Randy Dunlap, dri-devel,
	Bartlomiej Zolnierkiewicz

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/matrox/matroxfb_base.c:635:77: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
../drivers/video/fbdev/matrox/matroxfb_Ti3026.c:632:54: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
../drivers/video/fbdev/matrox/matroxfb_Ti3026.c:654:53: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
---
Alternative: use pr_debug() so that CONFIG_DYNAMIC_DEBUG can be used
at these sites.

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

--- linux-next-20200313.orig/drivers/video/fbdev/matrox/matroxfb_base.h
+++ linux-next-20200313/drivers/video/fbdev/matrox/matroxfb_base.h
@@ -86,7 +86,7 @@
 #ifdef DEBUG
 #define dprintk(X...)	printk(X)
 #else
-#define dprintk(X...)
+#define dprintk(X...)	no_printk(X)
 #endif
 
 #ifndef PCI_SS_VENDOR_ID_SIEMENS_NIXDORF
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/6] fbdev: savage: fix -Wextra build warning
  2020-03-15  4:09 ` fbdev: fix -Wextra build warnings Randy Dunlap
                     ` (2 preceding siblings ...)
  2020-03-15  4:09   ` [PATCH 3/6] fbdev: matrox: fix -Wextra build warnings Randy Dunlap
@ 2020-03-15  4:10   ` Randy Dunlap
  2020-03-15  4:10   ` [PATCH 5/6] fbdev: pm[23]fb.c: fix -Wextra build warnings and errors Randy Dunlap
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2020-03-15  4:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-fbdev, Florian Tobias Schandinat, Randy Dunlap, dri-devel,
	Bartlomiej Zolnierkiewicz

When 'SAVAGEFB_DEBUG' is not defined, modify the DBG() macro 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/savage/savagefb_driver.c:2411:13: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
---
Alternative: use pr_debug() so that CONFIG_DYNAMIC_DEBUG can be used
at these sites.

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

--- linux-next-20200313.orig/drivers/video/fbdev/savage/savagefb.h
+++ linux-next-20200313/drivers/video/fbdev/savage/savagefb.h
@@ -21,7 +21,7 @@
 #ifdef SAVAGEFB_DEBUG
 # define DBG(x)		printk (KERN_DEBUG "savagefb: %s\n", (x));
 #else
-# define DBG(x)
+# define DBG(x)		no_printk(x)
 # define SavagePrintRegs(...)
 #endif
 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/6] fbdev: pm[23]fb.c: fix -Wextra build warnings and errors
  2020-03-15  4:09 ` fbdev: fix -Wextra build warnings Randy Dunlap
                     ` (3 preceding siblings ...)
  2020-03-15  4:10   ` [PATCH 4/6] fbdev: savage: fix -Wextra build warning Randy Dunlap
@ 2020-03-15  4:10   ` Randy Dunlap
  2020-03-15  4:10   ` [PATCH 6/6] fbdev: via: fix -Wextra build warning and format warning Randy Dunlap
  2020-03-20 13:42   ` fbdev: fix -Wextra build warnings Bartlomiej Zolnierkiewicz
  6 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2020-03-15  4:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-fbdev, Florian Tobias Schandinat, Randy Dunlap, dri-devel,
	Bartlomiej Zolnierkiewicz

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: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
---
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;
 		}
 	}
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 6/6] fbdev: via: fix -Wextra build warning and format warning
  2020-03-15  4:09 ` fbdev: fix -Wextra build warnings Randy Dunlap
                     ` (4 preceding siblings ...)
  2020-03-15  4:10   ` [PATCH 5/6] fbdev: pm[23]fb.c: fix -Wextra build warnings and errors Randy Dunlap
@ 2020-03-15  4:10   ` Randy Dunlap
  2020-03-20 13:42   ` fbdev: fix -Wextra build warnings Bartlomiej Zolnierkiewicz
  6 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2020-03-15  4:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-fbdev, Florian Tobias Schandinat, Randy Dunlap, dri-devel,
	Bartlomiej Zolnierkiewicz

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: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
---
Alternative: use pr_debug() so that CONFIG_DYNAMIC_DEBUG can be used
at these sites.

 drivers/video/fbdev/via/debug.h    |    6 ++++--
 drivers/video/fbdev/via/viafbdev.c |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

--- linux-next-20200313.orig/drivers/video/fbdev/via/debug.h
+++ linux-next-20200313/drivers/video/fbdev/via/debug.h
@@ -7,6 +7,8 @@
 #ifndef __DEBUG_H__
 #define __DEBUG_H__
 
+#include <linux/printk.h>
+
 #ifndef VIAFB_DEBUG
 #define VIAFB_DEBUG 0
 #endif
@@ -14,14 +16,14 @@
 #if VIAFB_DEBUG
 #define DEBUG_MSG(f, a...)   printk(f, ## a)
 #else
-#define DEBUG_MSG(f, a...)
+#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...)
+#define WARN_MSG(f, a...)   no_printk(f, ## a)
 #endif
 
 #endif /* __DEBUG_H__ */
--- linux-next-20200313.orig/drivers/video/fbdev/via/viafbdev.c
+++ linux-next-20200313/drivers/video/fbdev/via/viafbdev.c
@@ -1144,7 +1144,7 @@ static ssize_t viafb_dvp0_proc_write(str
 		if (value != NULL) {
 			if (kstrtou8(value, 0, &reg_val) < 0)
 				return -EINVAL;
-			DEBUG_MSG(KERN_INFO "DVP0:reg_val[%l]=:%x\n", i,
+			DEBUG_MSG(KERN_INFO "DVP0:reg_val[%lu]=:%x\n", i,
 				  reg_val);
 			switch (i) {
 			case 0:
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: fbdev: fix -Wextra build warnings
  2020-03-15  4:09 ` fbdev: fix -Wextra build warnings Randy Dunlap
                     ` (5 preceding siblings ...)
  2020-03-15  4:10   ` [PATCH 6/6] fbdev: via: fix -Wextra build warning and format warning Randy Dunlap
@ 2020-03-20 13:42   ` Bartlomiej Zolnierkiewicz
  6 siblings, 0 replies; 8+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-03-20 13:42 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-fbdev, linux-kernel, dri-devel, Florian Tobias Schandinat


On 3/15/20 5:09 AM, Randy Dunlap wrote:
> This patch series fixes warnings in fbdev that are found when
> -Wextra is used. In fixing these, there were a few other build
> errors discovered (mostly caused by bitrot) and fixed.
> 
> [PATCH 1/6] fbdev: fbmon: fix -Wextra build warnings
> [PATCH 2/6] fbdev: aty: fix -Wextra build warning
> [PATCH 3/6] fbdev: matrox: fix -Wextra build warnings
> [PATCH 4/6] fbdev: savage: fix -Wextra build warning
> [PATCH 5/6] fbdev: pm[23]fb.c: fix -Wextra build warnings and errors
> [PATCH 6/6] fbdev: via: fix -Wextra build warning and format warning
> 
>  drivers/video/fbdev/aty/atyfb_base.c       |    2 +-
>  drivers/video/fbdev/core/fbmon.c           |    2 +-
>  drivers/video/fbdev/matrox/matroxfb_base.h |    2 +-
>  drivers/video/fbdev/pm2fb.c                |    2 +-
>  drivers/video/fbdev/pm3fb.c                |    8 ++++----
>  drivers/video/fbdev/savage/savagefb.h      |    2 +-
>  drivers/video/fbdev/via/debug.h            |    6 ++++--
>  drivers/video/fbdev/via/viafbdev.c         |    2 +-
>  8 files changed, 14 insertions(+), 12 deletions(-)

Patches #1-6 queued for v5.7, thanks!

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-03-20 13:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200315041009eucas1p14e087e86c18ceafe1644589a67de9499@eucas1p1.samsung.com>
2020-03-15  4:09 ` fbdev: fix -Wextra build warnings Randy Dunlap
2020-03-15  4:09   ` [PATCH 1/6] fbdev: fbmon: " Randy Dunlap
2020-03-15  4:09   ` [PATCH 2/6] fbdev: aty: fix -Wextra build warning Randy Dunlap
2020-03-15  4:09   ` [PATCH 3/6] fbdev: matrox: fix -Wextra build warnings Randy Dunlap
2020-03-15  4:10   ` [PATCH 4/6] fbdev: savage: fix -Wextra build warning Randy Dunlap
2020-03-15  4:10   ` [PATCH 5/6] fbdev: pm[23]fb.c: fix -Wextra build warnings and errors Randy Dunlap
2020-03-15  4:10   ` [PATCH 6/6] fbdev: via: fix -Wextra build warning and format warning Randy Dunlap
2020-03-20 13:42   ` fbdev: fix -Wextra build warnings Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).