Skip to contentSkip to conversation

drm/tilcdc: avoid 'make W=2' build failure

PATCH Applied Arnd Bergmann 8 participants 14 messages Oct 26, 2020 – Oct 28, 2020

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 drm/tilcdc: avoid 'make W=2' build failure

From: Arnd Bergmann <[email protected]>

The -Wmissing-field-initializer warning when building with W=2 turns into an error because tilcdc is built with -Werror:

drm/tilcdc/tilcdc_drv.c:431:33: error: missing field 'data' initializer [-Werror,-Wmissing-field-initializers] { "regs", tilcdc_regs_show, 0 },
drm/tilcdc/tilcdc_drv.c:432:33: error: missing field 'data' initializer [-Werror,-Wmissing-field-initializers] { "mm", tilcdc_mm_show, 0 },

Add the missing field initializers to address the warning.

---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +2 -2
index 4f5fc3e87383..754a66051a21 100644
@@ -428,8 +428,8 @@ static int tilcdc_mm_show(struct seq_file *m, void *arg)
 }
 
 static struct drm_info_list tilcdc_debugfs_list[] = {
-		{ "regs", tilcdc_regs_show, 0 },
-		{ "mm",   tilcdc_mm_show,   0 },
+		{ "regs", tilcdc_regs_show, 0, NULL },
+		{ "mm",   tilcdc_mm_show,   0, NULL },
 };
 
 static void tilcdc_debugfs_init(struct drm_minor *minor)
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/4 drm/imx: tve remove extraneous type qualifier

From: Arnd Bergmann <[email protected]>

clang warns about functions returning a 'const int' result:

drivers/gpu/drm/imx/imx-tve.c:487:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

Remove the extraneous 'const' qualifier here. I would guess that the function was intended to be marked __attribute__((const)) instead, but that would also be wrong since it call other functions without that attribute.

Fixes fcbc51e54d2a ("staging: drm/imx: Add support for Television Encoder (TVEv2)")
---
 drivers/gpu/drm/imx/imx-tve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/imx/imx-tve.c +1 -1
index ef3c25d87d87..2a8d2e32e7b4 100644
@@ -484,7 +484,7 @@ static const char * const imx_tve_modes[] = {
 	[TVE_MODE_VGA] = "vga",
 };
 
