]> www.infradead.org Git - mtd-utils.git/commitdiff
common.h: Add MAX() macro, fix MIN()
authorBrian Norris <computersforpeace@gmail.com>
Mon, 29 Nov 2010 08:01:56 +0000 (00:01 -0800)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 2 Dec 2010 03:25:23 +0000 (05:25 +0200)
Add MAX() macro to common.h, to be used in future patches.

Also a style change in comma location on MIN().

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
include/common.h

index 25abc0cabe58ba521d7b301decdcaadad9ca467c..eb8d5fc8279e650537d393a027eb091132832e47 100644 (file)
@@ -34,7 +34,10 @@ extern "C" {
 #endif
 
 #ifndef MIN    /* some C lib headers define this for us */
-#define MIN(a ,b) ((a) < (b) ? (a) : (b))
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
 #endif
 #define min(a, b) MIN(a, b) /* glue for linux kernel source */
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))