* linux-next: build warning after merge of the net-next tree
@ 2019-11-11 1:39 Stephen Rothwell
2019-11-11 1:45 ` Eric Dumazet
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2019-11-11 1:39 UTC (permalink / raw)
To: David Miller, Networking
Cc: Eric Dumazet, Linux Next Mailing List, PowerPC,
Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 2843 bytes --]
Hi all,
After merging the net-next tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:
In file included from ./arch/powerpc/include/generated/asm/local64.h:1,
from include/linux/u64_stats_sync.h:72,
from include/linux/cgroup-defs.h:20,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/powerpc/kernel/asm-offsets.c:23:
include/linux/u64_stats_sync.h: In function 'u64_stats_read':
include/asm-generic/local64.h:30:37: warning: passing argument 1 of 'local_read' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
30 | #define local64_read(l) local_read(&(l)->a)
| ^~~~~~~
include/linux/u64_stats_sync.h:80:9: note: in expansion of macro 'local64_read'
80 | return local64_read(&p->v);
| ^~~~~~~~~~~~
In file included from include/asm-generic/local64.h:22,
from ./arch/powerpc/include/generated/asm/local64.h:1,
from include/linux/u64_stats_sync.h:72,
from include/linux/cgroup-defs.h:20,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/powerpc/kernel/asm-offsets.c:23:
arch/powerpc/include/asm/local.h:20:44: note: expected 'local_t *' {aka 'struct <anonymous> *'} but argument is of type 'const local_t *' {aka 'const struct <anonymous> *'}
20 | static __inline__ long local_read(local_t *l)
| ~~~~~~~~~^
Introduced by commit
316580b69d0a ("u64_stats: provide u64_stats_t type")
Powerpc folks: is there some reason that local_read() cannot take a
const argument?
I have added this patch (which builds fine) for today:
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 11 Nov 2019 12:32:24 +1100
Subject: [PATCH] powerpc: local_read() should take a const local_t argument
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/include/asm/local.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/local.h b/arch/powerpc/include/asm/local.h
index fdd00939270b..bc4bd19b7fc2 100644
--- a/arch/powerpc/include/asm/local.h
+++ b/arch/powerpc/include/asm/local.h
@@ -17,7 +17,7 @@ typedef struct
#define LOCAL_INIT(i) { (i) }
-static __inline__ long local_read(local_t *l)
+static __inline__ long local_read(const local_t *l)
{
return READ_ONCE(l->v);
}
--
2.23.0
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: linux-next: build warning after merge of the net-next tree
2019-11-11 1:39 linux-next: build warning after merge of the net-next tree Stephen Rothwell
@ 2019-11-11 1:45 ` Eric Dumazet
0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2019-11-11 1:45 UTC (permalink / raw)
To: Stephen Rothwell, David Miller, Networking
Cc: Eric Dumazet, Linux Next Mailing List, PowerPC,
Linux Kernel Mailing List
On 11/10/19 5:39 PM, Stephen Rothwell wrote:
> Hi all,
>
> After merging the net-next tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> In file included from ./arch/powerpc/include/generated/asm/local64.h:1,
> from include/linux/u64_stats_sync.h:72,
> from include/linux/cgroup-defs.h:20,
> from include/linux/cgroup.h:28,
> from include/linux/memcontrol.h:13,
> from include/linux/swap.h:9,
> from include/linux/suspend.h:5,
> from arch/powerpc/kernel/asm-offsets.c:23:
> include/linux/u64_stats_sync.h: In function 'u64_stats_read':
> include/asm-generic/local64.h:30:37: warning: passing argument 1 of 'local_read' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> 30 | #define local64_read(l) local_read(&(l)->a)
> | ^~~~~~~
> include/linux/u64_stats_sync.h:80:9: note: in expansion of macro 'local64_read'
> 80 | return local64_read(&p->v);
> | ^~~~~~~~~~~~
> In file included from include/asm-generic/local64.h:22,
> from ./arch/powerpc/include/generated/asm/local64.h:1,
> from include/linux/u64_stats_sync.h:72,
> from include/linux/cgroup-defs.h:20,
> from include/linux/cgroup.h:28,
> from include/linux/memcontrol.h:13,
> from include/linux/swap.h:9,
> from include/linux/suspend.h:5,
> from arch/powerpc/kernel/asm-offsets.c:23:
> arch/powerpc/include/asm/local.h:20:44: note: expected 'local_t *' {aka 'struct <anonymous> *'} but argument is of type 'const local_t *' {aka 'const struct <anonymous> *'}
> 20 | static __inline__ long local_read(local_t *l)
> | ~~~~~~~~~^
>
> Introduced by commit
>
> 316580b69d0a ("u64_stats: provide u64_stats_t type")
>
> Powerpc folks: is there some reason that local_read() cannot take a
> const argument?
>
> I have added this patch (which builds fine) for today:
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 11 Nov 2019 12:32:24 +1100
> Subject: [PATCH] powerpc: local_read() should take a const local_t argument
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> arch/powerpc/include/asm/local.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/local.h b/arch/powerpc/include/asm/local.h
> index fdd00939270b..bc4bd19b7fc2 100644
> --- a/arch/powerpc/include/asm/local.h
> +++ b/arch/powerpc/include/asm/local.h
> @@ -17,7 +17,7 @@ typedef struct
>
> #define LOCAL_INIT(i) { (i) }
>
> -static __inline__ long local_read(local_t *l)
> +static __inline__ long local_read(const local_t *l)
> {
> return READ_ONCE(l->v);
> }
>
I have sent this patch two days ago, I do not believe I had any answer from ppc maintainers.
From 47c47befdcf31fb8498c9e630bb8e0dc3ef88079 Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Fri, 8 Nov 2019 06:04:35 -0800
Subject: [PATCH] powerpc: add const qual to local_read() parameter
A patch in net-next triggered a compile error on powerpc.
This seems reasonable to relax powerpc local_read() requirements.
Fixes: 316580b69d0a ("u64_stats: provide u64_stats_t type")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: kbuild test robot <lkp@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/include/asm/local.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/local.h b/arch/powerpc/include/asm/local.h
index fdd00939270bf08113b537a090d6a6e34a048361..bc4bd19b7fc235b80ec1132f44409b6fe1057975 100644
--- a/arch/powerpc/include/asm/local.h
+++ b/arch/powerpc/include/asm/local.h
@@ -17,7 +17,7 @@ typedef struct
#define LOCAL_INIT(i) { (i) }
-static __inline__ long local_read(local_t *l)
+static __inline__ long local_read(const local_t *l)
{
return READ_ONCE(l->v);
}
--
2.24.0.432.g9d3f5f5b63-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-11 1:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 1:39 linux-next: build warning after merge of the net-next tree Stephen Rothwell
2019-11-11 1:45 ` Eric Dumazet
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).