All of lore.kernel.org
 help / color / mirror / Atom feed
From: hujianyang <hujianyang@huawei.com>
To: Artem Bityutskiy <dedekind1@gmail.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>
Subject: [PATCH 2/2] mtd-utils: Remove duplicate macros from mkfs.ubifs/def.h
Date: Thu, 16 Oct 2014 20:08:21 +0800	[thread overview]
Message-ID: <543FB535.10105@huawei.com> (raw)
In-Reply-To: <543FB3C1.9050800@huawei.com>

These macros have been moved to include/common.h. This patch removes
duplicate macros from mkfs.ubifs/def.h and include these macros from
common.h

As each file which include common.h must define a PROGRAM_NAME, this
patch also adds PROGRAM_NAME for every c file in mkfs.ubifs/


Signed-off-by: hujianyang <hujianyang@huawei.com>
---
 mkfs.ubifs/compr.c      |    2 ++
 mkfs.ubifs/defs.h       |   15 ---------------
 mkfs.ubifs/devtable.c   |    2 ++
 mkfs.ubifs/lpt.c        |    2 ++
 mkfs.ubifs/mkfs.ubifs.h |    1 +
 5 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/mkfs.ubifs/compr.c b/mkfs.ubifs/compr.c
index 4152b6a..6d62033 100644
--- a/mkfs.ubifs/compr.c
+++ b/mkfs.ubifs/compr.c
@@ -20,6 +20,8 @@
  *          Zoltan Sogor
  */

+#define PROGRAM_NAME "compr"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
diff --git a/mkfs.ubifs/defs.h b/mkfs.ubifs/defs.h
index 06cf9e5..1fa3316 100644
--- a/mkfs.ubifs/defs.h
+++ b/mkfs.ubifs/defs.h
@@ -29,21 +29,6 @@
 #define le32_to_cpu(x) (t32((x)))
 #define le64_to_cpu(x) (t64((x)))

-#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
-#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
-
-#define min_t(t,x,y) ({ \
-	typeof((x)) _x = (x); \
-	typeof((y)) _y = (y); \
-	(_x < _y) ? _x : _y; \
-})
-
-#define max_t(t,x,y) ({ \
-	typeof((x)) _x = (x); \
-	typeof((y)) _y = (y); \
-	(_x > _y) ? _x : _y; \
-})
-
 #define unlikely(x) (x)

 #define ubifs_assert(x) ({})
diff --git a/mkfs.ubifs/devtable.c b/mkfs.ubifs/devtable.c
index dee035d..2358197 100644
--- a/mkfs.ubifs/devtable.c
+++ b/mkfs.ubifs/devtable.c
@@ -44,6 +44,8 @@
  * for more information about what the device table is.
  */

+#define PROGRAM_NAME "devtable"
+
 #include "mkfs.ubifs.h"
 #include "hashtable/hashtable.h"
 #include "hashtable/hashtable_itr.h"
diff --git a/mkfs.ubifs/lpt.c b/mkfs.ubifs/lpt.c
index f6d4352..94e8f9d 100644
--- a/mkfs.ubifs/lpt.c
+++ b/mkfs.ubifs/lpt.c
@@ -20,6 +20,8 @@
  *          Artem Bityutskiy
  */

+#define PROGRAM_NAME "lpt"
+
 #include "mkfs.ubifs.h"

 /**
diff --git a/mkfs.ubifs/mkfs.ubifs.h b/mkfs.ubifs/mkfs.ubifs.h
index 6030c48..6f6feb8 100644
--- a/mkfs.ubifs/mkfs.ubifs.h
+++ b/mkfs.ubifs/mkfs.ubifs.h
@@ -51,6 +51,7 @@
 #include "crc16.h"
 #include "ubifs-media.h"
 #include "ubifs.h"
+#include "common.h"
 #include "key.h"
 #include "lpt.h"
 #include "compr.h"
-- 
1.6.0.2

  reply	other threads:[~2014-10-16 12:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16 12:02 [PATCH 1/2] mtd-utils: Add macros to include/common.h hujianyang
2014-10-16 12:08 ` hujianyang [this message]
2014-10-20 10:51   ` [PATCH 2/2] mtd-utils: Remove duplicate macros from mkfs.ubifs/def.h Artem Bityutskiy
2014-10-22  1:50     ` hujianyang
2014-10-20 10:49 ` [PATCH 1/2] mtd-utils: Add macros to include/common.h Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=543FB535.10105@huawei.com \
    --to=hujianyang@huawei.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.