diff mbox

dm raid: don't use 'const' in function return

Message ID 20160616090359.984712-1-arnd@arndb.de (mailing list archive)
State Accepted, archived
Delegated to: Mike Snitzer
Headers show

Commit Message

Arnd Bergmann June 16, 2016, 9:03 a.m. UTC
A newly introduced function has 'const int' as the return type,
but as "make W=1" reports, that has no meaning:

drivers/md/dm-raid.c:510:18: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]

This changes the return type to plain 'int'.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 33e53f06850f ("dm raid: introduce extended superblock and new raid types to support takeover/reshaping")
---
 drivers/md/dm-raid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heinz Mauelshagen June 16, 2016, 4:21 p.m. UTC | #1
Thanks Arnd.

On 06/16/2016 11:03 AM, Arnd Bergmann wrote:
> A newly introduced function has 'const int' as the return type,
> but as "make W=1" reports, that has no meaning:
>
> drivers/md/dm-raid.c:510:18: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
>
> This changes the return type to plain 'int'.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 33e53f06850f ("dm raid: introduce extended superblock and new raid types to support takeover/reshaping")
> ---
>   drivers/md/dm-raid.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
> index 96bcff7a0b94..55d25ac87bda 100644
> --- a/drivers/md/dm-raid.c
> +++ b/drivers/md/dm-raid.c
> @@ -507,7 +507,7 @@ static const char *raid10_md_layout_to_format(int layout)
>   }
>   
>   /* Return md raid10 algorithm for @name */
> -static const int raid10_name_to_format(const char *name)
> +static int raid10_name_to_format(const char *name)
>   {
>   	if (!strcasecmp(name, "near"))
>   		return ALGORITHM_RAID10_NEAR;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Geert Uytterhoeven Feb. 1, 2018, 9:24 a.m. UTC | #2
On Thu, Jun 16, 2016 at 11:03 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> A newly introduced function has 'const int' as the return type,
> but as "make W=1" reports, that has no meaning:
>
> drivers/md/dm-raid.c:510:18: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
>
> This changes the return type to plain 'int'.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 33e53f06850f ("dm raid: introduce extended superblock and new raid types to support takeover/reshaping")

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

The same issue has been reintroduced.
So please reapply commit 68c1c4d5eafc65dd ("dm raid: don't use 'const' in
function return") with

Fixes: 552aa679f2657431 ("dm raid: use rs_is_raid*()")

> index 96bcff7a0b94..55d25ac87bda 100644
> --- a/drivers/md/dm-raid.c
> +++ b/drivers/md/dm-raid.c
> @@ -507,7 +507,7 @@ static const char *raid10_md_layout_to_format(int layout)
>  }
>
>  /* Return md raid10 algorithm for @name */
> -static const int raid10_name_to_format(const char *name)
> +static int raid10_name_to_format(const char *name)
>  {
>         if (!strcasecmp(name, "near"))
>                 return ALGORITHM_RAID10_NEAR;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 96bcff7a0b94..55d25ac87bda 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -507,7 +507,7 @@  static const char *raid10_md_layout_to_format(int layout)
 }
 
 /* Return md raid10 algorithm for @name */
-static const int raid10_name_to_format(const char *name)
+static int raid10_name_to_format(const char *name)
 {
 	if (!strcasecmp(name, "near"))
 		return ALGORITHM_RAID10_NEAR;