Skip to contentSkip to conversation

cleanup include/asm-generic/atomic.h

PATCH In review Madhavan Srinivasan 2 participants 4 messages Jul 21, 2014 – Jul 22, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cleanup include/asm-generic/atomic.h

Commit 4b358e2206 "cleanup include/asm-generic/atomic.h" added comments for #else/#endif, but ended up adding same comment "BITS_PER_LONG == 64" on both sides. This patch fixes it.

---
 include/asm-generic/atomic-long.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/atomic-long.h +1 -1
index b7babf0..a8434c6 100644
@@ -253,6 +253,6 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
 #define atomic_long_xchg(v, new) \
 	(atomic_xchg((atomic_t *)(v), (new)))
 
-#endif  /*  BITS_PER_LONG == 64  */
+#endif  /*  BITS_PER_LONG != 64  */
 
 #endif  /*  _ASM_GENERIC_ATOMIC_LONG_H  */
Signature · 1 line
1.7.11.4
#1 lore raw
Quoted 4 lines · Madhavan Srinivasan

Commit 4b358e2206 "cleanup include/asm-generic/atomic.h" added comments for #else/#endif, but ended up adding same comment "BITS_PER_LONG == 64" on both sides. This patch fixes it.

It's intentionally like that, it comments the condition for which the #endif is matched.

Quoted 17 lines
---
 include/asm-generic/atomic-long.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/atomic-long.h +1 -1
index b7babf0..a8434c6 100644
@@ -253,6 +253,6 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
 #define atomic_long_xchg(v, new) \
 	(atomic_xchg((atomic_t *)(v), (new)))
 
-#endif  /*  BITS_PER_LONG == 64  */
+#endif  /*  BITS_PER_LONG != 64  */
 
 #endif  /*  _ASM_GENERIC_ATOMIC_LONG_H  */
#2 lore raw
Quoted 9 lines · David Rientjes
Quoted 4 lines · Madhavan Srinivasan

Commit 4b358e2206 "cleanup include/asm-generic/atomic.h" added comments for #else/#endif, but ended up adding same comment "BITS_PER_LONG == 64" on both sides. This patch fixes it.

It's intentionally like that, it comments the condition for which the #endif is matched.

Ok, will change the else comment. And include/asm-generic/local64.h also needs a change in comment.

Regards
Maddy

Quoted 19 lines
Quoted 18 lines
---
 include/asm-generic/atomic-long.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/atomic-long.h +1 -1
index b7babf0..a8434c6 100644
@@ -253,6 +253,6 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
 #define atomic_long_xchg(v, new) \
 	(atomic_xchg((atomic_t *)(v), (new)))
 
-#endif  /*  BITS_PER_LONG == 64  */
+#endif  /*  BITS_PER_LONG != 64  */
 
 #endif  /*  _ASM_GENERIC_ATOMIC_LONG_H  */
#3 lore raw
Quoted 8 lines · Madhavan Srinivasan
Quoted 7 lines · David Rientjes
Quoted 4 lines · Madhavan Srinivasan

Commit 4b358e2206 "cleanup include/asm-generic/atomic.h" added comments for #else/#endif, but ended up adding same comment "BITS_PER_LONG == 64" on both sides. This patch fixes it.

Quoted 6 lines
Quoted 2 lines

It's intentionally like that, it comments the condition for which the #endif is matched.

Ok, will change the else comment. And include/asm-generic/local64.h also needs a change in comment.

The #else comment is fine, it's correct as written. The only use of these comments is to identify for the reader the #ifdef for which it is matched when there at least one nested #ifdef.