* [PATCH 2/3] s390: avoid usage of 'new' in header files.
@ 2006-02-01 11:58 Heiko Carstens
2006-02-01 18:12 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Heiko Carstens @ 2006-02-01 11:58 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
From: Heiko Carstens <heiko.carstens@de.ibm.com>
Don't use 'new' as name for variables, since some C++ sources may include
these header files.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
include/asm-s390/bitops.h | 26 +++++++++++++-------------
include/asm-s390/spinlock.h | 4 ++--
2 files changed, 15 insertions(+), 15 deletions(-)
diff -urpN linux-2.6/include/asm-s390/bitops.h linux-2.6-patched/include/asm-s390/bitops.h
--- linux-2.6/include/asm-s390/bitops.h 2006-02-01 11:03:08.000000000 +0100
+++ linux-2.6-patched/include/asm-s390/bitops.h 2006-02-01 11:04:07.000000000 +0100
@@ -119,7 +119,7 @@ extern const char _sb_findmap[];
*/
static inline void set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
- unsigned long addr, old, new, mask;
+ unsigned long addr, old, tmp, mask;
addr = (unsigned long) ptr;
#if ALIGN_CS == 1
@@ -131,7 +131,7 @@ static inline void set_bit_cs(unsigned l
/* make OR mask */
mask = 1UL << (nr & (__BITOPS_WORDSIZE - 1));
/* Do the atomic update. */
- __BITOPS_LOOP(old, new, addr, mask, __BITOPS_OR);
+ __BITOPS_LOOP(old, tmp, addr, mask, __BITOPS_OR);
}
/*
@@ -139,7 +139,7 @@ static inline void set_bit_cs(unsigned l
*/
static inline void clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
- unsigned long addr, old, new, mask;
+ unsigned long addr, old, tmp, mask;
addr = (unsigned long) ptr;
#if ALIGN_CS == 1
@@ -151,7 +151,7 @@ static inline void clear_bit_cs(unsigned
/* make AND mask */
mask = ~(1UL << (nr & (__BITOPS_WORDSIZE - 1)));
/* Do the atomic update. */
- __BITOPS_LOOP(old, new, addr, mask, __BITOPS_AND);
+ __BITOPS_LOOP(old, tmp, addr, mask, __BITOPS_AND);
}
/*
@@ -159,7 +159,7 @@ static inline void clear_bit_cs(unsigned
*/
static inline void change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
- unsigned long addr, old, new, mask;
+ unsigned long addr, old, tmp, mask;
addr = (unsigned long) ptr;
#if ALIGN_CS == 1
@@ -171,7 +171,7 @@ static inline void change_bit_cs(unsigne
/* make XOR mask */
mask = 1UL << (nr & (__BITOPS_WORDSIZE - 1));
/* Do the atomic update. */
- __BITOPS_LOOP(old, new, addr, mask, __BITOPS_XOR);
+ __BITOPS_LOOP(old, tmp, addr, mask, __BITOPS_XOR);
}
/*
@@ -180,7 +180,7 @@ static inline void change_bit_cs(unsigne
static inline int
test_and_set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
- unsigned long addr, old, new, mask;
+ unsigned long addr, old, tmp, mask;
addr = (unsigned long) ptr;
#if ALIGN_CS == 1
@@ -192,7 +192,7 @@ test_and_set_bit_cs(unsigned long nr, vo
/* make OR/test mask */
mask = 1UL << (nr & (__BITOPS_WORDSIZE - 1));
/* Do the atomic update. */
- __BITOPS_LOOP(old, new, addr, mask, __BITOPS_OR);
+ __BITOPS_LOOP(old, tmp, addr, mask, __BITOPS_OR);
__BITOPS_BARRIER();
return (old & mask) != 0;
}
@@ -203,7 +203,7 @@ test_and_set_bit_cs(unsigned long nr, vo
static inline int
test_and_clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
- unsigned long addr, old, new, mask;
+ unsigned long addr, old, new_val, mask;
addr = (unsigned long) ptr;
#if ALIGN_CS == 1
@@ -215,9 +215,9 @@ test_and_clear_bit_cs(unsigned long nr,
/* make AND/test mask */
mask = ~(1UL << (nr & (__BITOPS_WORDSIZE - 1)));
/* Do the atomic update. */
- __BITOPS_LOOP(old, new, addr, mask, __BITOPS_AND);
+ __BITOPS_LOOP(old, new_val, addr, mask, __BITOPS_AND);
__BITOPS_BARRIER();
- return (old ^ new) != 0;
+ return (old ^ new_val) != 0;
}
/*
@@ -226,7 +226,7 @@ test_and_clear_bit_cs(unsigned long nr,
static inline int
test_and_change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
- unsigned long addr, old, new, mask;
+ unsigned long addr, old, tmp, mask;
addr = (unsigned long) ptr;
#if ALIGN_CS == 1
@@ -238,7 +238,7 @@ test_and_change_bit_cs(unsigned long nr,
/* make XOR/test mask */
mask = 1UL << (nr & (__BITOPS_WORDSIZE - 1));
/* Do the atomic update. */
- __BITOPS_LOOP(old, new, addr, mask, __BITOPS_XOR);
+ __BITOPS_LOOP(old, tmp, addr, mask, __BITOPS_XOR);
__BITOPS_BARRIER();
return (old & mask) != 0;
}
diff -urpN linux-2.6/include/asm-s390/spinlock.h linux-2.6-patched/include/asm-s390/spinlock.h
--- linux-2.6/include/asm-s390/spinlock.h 2006-01-03 04:21:10.000000000 +0100
+++ linux-2.6-patched/include/asm-s390/spinlock.h 2006-02-01 11:04:07.000000000 +0100
@@ -13,11 +13,11 @@
static inline int
_raw_compare_and_swap(volatile unsigned int *lock,
- unsigned int old, unsigned int new)
+ unsigned int old, unsigned int new_val)
{
asm volatile ("cs %0,%3,0(%4)"
: "=d" (old), "=m" (*lock)
- : "0" (old), "d" (new), "a" (lock), "m" (*lock)
+ : "0" (old), "d" (new_val), "a" (lock), "m" (*lock)
: "cc", "memory" );
return old;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] s390: avoid usage of 'new' in header files.
2006-02-01 11:58 [PATCH 2/3] s390: avoid usage of 'new' in header files Heiko Carstens
@ 2006-02-01 18:12 ` Christoph Hellwig
2006-02-02 6:04 ` Heiko Carstens
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2006-02-01 18:12 UTC (permalink / raw)
To: Heiko Carstens; +Cc: Andrew Morton, linux-kernel
On Wed, Feb 01, 2006 at 12:58:32PM +0100, Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
>
> Don't use 'new' as name for variables, since some C++ sources may include
> these header files.
NACK. Userspace must not include these headers ever, and C++ in the kernel is not
supported.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] s390: avoid usage of 'new' in header files.
2006-02-01 18:12 ` Christoph Hellwig
@ 2006-02-02 6:04 ` Heiko Carstens
0 siblings, 0 replies; 3+ messages in thread
From: Heiko Carstens @ 2006-02-02 6:04 UTC (permalink / raw)
To: Christoph Hellwig, Andrew Morton, linux-kernel
On Wed, Feb 01, 2006 at 06:12:38PM +0000, Christoph Hellwig wrote:
> On Wed, Feb 01, 2006 at 12:58:32PM +0100, Heiko Carstens wrote:
> > From: Heiko Carstens <heiko.carstens@de.ibm.com>
> >
> > Don't use 'new' as name for variables, since some C++ sources may include
> > these header files.
>
> NACK. Userspace must not include these headers ever, and C++ in the kernel is not
> supported.
Agreed.
Thanks,
Heiko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-02-02 6:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-01 11:58 [PATCH 2/3] s390: avoid usage of 'new' in header files Heiko Carstens
2006-02-01 18:12 ` Christoph Hellwig
2006-02-02 6:04 ` Heiko Carstens
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).