2020-10-26 23:59:53

by Arnd Bergmann

[permalink] [raw]
Subject: [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.

Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 4f5fc3e87383..754a66051a21 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -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)
--
2.27.0


2020-10-27 06:34:47

by Arnd Bergmann

[permalink] [raw]
Subject: [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)")
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/gpu/drm/imx/imx-tve.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c
index ef3c25d87d87..2a8d2e32e7b4 100644
--- a/drivers/gpu/drm/imx/imx-tve.c
+++ b/drivers/gpu/drm/imx/imx-tve.c
@@ -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

2020-10-27 06:35:03

by Nick Desaulniers

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

On Mon, Oct 26, 2020 at 12:41 PM Arnd Bergmann <[email protected]> wrote:
>
> 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)")
> Signed-off-by: Arnd Bergmann <[email protected]>

Thanks for the patch!
Reviewed-by: Nick Desaulniers <[email protected]>

> ---
> drivers/gpu/drm/imx/imx-tve.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c
> index ef3c25d87d87..2a8d2e32e7b4 100644
> --- a/drivers/gpu/drm/imx/imx-tve.c
> +++ b/drivers/gpu/drm/imx/imx-tve.c
> @@ -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
>


--
Thanks,
~Nick Desaulniers

2020-10-27 16:42:21

by Jyri Sarha

[permalink] [raw]
Subject: Re: [PATCH 1/4] drm/tilcdc: avoid 'make W=2' build failure

On 26/10/2020 21:41, Arnd Bergmann wrote:
> 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.
>
> Signed-off-by: Arnd Bergmann <[email protected]>

Reviewed-by: Jyri Sarha <[email protected]>

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

Best regards,
Jyri

> ---
> drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index 4f5fc3e87383..754a66051a21 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -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)
>


--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

2020-10-27 17:29:00

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 1/4] drm/tilcdc: avoid 'make W=2' build failure

On Tue, Oct 27, 2020 at 4:31 PM Jyri Sarha <[email protected]> wrote:
> On 26/10/2020 21:41, Arnd Bergmann wrote:
> > 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.
> >
> > Signed-off-by: Arnd Bergmann <[email protected]>
>
> Reviewed-by: Jyri Sarha <[email protected]>

Thanks

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

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

Arnd

2020-10-28 16:47:10

by Philipp Zabel

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

On Mon, 2020-10-26 at 20:41 +0100, Arnd Bergmann wrote:
> 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)")
> Signed-off-by: Arnd Bergmann <[email protected]>

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

regards
Philipp