linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: percpu tree build warning
@ 2009-11-12  6:45 Stephen Rothwell
  2009-11-12 15:16 ` Christoph Lameter
  2009-11-18  9:05 ` [PATCH percpu#for-next] percpu: remove compile warnings caused by __verify_pcpu_ptr() Tejun Heo
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Rothwell @ 2009-11-12  6:45 UTC (permalink / raw)
  To: Tejun Heo, Rusty Russell, Christoph Lameter, Ingo Molnar
  Cc: linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

Hi all,

Today's linux-next build (powerpc ppc64_defconfig) produced this warning:

drivers/net/loopback.c: In function 'loopback_get_stats':
drivers/net/loopback.c:109: warning: initialization discards qualifiers from pointer target type

The line in question is:

	lb_stats = per_cpu_ptr(pcpu_lstats, i);

Where "lb_stats" and "pcpu_lstats" are both "const struct pcpu_lstats
*".  I guess this is because of __verify_pcpu_ptr().

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: linux-next: percpu tree build warning
  2009-11-12  6:45 linux-next: percpu tree build warning Stephen Rothwell
@ 2009-11-12 15:16 ` Christoph Lameter
  2009-11-18  9:05 ` [PATCH percpu#for-next] percpu: remove compile warnings caused by __verify_pcpu_ptr() Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Lameter @ 2009-11-12 15:16 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Tejun Heo, Rusty Russell, Ingo Molnar, linux-next, linux-kernel

On Thu, 12 Nov 2009, Stephen Rothwell wrote:

> Hi all,
>
> Today's linux-next build (powerpc ppc64_defconfig) produced this warning:
>
> drivers/net/loopback.c: In function 'loopback_get_stats':
> drivers/net/loopback.c:109: warning: initialization discards qualifiers from pointer target type
>
> The line in question is:
>
> 	lb_stats = per_cpu_ptr(pcpu_lstats, i);
>
> Where "lb_stats" and "pcpu_lstats" are both "const struct pcpu_lstats
> *".  I guess this is because of __verify_pcpu_ptr().

hmm... pcpu_lstats needs to be correctly qualified I guess.

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

* [PATCH percpu#for-next] percpu: remove compile warnings caused by __verify_pcpu_ptr()
  2009-11-12  6:45 linux-next: percpu tree build warning Stephen Rothwell
  2009-11-12 15:16 ` Christoph Lameter
@ 2009-11-18  9:05 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2009-11-18  9:05 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Rusty Russell, Christoph Lameter, Ingo Molnar, linux-next,
	linux-kernel

If percpu pointer is const, __verify_pcpu_ptr() triggers warnings like
the following.

 drivers/net/loopback.c: In function 'loopback_get_stats':
 drivers/net/loopback.c:109: warning: initialization discards qualifiers from pointer target type

Fix it by adding const to the verification target pointer used in
__verify_pcpu_ptr().

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
Sorry about the delay.  Patch committed to percpu#for-next.

Thanks.

 include/linux/percpu-defs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 1fa36eb..68567c0 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -24,7 +24,7 @@
  * input parameter is a percpu pointer.
  */
 #define __verify_pcpu_ptr(ptr)	do {					\
-	void __percpu *__vpp_verify = (typeof(ptr))NULL;		\
+	const void __percpu *__vpp_verify = (typeof(ptr))NULL;		\
 	(void)__vpp_verify;						\
 } while (0)

-- 
1.6.4.2

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

end of thread, other threads:[~2009-11-18  9:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-12  6:45 linux-next: percpu tree build warning Stephen Rothwell
2009-11-12 15:16 ` Christoph Lameter
2009-11-18  9:05 ` [PATCH percpu#for-next] percpu: remove compile warnings caused by __verify_pcpu_ptr() Tejun Heo

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