linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dm raid: don't use 'const' in function return
@ 2018-06-22  8:01 Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2018-06-22  8:01 UTC (permalink / raw)
  To: Alasdair Kergon, Mike Snitzer, Arnd Bergmann
  Cc: dm-devel, linux-kernel, Geert Uytterhoeven

From: Arnd Bergmann <arnd@arndb.de>

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")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Fixes: 552aa679f2657431 ("dm raid: use rs_is_raid*()")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Cherry-picked from 68c1c4d5eafc65dd ("dm raid: don't use 'const' in
function return") with new Fixes tag, as the issue has been
reintroduced.
---
 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 ab13fcec3fca046c..75df4c9d8b541de4 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -588,7 +588,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;
-- 
2.17.1


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

* Re: [PATCH] dm raid: don't use 'const' in function return
  2016-06-16  9:03 Arnd Bergmann
  2016-06-16 16:21 ` Heinz Mauelshagen
@ 2018-02-01  9:24 ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2018-02-01  9:24 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mike Snitzer, Alasdair Kergon, dm-devel, Shaohua Li,
	Heinz Mauelshagen, linux-raid, Linux Kernel Mailing List

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

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

* Re: [PATCH] dm raid: don't use 'const' in function return
  2016-06-16  9:03 Arnd Bergmann
@ 2016-06-16 16:21 ` Heinz Mauelshagen
  2018-02-01  9:24 ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Heinz Mauelshagen @ 2016-06-16 16:21 UTC (permalink / raw)
  To: Arnd Bergmann, Mike Snitzer
  Cc: Alasdair Kergon, dm-devel, Shaohua Li, linux-raid, linux-kernel


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;

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

* [PATCH] dm raid: don't use 'const' in function return
@ 2016-06-16  9:03 Arnd Bergmann
  2016-06-16 16:21 ` Heinz Mauelshagen
  2018-02-01  9:24 ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-06-16  9:03 UTC (permalink / raw)
  To: Mike Snitzer
  Cc: Arnd Bergmann, Alasdair Kergon, dm-devel, Shaohua Li,
	Heinz Mauelshagen, linux-raid, linux-kernel

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;
-- 
2.9.0

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

end of thread, other threads:[~2018-06-22  8:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-22  8:01 [PATCH] dm raid: don't use 'const' in function return Geert Uytterhoeven
  -- strict thread matches above, loose matches on Subject: below --
2016-06-16  9:03 Arnd Bergmann
2016-06-16 16:21 ` Heinz Mauelshagen
2018-02-01  9:24 ` Geert Uytterhoeven

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).