]> www.infradead.org Git - mtd-utils.git/commitdiff
mtd-utils: convert to common.h/min
authorMike Frysinger <vapier@gentoo.org>
Fri, 24 Sep 2010 01:52:17 +0000 (21:52 -0400)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 24 Sep 2010 12:25:03 +0000 (15:25 +0300)
Kill off duplicated min() defines and convert to the common.h one.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
compr_zlib.c
include/common.h
jffs-dump.c
mkfs.jffs2.c
recv_image.c

index dda3e4052f720b791a147d0e756f07b869de336b..0564f161510e2cb6541c1677ffd95f73de099d8d 100644 (file)
 #include <stdio.h>
 #include <asm/types.h>
 #include <linux/jffs2.h>
+#include "common.h"
 #include "compr.h"
 
-#define min(x,y) ((x)<(y)?(x):(y))
-
 /* Plan: call deflate() with avail_in == *sourcelen,
    avail_out = *dstlen - 12 and flush == Z_FINISH.
    If it doesn't manage to finish,     call it again with
index 03e6f7c5a65a9757aa0f3fb849d83209bd62526a..f2b7b6b106dc2218883ae7f1d5af7ba752fcb354 100644 (file)
@@ -34,6 +34,7 @@ extern "C" {
 #endif
 
 #define MIN(a ,b) ((a) < (b) ? (a) : (b))
+#define min(a, b) MIN(a, b) /* glue for linux kernel source */
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
 
 /* Verbose messages */
index 31cdad21f915e3edd02bbac8380be49b3ab0f299..3176469bbdca4b23160f730e532ae9d65395bc8b 100644 (file)
@@ -14,6 +14,8 @@
 #include <linux/types.h>
 #include <asm/byteorder.h>
 
+#include "common.h"
+
 #define BLOCK_SIZE 1024
 #define JFFS_MAGIC 0x34383931 /* "1984" */
 #define JFFS_MAX_NAME_LEN 256
@@ -32,8 +34,6 @@
 #define JFFS_MAGIC_BITMASK 0x34383931
 #define JFFS_DIRTY_BITMASK 0x00000000
 
-#define min(x,y) (x) > (y) ? (y) : (x)
-
 struct jffs_raw_inode
 {
        uint32_t magic;    /* A constant magic number.  */
index 5c18eb19168f8b88bb920fffb22e44ae7834afa2..c83b725f1b1aa133d1e53d206f2f4298559cc16f 100644 (file)
 #include <crc32.h>
 #include "rbtree.h"
 
+#include "common.h"
+
 /* Do not use the weird XPG version of basename */
 #undef basename
 
 //#define DMALLOC
 //#define mkfs_debug_msg    error_msg
 #define mkfs_debug_msg(a...)   { }
-#define min(x,y) ({ typeof((x)) _x = (x); typeof((y)) _y = (y); (_x>_y)?_y:_x; })
 
 #define PAD(x) (((x)+3)&~3)
 
index 617711c3c0fd5180b47d5f0905e6656d6e0ed213..6d27f3bdfccc93eaae6dbf85ac92f301913211c7 100644 (file)
@@ -20,7 +20,7 @@
 #include "mtd/mtd-user.h"
 #include "mcast_image.h"
 
-#define min(x,y) (  (x)>(y)?(y):(x) )
+#include "common.h"
 
 #define WBUF_SIZE 4096
 struct eraseblock {