public inbox for iommu@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Christoph Hellwig <hch@lst.de>, iommu@lists.linux-foundation.org
Subject: Re: [PATCH] dma-debug: use named initializers for dir2name
Date: Thu, 16 Jul 2020 17:12:30 +0100	[thread overview]
Message-ID: <c31374eb-855a-839b-5d52-96bc93ca69f3@arm.com> (raw)
In-Reply-To: <20200716150112.476896-1-hch@lst.de>

On 2020-07-16 16:01, Christoph Hellwig wrote:
> Make dir2name a little more readable and maintainable by using
> named initializers.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   kernel/dma/debug.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
> index 36c962a86bf25d..41e720c3ab20c5 100644
> --- a/kernel/dma/debug.c
> +++ b/kernel/dma/debug.c
> @@ -144,8 +144,12 @@ static const char *type2name[] = {
>   	[dma_debug_resource] = "resource",
>   };
>   
> -static const char *dir2name[4] = { "DMA_BIDIRECTIONAL", "DMA_TO_DEVICE",
> -				   "DMA_FROM_DEVICE", "DMA_NONE" };
> +static const char *dir2name[4] = {

Nit: I think you can probably drop the explicit array size here.

Otherwise, very welcome clarity!

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> +	[DMA_BIDIRECTIONAL]	= "DMA_BIDIRECTIONAL",
> +	[DMA_TO_DEVICE]		= "DMA_TO_DEVICE",
> +	[DMA_FROM_DEVICE]	= "DMA_FROM_DEVICE",
> +	[DMA_NONE]		= "DMA_NONE",
> +};
>   
>   /*
>    * The access to some variables in this macro is racy. We can't use atomic_t
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2020-07-16 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 15:01 [PATCH] dma-debug: use named initializers for dir2name Christoph Hellwig
2020-07-16 16:12 ` Robin Murphy [this message]
2020-07-20  6:23   ` Christoph Hellwig

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=c31374eb-855a-839b-5d52-96bc93ca69f3@arm.com \
    --to=robin.murphy@arm.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.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