浏览代码

[PATCH] cpuset cleanup not not operators

Since the test_bit() bit operator is boolean (return 0 or 1), the double not
"!!" operations needed to convert a scalar (zero or not zero) to a boolean are
not needed.

Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Jackson 19 年之前
父节点
当前提交
7b5b9ef0e1
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      kernel/cpuset.c

+ 5 - 5
kernel/cpuset.c

@@ -114,27 +114,27 @@ typedef enum {
 /* convenient tests for these bits */
 /* convenient tests for these bits */
 static inline int is_cpu_exclusive(const struct cpuset *cs)
 static inline int is_cpu_exclusive(const struct cpuset *cs)
 {
 {
-	return !!test_bit(CS_CPU_EXCLUSIVE, &cs->flags);
+	return test_bit(CS_CPU_EXCLUSIVE, &cs->flags);
 }
 }
 
 
 static inline int is_mem_exclusive(const struct cpuset *cs)
 static inline int is_mem_exclusive(const struct cpuset *cs)
 {
 {
-	return !!test_bit(CS_MEM_EXCLUSIVE, &cs->flags);
+	return test_bit(CS_MEM_EXCLUSIVE, &cs->flags);
 }
 }
 
 
 static inline int is_removed(const struct cpuset *cs)
 static inline int is_removed(const struct cpuset *cs)
 {
 {
-	return !!test_bit(CS_REMOVED, &cs->flags);
+	return test_bit(CS_REMOVED, &cs->flags);
 }
 }
 
 
 static inline int notify_on_release(const struct cpuset *cs)
 static inline int notify_on_release(const struct cpuset *cs)
 {
 {
-	return !!test_bit(CS_NOTIFY_ON_RELEASE, &cs->flags);
+	return test_bit(CS_NOTIFY_ON_RELEASE, &cs->flags);
 }
 }
 
 
 static inline int is_memory_migrate(const struct cpuset *cs)
 static inline int is_memory_migrate(const struct cpuset *cs)
 {
 {
-	return !!test_bit(CS_MEMORY_MIGRATE, &cs->flags);
+	return test_bit(CS_MEMORY_MIGRATE, &cs->flags);
 }
 }
 
 
 /*
 /*