Skip to contentSkip to conversation

s390: avoid usage of 'new' in header files.

PATCH In review Heiko Carstens 2 participants 3 messages Feb 1, 2006 – Feb 2, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 s390: avoid usage of 'new' in header files.

From: Heiko Carstens <[email protected]>

Don't use 'new' as name for variables, since some C++ sources may include these header files.

---

 include/asm-s390/bitops.h   |   26 +++++++++++++-------------
 include/asm-s390/spinlock.h |    4 ++--
 2 files changed, 15 insertions(+), 15 deletions(-)
include/asm-s390/bitops.h +13 -13
diff -urpN linux-2.6/include/asm-s390/bitops.h linux-2.6-patched/include/asm-s390/bitops.h
@@ -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;
 }
include/asm-s390/spinlock.h +2 -2
diff -urpN linux-2.6/include/asm-s390/spinlock.h linux-2.6-patched/include/asm-s390/spinlock.h
@@ -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;
 }
#1 lore raw
Quoted 4 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

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.

#2 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

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