From: Shunyong Yang <shunyong.yang@hxt-semitech.com>
To: <bhelgaas@google.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>,
Shunyong Yang <shunyong.yang@hxt-semitech.com>,
Joey Zheng <yu.zheng@hxt-semitech.com>
Subject: [PATCH] PCI: Unify pci and normal dma direction definition
Date: Fri, 13 Jul 2018 14:37:20 +0800 [thread overview]
Message-ID: <1531463840-34651-1-git-send-email-shunyong.yang@hxt-semitech.com> (raw)
Current DMA direction definitions in pci-dma-compat.h and dma-direction.h
are mirrored in value. Unify them to enhance readability and avoid
possible inconsistency.
Cc: Joey Zheng <yu.zheng@hxt-semitech.com>
Signed-off-by: Shunyong Yang <shunyong.yang@hxt-semitech.com>
---
include/linux/dma-direction.h | 2 +-
include/linux/pci-dma-compat.h | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/linux/dma-direction.h b/include/linux/dma-direction.h
index 3649a031893a..9d52716e9218 100644
--- a/include/linux/dma-direction.h
+++ b/include/linux/dma-direction.h
@@ -2,7 +2,7 @@
#ifndef _LINUX_DMA_DIRECTION_H
#define _LINUX_DMA_DIRECTION_H
/*
- * These definitions mirror those in pci.h, so they can be used
+ * These definitions mirror those in pci-dma-compat.h, so they can be used
* interchangeably with their PCI_ counterparts.
*/
enum dma_data_direction {
diff --git a/include/linux/pci-dma-compat.h b/include/linux/pci-dma-compat.h
index 0dd1a3f7b309..c1c8d49b6072 100644
--- a/include/linux/pci-dma-compat.h
+++ b/include/linux/pci-dma-compat.h
@@ -8,10 +8,10 @@
#include <linux/dma-mapping.h>
/* This defines the direction arg to the DMA mapping routines. */
-#define PCI_DMA_BIDIRECTIONAL 0
-#define PCI_DMA_TODEVICE 1
-#define PCI_DMA_FROMDEVICE 2
-#define PCI_DMA_NONE 3
+#define PCI_DMA_BIDIRECTIONAL (DMA_BIDIRECTIONAL)
+#define PCI_DMA_TODEVICE (DMA_TO_DEVICE)
+#define PCI_DMA_FROMDEVICE (DMA_FROM_DEVICE)
+#define PCI_DMA_NONE (DMA_NONE)
static inline void *
pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
--
1.8.3.1
next reply other threads:[~2018-07-13 6:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 6:37 Shunyong Yang [this message]
2018-07-17 14:03 ` [PATCH] PCI: Unify pci and normal dma direction definition Christoph Hellwig
2018-07-18 0:45 ` Yang, Shunyong
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=1531463840-34651-1-git-send-email-shunyong.yang@hxt-semitech.com \
--to=shunyong.yang@hxt-semitech.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=yu.zheng@hxt-semitech.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).