* [PATCH] video: fbdev: atmel: fix warning for const return value
@ 2015-07-27 15:41 Rob Herring
2015-07-27 15:49 ` Nicolas Ferre
2015-08-07 5:34 ` Sudip Mukherjee
0 siblings, 2 replies; 4+ messages in thread
From: Rob Herring @ 2015-07-27 15:41 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: linux-kernel, linux-fbdev, Nicolas Ferre,
Jean-Christophe Plagniol-Villard
A const on a return value is meaningless and generates a warning on some
versions of gcc:
drivers/video/fbdev/atmel_lcdfb.c:1003: warning: type qualifiers ignored on function return type
This was found on 0-day with avr32 builds with CONFIG_OF enabled, but
it doesn't seem to generate warnings for other arches.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/fbdev/atmel_lcdfb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
index abadc49..66f4b70 100644
--- a/drivers/video/fbdev/atmel_lcdfb.c
+++ b/drivers/video/fbdev/atmel_lcdfb.c
@@ -999,7 +999,7 @@ static const char *atmel_lcdfb_wiring_modes[] = {
[ATMEL_LCDC_WIRING_RGB] = "RGB",
};
-const int atmel_lcdfb_get_of_wiring_modes(struct device_node *np)
+int atmel_lcdfb_get_of_wiring_modes(struct device_node *np)
{
const char *mode;
int err, i;
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] video: fbdev: atmel: fix warning for const return value
2015-07-27 15:41 [PATCH] video: fbdev: atmel: fix warning for const return value Rob Herring
@ 2015-07-27 15:49 ` Nicolas Ferre
2015-08-07 5:34 ` Sudip Mukherjee
1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Ferre @ 2015-07-27 15:49 UTC (permalink / raw)
To: Rob Herring, Tomi Valkeinen
Cc: linux-kernel, linux-fbdev, Jean-Christophe Plagniol-Villard
Le 27/07/2015 17:41, Rob Herring a écrit :
> A const on a return value is meaningless and generates a warning on some
> versions of gcc:
>
> drivers/video/fbdev/atmel_lcdfb.c:1003: warning: type qualifiers ignored on function return type
>
> This was found on 0-day with avr32 builds with CONFIG_OF enabled, but
> it doesn't seem to generate warnings for other arches.
>
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Sure:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Thanks Rob!
> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
> drivers/video/fbdev/atmel_lcdfb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
> index abadc49..66f4b70 100644
> --- a/drivers/video/fbdev/atmel_lcdfb.c
> +++ b/drivers/video/fbdev/atmel_lcdfb.c
> @@ -999,7 +999,7 @@ static const char *atmel_lcdfb_wiring_modes[] = {
> [ATMEL_LCDC_WIRING_RGB] = "RGB",
> };
>
> -const int atmel_lcdfb_get_of_wiring_modes(struct device_node *np)
> +int atmel_lcdfb_get_of_wiring_modes(struct device_node *np)
> {
> const char *mode;
> int err, i;
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] video: fbdev: atmel: fix warning for const return value
2015-07-27 15:41 [PATCH] video: fbdev: atmel: fix warning for const return value Rob Herring
2015-07-27 15:49 ` Nicolas Ferre
@ 2015-08-07 5:34 ` Sudip Mukherjee
2015-08-20 10:51 ` Tomi Valkeinen
1 sibling, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2015-08-07 5:34 UTC (permalink / raw)
To: Rob Herring
Cc: Tomi Valkeinen, linux-kernel, linux-fbdev, Nicolas Ferre,
Jean-Christophe Plagniol-Villard
On Mon, Jul 27, 2015 at 10:41:41AM -0500, Rob Herring wrote:
> A const on a return value is meaningless and generates a warning on some
> versions of gcc:
>
> drivers/video/fbdev/atmel_lcdfb.c:1003: warning: type qualifiers ignored on function return type
maybe this one should have been static instead of const.
regards
sudip
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] video: fbdev: atmel: fix warning for const return value
2015-08-07 5:34 ` Sudip Mukherjee
@ 2015-08-20 10:51 ` Tomi Valkeinen
0 siblings, 0 replies; 4+ messages in thread
From: Tomi Valkeinen @ 2015-08-20 10:51 UTC (permalink / raw)
To: Sudip Mukherjee, Rob Herring
Cc: linux-kernel, linux-fbdev, Nicolas Ferre,
Jean-Christophe Plagniol-Villard
[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]
On 07/08/15 08:22, Sudip Mukherjee wrote:
> On Mon, Jul 27, 2015 at 10:41:41AM -0500, Rob Herring wrote:
>> A const on a return value is meaningless and generates a warning on some
>> versions of gcc:
>>
>> drivers/video/fbdev/atmel_lcdfb.c:1003: warning: type qualifiers ignored on function return type
> maybe this one should have been static instead of const.
I think that makes sense. I will apply the following patch instead of Rob's,
if no one complains.
Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
Date: Thu Aug 20 13:46:10 2015 +0300
video: fbdev: atmel: fix warning for const return value
A const on a return value is meaningless and generates a warning on some
versions of gcc:
drivers/video/fbdev/atmel_lcdfb.c:1003: warning: type qualifiers ignored on function return type
The function in question is only used inside the .c file, so the author
of the code most likely means "static" instead of "const".
Change the const to static.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
index abadc490fa1f..016cae1425a4 100644
--- a/drivers/video/fbdev/atmel_lcdfb.c
+++ b/drivers/video/fbdev/atmel_lcdfb.c
@@ -999,7 +999,7 @@ static const char *atmel_lcdfb_wiring_modes[] = {
[ATMEL_LCDC_WIRING_RGB] = "RGB",
};
-const int atmel_lcdfb_get_of_wiring_modes(struct device_node *np)
+static int atmel_lcdfb_get_of_wiring_modes(struct device_node *np)
{
const char *mode;
int err, i;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-20 10:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-27 15:41 [PATCH] video: fbdev: atmel: fix warning for const return value Rob Herring
2015-07-27 15:49 ` Nicolas Ferre
2015-08-07 5:34 ` Sudip Mukherjee
2015-08-20 10:51 ` Tomi Valkeinen
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).