From: hch@lst.de (Christoph Hellwig)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH 3/6] arc: simplify arc_dma_sync_single_for_{cpu,device}
Date: Fri, 18 May 2018 15:45:42 +0200 [thread overview]
Message-ID: <20180518134545.5036-4-hch@lst.de> (raw)
In-Reply-To: <20180518134545.5036-1-hch@lst.de>
Remove the indirection through _dma_cache_sync. Also move the functions
up a bit in the source file as we'll need them in more places soon.
Signed-off-by: Christoph Hellwig <hch at lst.de>
---
arch/arc/mm/dma.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/arc/mm/dma.c b/arch/arc/mm/dma.c
index 1dcc404b5aec..98e21ce526be 100644
--- a/arch/arc/mm/dma.c
+++ b/arch/arc/mm/dma.c
@@ -153,6 +153,18 @@ static void _dma_cache_sync(phys_addr_t paddr, size_t size,
}
}
+static void arc_dma_sync_single_for_device(struct device *dev,
+ dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
+{
+ dma_cache_wback(dma_handle, size);
+}
+
+static void arc_dma_sync_single_for_cpu(struct device *dev,
+ dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
+{
+ dma_cache_inv(dma_handle, size);
+}
+
/*
* arc_dma_map_page - map a portion of a page for streaming DMA
*
@@ -221,18 +233,6 @@ static void arc_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
attrs);
}
-static void arc_dma_sync_single_for_cpu(struct device *dev,
- dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
-{
- _dma_cache_sync(dma_handle, size, DMA_FROM_DEVICE);
-}
-
-static void arc_dma_sync_single_for_device(struct device *dev,
- dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
-{
- _dma_cache_sync(dma_handle, size, DMA_TO_DEVICE);
-}
-
static void arc_dma_sync_sg_for_cpu(struct device *dev,
struct scatterlist *sglist, int nelems,
enum dma_data_direction dir)
--
2.17.0
next prev parent reply other threads:[~2018-05-18 13:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 13:45 arc dma mapping cleanups/fixes and generic noncohernt dma code Christoph Hellwig
2018-05-18 13:45 ` [PATCH 1/6] dma-mapping: simplify Kconfig dependencies Christoph Hellwig
2018-05-18 13:45 ` [PATCH 2/6] dma-mapping: provide a generic dma-noncoherent implementation Christoph Hellwig
2018-05-18 13:45 ` Christoph Hellwig [this message]
2018-05-18 13:45 ` [PATCH 4/6] arc: fix arc_dma_sync_sg_for_{cpu,device} Christoph Hellwig
2018-05-18 13:45 ` [PATCH 5/6] arc: fix arc_dma_{map,unmap}_page Christoph Hellwig
2018-05-18 13:45 ` [PATCH 6/6] arc: use generic dma_noncoherent_ops Christoph Hellwig
2018-05-18 14:49 ` arc dma mapping cleanups/fixes and generic noncohernt dma code Alexey Brodkin
2018-05-18 16:50 ` hch
2018-05-19 0:03 ` Vineet Gupta
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=20180518134545.5036-4-hch@lst.de \
--to=hch@lst.de \
--cc=linux-snps-arc@lists.infradead.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