public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH 1/3] mtd-utils: new memory wrappers
Date: Thu, 30 Sep 2010 07:59:45 +0300	[thread overview]
Message-ID: <1285822785.11684.11.camel@localhost> (raw)
In-Reply-To: <1285803024-13572-1-git-send-email-vapier@gentoo.org>

On Wed, 2010-09-29 at 19:30 -0400, Mike Frysinger wrote:
> The mkfs.jffs2 program has local wrappers for memory related functions
> that are useful beyond mkfs.jffs2, so break them out into a common header.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  include/common.h |    8 +++++
>  include/xalloc.h |   80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  mkfs.jffs2.c     |   41 ---------------------------
>  3 files changed, 88 insertions(+), 41 deletions(-)
>  create mode 100644 include/xalloc.h
> 
> diff --git a/include/common.h b/include/common.h
> index 472315e..6e27d62 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -58,6 +58,9 @@ extern "C" {
>  	fprintf(stderr, "%s: error!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \
>  	-1;                                                                 \
>  })
> +#define errmsg_and_die(fmt, ...) do {                                       \
> +	exit(errmsg(fmt, ##__VA_ARGS__));                                   \
> +} while(0)
>  
>  /* System error messages */
>  #define sys_errmsg(fmt, ...)  ({                                            \
> @@ -69,6 +72,9 @@ extern "C" {
>  	fprintf(stderr, "error %d (%s)\n", _err, strerror(_err));           \
>  	-1;                                                                 \
>  })
> +#define sys_errmsg_and_die(fmt, ...) do {                                   \
> +	exit(sys_errmsg(fmt, ##__VA_ARGS__));                               \
> +} while(0)

Often these funcs are used with longish strings, so it is better to try
keeping the function names short. Thus, I suggest you to use
'err_msg_die()' etc. IOW, without the '_and' part.

If you are OK with this, I can just tweak your patch. But you can also
re-send it - whatever you prefer.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  parent reply	other threads:[~2010-09-30  5:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29 23:30 [PATCH 1/3] mtd-utils: new memory wrappers Mike Frysinger
2010-09-29 23:30 ` [PATCH 2/3] mtd-utils: add xasprintf() helper Mike Frysinger
2010-09-30  5:28   ` Mike Frysinger
2010-09-29 23:30 ` [PATCH 3/3] mkfs.jffs2: use new " Mike Frysinger
2010-09-30  4:59 ` Artem Bityutskiy [this message]
2010-09-30  5:15   ` [PATCH 1/3] mtd-utils: new memory wrappers Mike Frysinger
2010-09-30  5:48     ` Artem Bityutskiy
2010-09-30  5:59       ` Mike Frysinger
2010-09-30  6:01         ` Artem Bityutskiy
2010-09-30  6:18           ` Mike Frysinger
2010-09-30  6:56             ` Artem Bityutskiy
2010-10-01  0:47               ` Mike Frysinger
2010-10-01  1:43           ` Mike Frysinger
2010-09-30  5:27 ` [PATCH 1/3 v2] " Mike Frysinger
2010-09-30  5:54   ` 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=1285822785.11684.11.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vapier@gentoo.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