-static const int of_get_tve_mode(struct device_node *np)
+static int of_get_tve_mode(struct device_node *np)
 {
 	const char *bm;
 	int ret, i;
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 3/4 drm/msm: fix -Woverride-init warning

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

There is one harmless duplicate initialization that causes a warning with 'make W=1':

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:122:19: warning: initialized field overwritten [-Woverride-init]
122 | .max_linewidth = 4096,
| ^~~~
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:122:19: note: (near initialization for 'sm8250_dpu_caps.max_linewidth')

Remove one of the two identical initializers to avoid the warning.

Fixes af776a3e1c30 ("drm/msm/dpu: add SM8250 to hw catalog")
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +0 -1
index 60b304b72b7c..9c23f814ccaf 100644
@@ -111,7 +111,6 @@ static const struct dpu_caps sm8150_dpu_caps = {
 static const struct dpu_caps sm8250_dpu_caps = {
 	.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
 	.max_mixer_blendstages = 0xb,
-	.max_linewidth = 4096,
 	.qseed_type = DPU_SSPP_SCALER_QSEED3, /* TODO: qseed3 lite */
 	.smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */
 	.ubwc_version = DPU_HW_UBWC_VER_40,
Signature · 1 line
2.27.0
#7 lore raw

PATCH 4/4 drm/gma500: avoid Woverride-init warning

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

gcc -Wextra notices that one of the fields in psbfb_roll_ops has two initializers:

drivers/gpu/drm/gma500/framebuffer.c:185:20: warning: initialized field overwritten [-Woverride-init]

Open-code this instead, leaving out the extraneous initializers for .fb_pan_display.

Fixes 3da6c2f3b730 ("drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops")
---
 drivers/gpu/drm/gma500/framebuffer.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/gma500/framebuffer.c +8 -1
index 54d9876b5305..a56a6b53fac6 100644
@@ -177,7 +177,14 @@ static const struct fb_ops psbfb_ops = {
 
 static const struct fb_ops psbfb_roll_ops = {
 	.owner = THIS_MODULE,
-	DRM_FB_HELPER_DEFAULT_OPS,
+	.fb_check_var = drm_fb_helper_check_var,
+	.fb_set_par = drm_fb_helper_set_par,
+	.fb_setcmap = drm_fb_helper_setcmap,
+	.fb_blank = drm_fb_helper_blank,
+	.fb_debug_enter = drm_fb_helper_debug_enter,
+	.fb_debug_leave = drm_fb_helper_debug_leave,
+	.fb_ioctl = drm_fb_helper_ioctl,
+
 	.fb_setcolreg = psbfb_setcolreg,
 	.fb_fillrect = drm_fb_helper_cfb_fillrect,
 	.fb_copyarea = drm_fb_helper_cfb_copyarea,
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 2/4
#2 lore raw

Re: [PATCH 2/4] drm/imx: tve remove extraneous type qualifier

In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

clang warns about functions returning a 'const int' result:

drivers/gpu/drm/imx/imx-tve.c:487:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

Quoted 7 lines

Remove the extraneous 'const' qualifier here. I would guess that the function was intended to be marked __attribute__((const)) instead, but that would also be wrong since it call other functions without that attribute.

Fixes fcbc51e54d2a ("staging: drm/imx: Add support for Television Encoder (TVEv2)")

Thanks for the patch!

Quoted 20 lines
---
 drivers/gpu/drm/imx/imx-tve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/imx/imx-tve.c +1 -2
index ef3c25d87d87..2a8d2e32e7b4 100644
@@ -484,7 +484,7 @@ static const char * const imx_tve_modes[] = {
        [TVE_MODE_VGA] = "vga",
 };
 
-static const int of_get_tve_mode(struct device_node *np)
+static int of_get_tve_mode(struct device_node *np)
 {
        const char *bm;
        int ret, i;
--

2.27.0

Signature · 2 lines
Thanks,
~Nick Desaulniers
Reviewed-by on v1 3/4
#5 lore raw

Re: [Freedreno] [PATCH 3/4] drm/msm: fix -Woverride-init warning

In reply to Arnd Bergmann
Quoted 12 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

There is one harmless duplicate initialization that causes a warning with 'make W=1':

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:122:19: warning:
initialized field overwritten [-Woverride-init]
122 | .max_linewidth = 4096,
| ^~~~
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:122:19: note: (near initialization for 'sm8250_dpu_caps.max_linewidth')

Quoted 4 lines

Remove one of the two identical initializers to avoid the warning.

Fixes af776a3e1c30 ("drm/msm/dpu: add SM8250 to hw catalog")
Quoted 17 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +0 -1
index 60b304b72b7c..9c23f814ccaf 100644
@@ -111,7 +111,6 @@ static const struct dpu_caps sm8150_dpu_caps = {
 static const struct dpu_caps sm8250_dpu_caps = {
 	.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
 	.max_mixer_blendstages = 0xb,
-	.max_linewidth = 4096,
 	.qseed_type = DPU_SSPP_SCALER_QSEED3, /* TODO: qseed3 lite */
 	.smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */
 	.ubwc_version = DPU_HW_UBWC_VER_40,
Reviewed-by on v1 3/4
#6 lore raw

Re: [PATCH 3/4] drm/msm: fix -Woverride-init warning

In reply to Arnd Bergmann

Quoting Arnd Bergmann (2020-10-26 12:41:03)

Quoted 10 lines

From: Arnd Bergmann <[email protected]>

There is one harmless duplicate initialization that causes a warning with 'make W=1':

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:122:19: warning: initialized field overwritten [-Woverride-init]
122 | .max_linewidth = 4096,
| ^~~~
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:122:19: note: (near initialization for 'sm8250_dpu_caps.max_linewidth')

Quoted 5 lines

Remove one of the two identical initializers to avoid the warning.

Fixes af776a3e1c30 ("drm/msm/dpu: add SM8250 to hw catalog")

---

#8 lore raw

Re: [PATCH 4/4] drm/gma500: avoid Woverride-init warning

In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

gcc -Wextra notices that one of the fields in psbfb_roll_ops has two initializers:

Quoted 7 lines

drivers/gpu/drm/gma500/framebuffer.c:185:20: warning: initialized field overwritten [-Woverride-init]

Open-code this instead, leaving out the extraneous initializers for .fb_pan_display.

Fixes 3da6c2f3b730 ("drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops")

Scrollback is dead, so I'm not sure it's even worth to keep all this. I'd just garbage-collect this, maybe als the entire accelerator code and just leave psbfb_unaccel_ops behind ...
-Daniel

Quoted 27 lines
---
 drivers/gpu/drm/gma500/framebuffer.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/gma500/framebuffer.c +8 -1
index 54d9876b5305..a56a6b53fac6 100644
@@ -177,7 +177,14 @@ static const struct fb_ops psbfb_ops = {
 
 static const struct fb_ops psbfb_roll_ops = {
 	.owner = THIS_MODULE,
-	DRM_FB_HELPER_DEFAULT_OPS,
+	.fb_check_var = drm_fb_helper_check_var,
+	.fb_set_par = drm_fb_helper_set_par,
+	.fb_setcmap = drm_fb_helper_setcmap,
+	.fb_blank = drm_fb_helper_blank,
+	.fb_debug_enter = drm_fb_helper_debug_enter,
+	.fb_debug_leave = drm_fb_helper_debug_leave,
+	.fb_ioctl = drm_fb_helper_ioctl,
+
 	.fb_setcolreg = psbfb_setcolreg,
 	.fb_fillrect = drm_fb_helper_cfb_fillrect,
 	.fb_copyarea = drm_fb_helper_cfb_copyarea,
Signature · 1 line
2.27.0
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#9 lore raw

Re: [PATCH 4/4] drm/gma500: avoid Woverride-init warning

Quoted 12 lines · Daniel Vetter
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

gcc -Wextra notices that one of the fields in psbfb_roll_ops has two initializers:

drivers/gpu/drm/gma500/framebuffer.c:185:20: warning: initialized field overwritten [-Woverride-init]

Open-code this instead, leaving out the extraneous initializers for .fb_pan_display.

Quoted 7 lines
Quoted 2 lines
Fixes 3da6c2f3b730 ("drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops")

Scrollback is dead, so I'm not sure it's even worth to keep all this. I'd just garbage-collect this, maybe als the entire accelerator code and just leave psbfb_unaccel_ops behind ...
-Daniel

That's been my idea for quite some time. The gtt roll code is also broken in multi display setups.

Arnd, I can take care of this unless you feel an urge to do it yourself.

-Patrik
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [PATCH 2/4] drm/imx: tve remove extraneous type qualifier

In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

clang warns about functions returning a 'const int' result:

drivers/gpu/drm/imx/imx-tve.c:487:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

Quoted 7 lines

Remove the extraneous 'const' qualifier here. I would guess that the function was intended to be marked __attribute__((const)) instead, but that would also be wrong since it call other functions without that attribute.

Fixes fcbc51e54d2a ("staging: drm/imx: Add support for Television Encoder (TVEv2)")

Thank you, applied to imx-drm/next with Nick's R-b.

regards
Philipp
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/4
#12 lore raw
In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The -Wmissing-field-initializer warning when building with W=2 turns into an error because tilcdc is built with -Werror:

drm/tilcdc/tilcdc_drv.c:431:33: error: missing field 'data' initializer [-Werror,-Wmissing-field-initializers] { "regs", tilcdc_regs_show, 0 },
drm/tilcdc/tilcdc_drv.c:432:33: error: missing field 'data' initializer [-Werror,-Wmissing-field-initializers] { "mm", tilcdc_mm_show, 0 },

Add the missing field initializers to address the warning.

Please let me know if you want me to merge this.

Best regards,
Jyri

Quoted 20 lines
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +2 -2
index 4f5fc3e87383..754a66051a21 100644
@@ -428,8 +428,8 @@ static int tilcdc_mm_show(struct seq_file *m, void *arg)
 }
 
 static struct drm_info_list tilcdc_debugfs_list[] = {
-		{ "regs", tilcdc_regs_show, 0 },
-		{ "mm",   tilcdc_mm_show,   0 },
+		{ "regs", tilcdc_regs_show, 0, NULL },
+		{ "mm",   tilcdc_mm_show,   0, NULL },
 };
 
 static void tilcdc_debugfs_init(struct drm_minor *minor)
Signature · 6 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw
Quoted 6 lines · Jyri Sarha
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The -Wmissing-field-initializer warning when building with W=2 turns into an error because tilcdc is built with -Werror:

Quoted 8 lines
Quoted 6 lines

drm/tilcdc/tilcdc_drv.c:431:33: error: missing field 'data' initializer [-Werror,-Wmissing-field-initializers] { "regs", tilcdc_regs_show, 0 },
drm/tilcdc/tilcdc_drv.c:432:33: error: missing field 'data' initializer [-Werror,-Wmissing-field-initializers] { "mm", tilcdc_mm_show, 0 },

Add the missing field initializers to address the warning.

Thanks

Quoted 1 line

Please let me know if you want me to merge this.

Yes, it would be good if you can merge it directly.

Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

Re: [PATCH 4/4] drm/gma500: avoid Woverride-init warning

In reply to Patrik Jakobsson
Quoted 20 lines · Patrik Jakobsson
Quoted 11 lines · Daniel Vetter
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

gcc -Wextra notices that one of the fields in psbfb_roll_ops has two initializers:

drivers/gpu/drm/gma500/framebuffer.c:185:20: warning: initialized field overwritten [-Woverride-init]

Open-code this instead, leaving out the extraneous initializers for .fb_pan_display.

Quoted 7 lines
Quoted 2 lines
Fixes 3da6c2f3b730 ("drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops")

Scrollback is dead, so I'm not sure it's even worth to keep all this. I'd just garbage-collect this, maybe als the entire accelerator code and just leave psbfb_unaccel_ops behind ...
-Daniel

Quoted 4 lines

That's been my idea for quite some time. The gtt roll code is also broken in multi display setups.

Arnd, I can take care of this unless you feel an urge to do it yourself.

That would be good, thanks

I have no specific interest in the drm drivers, this is just part of a larger work to enable more of the W=1 options across the kernel by default, after all the existing warnings are addressed.

Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#11 lore raw

Re: [PATCH 4/4] drm/gma500: avoid Woverride-init warning

Quoted 23 lines · Arnd Bergmann
Quoted 20 lines · Patrik Jakobsson
Quoted 18 lines · Daniel Vetter
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

gcc -Wextra notices that one of the fields in psbfb_roll_ops has two initializers:

Quoted 7 lines

drivers/gpu/drm/gma500/framebuffer.c:185:20: warning: initialized field overwritten [-Woverride-init]

Open-code this instead, leaving out the extraneous initializers for .fb_pan_display.

Fixes 3da6c2f3b730 ("drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops")

Scrollback is dead, so I'm not sure it's even worth to keep all this. I'd just garbage-collect this, maybe als the entire accelerator code and just leave psbfb_unaccel_ops behind ...
-Daniel

Quoted 6 lines
Quoted 4 lines

That's been my idea for quite some time. The gtt roll code is also broken in multi display setups.

Arnd, I can take care of this unless you feel an urge to do it yourself.

That would be good, thanks

Should be fixed with:
https://patchwork.freedesktop.org/patch/397482/?series=83153&rev=1

Quoted 6 lines

I have no specific interest in the drm drivers, this is just part of a larger work to enable more of the W=1 options across the kernel by default, after all the existing warnings are addressed.

Arnd

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel