2012-10-18 01:57:57

by Laurent Pinchart

[permalink] [raw]
Subject: [PATCH 1/2] drivers: dma-contiguous: Don't redefine SZ_1M

Use the definition from linux/sizes.h instead.

Signed-off-by: Laurent Pinchart <[email protected]>
---
drivers/base/dma-contiguous.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
index 9a14694..612afcc 100644
--- a/drivers/base/dma-contiguous.c
+++ b/drivers/base/dma-contiguous.c
@@ -27,15 +27,12 @@
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/page-isolation.h>
+#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/swap.h>
#include <linux/mm_types.h>
#include <linux/dma-contiguous.h>

-#ifndef SZ_1M
-#define SZ_1M (1 << 20)
-#endif
-
struct cma {
unsigned long base_pfn;
unsigned long count;
--
1.7.8.6


2012-10-18 01:57:56

by Laurent Pinchart

[permalink] [raw]
Subject: [PATCH 2/2] drivers: dma-coherent: Fix typo in dma_mmap_from_coherent documentation

The function documentation incorrectly references dma_release_coherent.
Fix it. Don't mention a specific function name as dma_mmap_from_coherent
as multiple callers.

Signed-off-by: Laurent Pinchart <[email protected]>
---
drivers/base/dma-coherent.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/base/dma-coherent.c b/drivers/base/dma-coherent.c
index 560a717..bc256b6 100644
--- a/drivers/base/dma-coherent.c
+++ b/drivers/base/dma-coherent.c
@@ -191,9 +191,8 @@ EXPORT_SYMBOL(dma_release_from_coherent);
* This checks whether the memory was allocated from the per-device
* coherent memory pool and if so, maps that memory to the provided vma.
*
- * Returns 1 if we correctly mapped the memory, or 0 if
- * dma_release_coherent() should proceed with mapping memory from
- * generic pools.
+ * Returns 1 if we correctly mapped the memory, or 0 if the caller should
+ * proceed with mapping memory from generic pools.
*/
int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
void *vaddr, size_t size, int *ret)
--
1.7.8.6

2012-10-18 13:17:11

by Marek Szyprowski

[permalink] [raw]
Subject: RE: [PATCH 1/2] drivers: dma-contiguous: Don't redefine SZ_1M

Hi Laurent,

Thanks for those two cleanups, I will take them to my dma-mapping tree too.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center