[PATCH 1/8] Add min/max macro

Yinghai Lu yinghai at kernel.org
Fri Nov 16 18:04:20 EST 2012


Signed-off-by: Yinghai Lu <yinghai at kernel.org>
---
 kexec/arch/ppc/include/types.h |   12 ------------
 kexec/kexec.h                  |   12 ++++++++++++
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/kexec/arch/ppc/include/types.h b/kexec/arch/ppc/include/types.h
index 31393d1..3773cda 100644
--- a/kexec/arch/ppc/include/types.h
+++ b/kexec/arch/ppc/include/types.h
@@ -12,16 +12,4 @@ typedef short			s16;
 typedef int			s32;
 typedef long long		s64;
 
-#define min(x,y) ({ \
-	typeof(x) _x = (x);	\
-	typeof(y) _y = (y);	\
-	(void) (&_x == &_y);	\
-	_x < _y ? _x : _y; })
-
-#define max(x,y) ({ \
-	typeof(x) _x = (x);	\
-	typeof(y) _y = (y);	\
-	(void) (&_x == &_y);	\
-	_x > _y ? _x : _y; })
-
 #endif /* _TYPES_H_ */
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 1f46bcb..35b0b10 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -100,6 +100,18 @@ do { \
 	} \
 } while(0)
 
+#define min(x,y) ({ \
+        typeof(x) _x = (x);     \
+        typeof(y) _y = (y);     \
+        (void) (&_x == &_y);    \
+        _x < _y ? _x : _y; })
+
+#define max(x,y) ({ \
+        typeof(x) _x = (x);     \
+        typeof(y) _y = (y);     \
+        (void) (&_x == &_y);    \
+        _x > _y ? _x : _y; })
+
 extern unsigned long long mem_min, mem_max;
 extern int kexec_debug;
 
-- 
1.7.7




More information about the kexec mailing list