From: hujianyang <hujianyang@huawei.com>
To: <dedekind1@gmail.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH 2/2] mtd-utils: Remove duplicate macros from mkfs.ubifs/def.h
Date: Wed, 22 Oct 2014 09:50:17 +0800 [thread overview]
Message-ID: <54470D59.4070708@huawei.com> (raw)
In-Reply-To: <1413802282.7906.223.camel@sauron.fi.intel.com>
On 2014/10/20 18:51, Artem Bityutskiy wrote:
> On Thu, 2014-10-16 at 20:08 +0800, hujianyang wrote:
>> +#define PROGRAM_NAME "compr"
>
> PROGRAM_NAME is the name of the end program, and there is no 'compre' or
> 'lpt' program.
>
> Instead of this patch, I've pushed the one below, thanks!
>
>>From dd183c2c8000d42073d19fefc2740dc50bafd287 Mon Sep 17 00:00:00 2001
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> Date: Mon, 20 Oct 2014 13:47:09 +0300
> Subject: [PATCH] mkfs.ubifs: start using common code
>
> Several commonly used macros are now defined in 'common.h', let's start using
> them in mkfs.ubifs, instead of duplicating them.
>
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> ---
> mkfs.ubifs/defs.h | 15 ---------------
> mkfs.ubifs/mkfs.ubifs.c | 1 -
> mkfs.ubifs/mkfs.ubifs.h | 4 ++++
> 3 files changed, 4 insertions(+), 16 deletions(-)
>
> 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/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
> index 200c8a5..ca17e2b 100644
> --- a/mkfs.ubifs/mkfs.ubifs.c
> +++ b/mkfs.ubifs/mkfs.ubifs.c
> @@ -21,7 +21,6 @@
> */
>
> #define _XOPEN_SOURCE 500 /* For realpath() */
> -#define PROGRAM_NAME "mkfs.ubifs"
>
> #include "mkfs.ubifs.h"
> #include <crc32.h>
> diff --git a/mkfs.ubifs/mkfs.ubifs.h b/mkfs.ubifs/mkfs.ubifs.h
> index 6030c48..3edb79d 100644
> --- a/mkfs.ubifs/mkfs.ubifs.h
> +++ b/mkfs.ubifs/mkfs.ubifs.h
> @@ -46,6 +46,10 @@
> #include <uuid/uuid.h>
> #include <sys/file.h>
>
> +/* common.h requires the PROGRAM_NAME macro */
> +#define PROGRAM_NAME "mkfs.ubifs"
> +#include "common.h"
> +
> #include "libubi.h"
> #include "defs.h"
> #include "crc16.h"
>
It's good~! Thanks~!
I'd like to resend the patch set of ubidump depend on these changes.
next prev parent reply other threads:[~2014-10-22 1:51 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 ` [PATCH 2/2] mtd-utils: Remove duplicate macros from mkfs.ubifs/def.h hujianyang
2014-10-20 10:51 ` Artem Bityutskiy
2014-10-22 1:50 ` hujianyang [this message]
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=54470D59.4070708@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).