]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
pci-dma-compat: add pci_zalloc_consistent helper
authorJoe Perches <joe@perches.com>
Fri, 8 Aug 2014 21:24:08 +0000 (14:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Aug 2014 22:57:28 +0000 (15:57 -0700)
Add this helper for consistency with pci_zalloc_coherent
and the ability to remove unnecessary memset(,0,) uses.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
Cc: Adam Radford <linuxraid@lsi.com>
Cc: Chaoming Li <chaoming_li@realsil.com.cn>
Cc: Chas Williams <chas@cmf.nrl.navy.mil>
Cc: Christian Benvenuti <benve@cisco.com>
Cc: Christopher Harrer <charrer@alacritech.com>
Cc: Dario Ballabio <ballabio_dario@emc.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Don Fry <pcnet32@frontier.com>
Cc: Faisal Latif <faisal.latif@intel.com>
Cc: Forest Bond <forest@alittletooquiet.net>
Cc: Govindarajulu Varadarajan <_govind@gmx.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Lior Dotan <liodot@gmail.com>
Cc: Manish Chopra <manish.chopra@qlogic.com>
Cc: Manohar Vanga <manohar.vanga@gmail.com>
Cc: Martyn Welch <martyn.welch@ge.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Michael Neuffer <mike@i-Connect.Net>
Cc: Mirko Lindner <mlindner@marvell.com>
Cc: Neel Patel <neepatel@cisco.com>
Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
Cc: Rajesh Borundia <rajesh.borundia@qlogic.com>
Cc: Roland Dreier <roland@kernel.org>
Cc: Ron Mercer <ron.mercer@qlogic.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Shahed Shaikh <shahed.shaikh@qlogic.com>
Cc: Sony Chacko <sony.chacko@qlogic.com>
Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Steve Wise <swise@opengridcomputing.com>
Cc: Sujith Sankar <ssujith@cisco.com>
Cc: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/asm-generic/pci-dma-compat.h

index 1437b7da09b251ad79427af493ff4a6b688229f5..c110843fc53b3f80174496148df8798c866db1b5 100644 (file)
@@ -19,6 +19,14 @@ pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
        return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, dma_handle, GFP_ATOMIC);
 }
 
+static inline void *
+pci_zalloc_consistent(struct pci_dev *hwdev, size_t size,
+                     dma_addr_t *dma_handle)
+{
+       return dma_zalloc_coherent(hwdev == NULL ? NULL : &hwdev->dev,
+                                  size, dma_handle, GFP_ATOMIC);
+}
+
 static inline void
 pci_free_consistent(struct pci_dev *hwdev, size_t size,
                    void *vaddr, dma_addr_t dma_handle)