+ mm-add-dma_pool_zalloc-call-to-dma-api.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: add dma_pool_zalloc() call to DMA API
has been added to the -mm tree.  Its filename is
     mm-add-dma_pool_zalloc-call-to-dma-api.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-add-dma_pool_zalloc-call-to-dma-api.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-add-dma_pool_zalloc-call-to-dma-api.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: "Sean O. Stalley" <sean.stalley@xxxxxxxxx>
Subject: mm: add dma_pool_zalloc() call to DMA API

Add a wrapper function for dma_pool_alloc() to get zeroed memory.

Signed-off-by: Sean O. Stalley <sean.stalley@xxxxxxxxx>
Cc: Vinod Koul <vinod.koul@xxxxxxxxx>
Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Cc: Gilles Muller <Gilles.Muller@xxxxxxx>
Cc: Nicolas Palix <nicolas.palix@xxxxxxx>
Cc: Michal Marek <mmarek@xxxxxxx>
Cc: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
Cc: Jonathan Corbet <corbet@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 Documentation/DMA-API.txt |    7 +++++++
 include/linux/dmapool.h   |    6 ++++++
 2 files changed, 13 insertions(+)

diff -puN Documentation/DMA-API.txt~mm-add-dma_pool_zalloc-call-to-dma-api Documentation/DMA-API.txt
--- a/Documentation/DMA-API.txt~mm-add-dma_pool_zalloc-call-to-dma-api
+++ a/Documentation/DMA-API.txt
@@ -104,6 +104,13 @@ crossing restrictions, pass 0 for alloc;
 from this pool must not cross 4KByte boundaries.
 
 
+	void *dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags,
+			      dma_addr_t *handle)
+
+Wraps dma_pool_alloc() and also zeroes the returned memory if the
+allocation attempt succeeded.
+
+
 	void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags,
 			dma_addr_t *dma_handle);
 
diff -puN include/linux/dmapool.h~mm-add-dma_pool_zalloc-call-to-dma-api include/linux/dmapool.h
--- a/include/linux/dmapool.h~mm-add-dma_pool_zalloc-call-to-dma-api
+++ a/include/linux/dmapool.h
@@ -24,6 +24,12 @@ void dma_pool_destroy(struct dma_pool *p
 void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
 		     dma_addr_t *handle);
 
+static inline void *dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags,
+				    dma_addr_t *handle)
+{
+	return dma_pool_alloc(pool, mem_flags | __GFP_ZERO, handle);
+}
+
 void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr);
 
 /*
_

Patches currently in -mm which might be from sean.stalley@xxxxxxxxx are

mm-add-support-for-__gfp_zero-flag-to-dma_pool_alloc.patch
mm-add-dma_pool_zalloc-call-to-dma-api.patch
pci-mm-add-pci_pool_zalloc-call.patch
coccinelle-mm-scripts-coccinelle-api-alloc-pool_zalloc-simplecocci.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux