From 82bf0baad9768c21850d06ddc24ea47984c4c90f Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Fri, 8 Aug 2014 14:24:08 -0700 Subject: [PATCH] pci-dma-compat: add pci_zalloc_consistent helper Add this helper for consistency with pci_zalloc_coherent and the ability to remove unnecessary memset(,0,) uses. Signed-off-by: Joe Perches Cc: Arnd Bergmann Cc: "James E.J. Bottomley" Cc: "John W. Linville" Cc: "Stephen M. Cameron" Cc: Adam Radford Cc: Chaoming Li Cc: Chas Williams Cc: Christian Benvenuti Cc: Christopher Harrer Cc: Dario Ballabio Cc: David Airlie Cc: Don Fry Cc: Faisal Latif Cc: Forest Bond Cc: Govindarajulu Varadarajan <_govind@gmx.com> Cc: Greg Kroah-Hartman Cc: Hal Rosenstock Cc: Hans Verkuil Cc: Jayamohan Kallickal Cc: Jiri Slaby Cc: Jitendra Kalsaria Cc: Larry Finger Cc: Lennert Buytenhek Cc: Lior Dotan Cc: Manish Chopra Cc: Manohar Vanga Cc: Martyn Welch Cc: Mauro Carvalho Chehab Cc: Michael Neuffer Cc: Mirko Lindner Cc: Neel Patel Cc: Neela Syam Kolli Cc: Rajesh Borundia Cc: Roland Dreier Cc: Ron Mercer Cc: Samuel Ortiz Cc: Sean Hefty Cc: Shahed Shaikh Cc: Sony Chacko Cc: Stanislav Yakovlev Cc: Stephen Hemminger Cc: Steve Wise Cc: Sujith Sankar Cc: Tom Tucker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-generic/pci-dma-compat.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/asm-generic/pci-dma-compat.h b/include/asm-generic/pci-dma-compat.h index 1437b7d..c110843 100644 --- a/include/asm-generic/pci-dma-compat.h +++ b/include/asm-generic/pci-dma-compat.h @@ -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) -- 2.7.4