From: Robin Murphy <robin.murphy@arm.com>
To: Qian Cai <cai@lca.pw>, jroedel@suse.de
Cc: akpm@linux-foundation.org, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu: replace single-char identifiers in macros
Date: Mon, 3 Jun 2019 14:07:38 +0100 [thread overview]
Message-ID: <fe5e8da4-38d2-c663-c2e2-70e6d4f7640f@arm.com> (raw)
In-Reply-To: <1559566783-13627-1-git-send-email-cai@lca.pw>
On 03/06/2019 13:59, Qian Cai wrote:
> There are a few macros in IOMMU have single-char identifiers make the
> code hard to read and debug. Replace them with meaningful names.
>
> Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
> include/linux/dmar.h | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/dmar.h b/include/linux/dmar.h
> index f8af1d770520..eb634912f475 100644
> --- a/include/linux/dmar.h
> +++ b/include/linux/dmar.h
> @@ -104,12 +104,14 @@ static inline bool dmar_rcu_check(void)
>
> #define dmar_rcu_dereference(p) rcu_dereference_check((p), dmar_rcu_check())
>
> -#define for_each_dev_scope(a, c, p, d) \
> - for ((p) = 0; ((d) = (p) < (c) ? dmar_rcu_dereference((a)[(p)].dev) : \
> - NULL, (p) < (c)); (p)++)
> -
> -#define for_each_active_dev_scope(a, c, p, d) \
> - for_each_dev_scope((a), (c), (p), (d)) if (!(d)) { continue; } else
> +#define for_each_dev_scope(devs, cnt, i, tmp) \
> + for ((i) = 0; ((tmp) = (i) < (cnt) ? \
Given that "tmp" actually appears to be some sort of device cursor, I'm
not sure that that naming really achieves the stated goal of clarity :/
Robin.
> + dmar_rcu_dereference((devs)[(i)].dev) : NULL, (i) < (cnt)); \
> + (i)++)
> +
> +#define for_each_active_dev_scope(devs, cnt, i, tmp) \
> + for_each_dev_scope((devs), (cnt), (i), (tmp)) \
> + if (!(tmp)) { continue; } else
>
> extern int dmar_table_init(void);
> extern int dmar_dev_scope_init(void);
>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2019-06-03 13:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-03 12:59 [PATCH] iommu: replace single-char identifiers in macros Qian Cai
2019-06-03 13:07 ` Robin Murphy [this message]
2019-06-03 13:29 ` Qian Cai
2019-06-03 13:48 ` Robin Murphy
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=fe5e8da4-38d2-c663-c2e2-70e6d4f7640f@arm.com \
--to=robin.murphy@arm.com \
--cc=akpm@linux-foundation.org \
--cc=cai@lca.pw \
--cc=iommu@lists.linux-foundation.org \
--cc=jroedel@suse.de \
--cc=linux-kernel@vger.kernel.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