summaryrefslogtreecommitdiff
path: root/kernel/dma
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-16 17:00:16 +0200
committerChristoph Hellwig <hch@lst.de>2020-07-19 09:31:13 +0200
commit23efed6fa7519e29a01f12723b0cfa8118dc87cb (patch)
tree8f1f5518cb11c1fd6e07125d2e1a3c080d47882f /kernel/dma
parentf1565c24b5965dfd2352f209c417ff160be04db9 (diff)
downloadlwn-23efed6fa7519e29a01f12723b0cfa8118dc87cb.tar.gz
lwn-23efed6fa7519e29a01f12723b0cfa8118dc87cb.zip
dma-debug: use named initializers for dir2name
Make dir2name a little more readable and maintainable by using named initializers. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Diffstat (limited to 'kernel/dma')
-rw-r--r--kernel/dma/debug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
index 36c962a86bf2..4dd0d9028ec8 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[] = {
+ [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