Hi, Chris,
From: Hirokazu Takata <[email protected]>
Date: Wed, 22 Aug 2007 10:56:54 +0900
> From: Chris Snook <[email protected]>
> Date: Mon, 13 Aug 2007 07:24:52 -0400
> > From: Chris Snook <[email protected]>
> >
> > Use volatile consistently in atomic.h on m32r.
> >
> > Signed-off-by: Chris Snook <[email protected]>
>
> Thanks,
>
> Acked-by: Hirokazu Takata <[email protected]>
Hmmm.. It seems my reply was overhasty.
Applying the above patch, I have many warning messages like this:
<-- snip -->
...
CC kernel/sched.o
In file included from /project/m32r-linux/kernel/work/linux-2.6_dev.git/include/linux/netlink.h:139,
from /project/m32r-linux/kernel/work/linux-2.6_dev.git/include/linux/genetlink.h:4,
from /project/m32r-linux/kernel/work/linux-2.6_dev.git/include/net/genetlink.h:4,
from /project/m32r-linux/kernel/work/linux-2.6_dev.git/include/linux/taskstats_kern.h:12,
from /project/m32r-linux/kernel/work/linux-2.6_dev.git/include/linux/delayacct.h:21,
from /project/m32r-linux/kernel/work/linux-2.6_dev.git/kernel/sched.c:61:
/project/m32r-linux/kernel/work/linux-2.6_dev.git/include/linux/skbuff.h: In function 'skb_shared':
/project/m32r-linux/kernel/work/linux-2.6_dev.git/include/linux/skbuff.h:521: warning: passing argument 1 of 'atomic_read' discards qualifiers from pointer target type
...
<-- snip -->
In this case, it is because stb_shared() is defined with a parameter with
"const" qualifier, in include/linux/skbuff.h.
static inline int skb_shared(const struct sk_buff *skb)
{
return atomic_read(&skb->users) != 1;
}
I think the parameter of atomic_read() should have "const"
qualifier to avoid these warnings, and IMHO this modification might be
worth applying on other archs.
Here is an additional patch to revise the previous one for m32r.
I also tried to rewrite it with inline asm code, but the kernel text size
bacame roughly 2kB larger. So, I prefer C version.
Thanks,
-- Takata
[PATCH] m32r: Add "const" qualifier to the parameter of atomic_read()
Update atomic_read() to avoid the following warning of gcc-4.1.x:
warning: passing argument 1 of 'atomic_read' discards qualifiers
from pointer target type
Signed-off-by: Hirokazu Takata <[email protected]>
Cc: Chris Snook <[email protected]>
---
include/asm-m32r/atomic.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/asm-m32r/atomic.h b/include/asm-m32r/atomic.h
index ba19689..9d46f86 100644
--- a/include/asm-m32r/atomic.h
+++ b/include/asm-m32r/atomic.h
@@ -32,7 +32,7 @@ typedef struct { int counter; } atomic_t;
*
* Atomically reads the value of @v.
*/
-static __inline__ int atomic_read(atomic_t *v)
+static __inline__ int atomic_read(const atomic_t *v)
{
return *(volatile int *)&v->counter;
}
--
1.5.2.4
--
Hirokazu Takata <[email protected]>
Linux/M32R Project: http://www.linux-m32r.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]