All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org, lakshmipathi.g@gmail.com
Subject: Re: [PATCH 2/4] btrfs-progs: Make btrfs-debug-tree print all readable strings for inode flags
Date: Tue, 11 Oct 2016 12:07:52 +0200	[thread overview]
Message-ID: <20161011100752.GM11398@suse.cz> (raw)
In-Reply-To: <9f4cc38e-4c95-7938-fd74-6cf39411901e@cn.fujitsu.com>

On Tue, Oct 11, 2016 at 10:18:51AM +0800, Qu Wenruo wrote:
> >> -/* Caller should ensure sizeof(*ret) >= 29 "NODATASUM|NODATACOW|READONLY" */
> >> +#define copy_one_inode_flag(flags, name, empty, dst) ({			\
> >> +	if (flags & BTRFS_INODE_##name) {				\
> >> +		if (!empty)						\
> >> +			strcat(dst, "|");				\
> >> +		strcat(dst, #name);					\
> >> +		empty = 0;						\
> >> +	}								\
> >> +})
> >
> > Can you please avoid using the macro? Or at least make it uppercase so
> > it's visible. Similar in the next patch.
> >
> >
> OK, I'll change it to upper case.

Ok.

> The only reason I'm using macro is, inline function can't do 
> stringification, or I missed something?

No, that's where macros help. My concern was about the hidden use of a
local variable, so at least an all-caps macro name would make it more
visible. As this is not going to be used elsewhere, we can live with
that.

  reply	other threads:[~2016-10-11 10:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10  3:11 [PATCH 0/4] Btrfs-convert: Add support to copy common inode flags Qu Wenruo
2016-10-10  3:11 ` [PATCH 1/4] btrfs-progs: Copy btrfs inode flags from kernel header Qu Wenruo
2016-10-10  3:11 ` [PATCH 2/4] btrfs-progs: Make btrfs-debug-tree print all readable strings for inode flags Qu Wenruo
2016-10-10 15:50   ` David Sterba
2016-10-11  2:18     ` Qu Wenruo
2016-10-11 10:07       ` David Sterba [this message]
2016-10-10  3:11 ` [PATCH 3/4] btrfs-progs: convert: Convert ext inode flags to btrfs " Qu Wenruo
2016-10-10  3:11 ` [PATCH 4/4] btrfs-progs: convert-test: Add test case for common " Qu Wenruo

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=20161011100752.GM11398@suse.cz \
    --to=dsterba@suse.cz \
    --cc=lakshmipathi.g@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.com \
    /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.