diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2010-03-29 01:24:45 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 11:35:42 -0700 |
commit | 9fd453c981b07f8cd501a938085b901b0c8c0bf5 (patch) | |
tree | 7de15b19a9178f57ae71e3a46664e9f078756579 /drivers/staging/rt2860/rt_linux.h | |
parent | 5d6892b3c6811cfd20e3d71d89fa77f4b6bd089b (diff) |
Staging: rt28xx: Make PCI_{MAP,UNMAP}_SINGLE type-safe
To avoid recurrence of bugs such as <http://bugs.debian.org/575726>,
change the type of the first parameter to linux_pci_{map,unmap}_single()
from void * to struct rt_rtmp_adapter *. Also do not define the macros
PCI_{MAP,UNMAP}_SINGLE() when building the rt2870sta driver; they are
not used and if they were that would be a bug.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rt2860/rt_linux.h')
-rw-r--r-- | drivers/staging/rt2860/rt_linux.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/staging/rt2860/rt_linux.h b/drivers/staging/rt2860/rt_linux.h index a7c540f8e3e3..b370fb21e423 100644 --- a/drivers/staging/rt2860/rt_linux.h +++ b/drivers/staging/rt2860/rt_linux.h @@ -455,10 +455,11 @@ void hex_dump(char *str, unsigned char *pSrcBufVA, unsigned int SrcBufLen); * Device DMA Access related definitions and data structures. **********************************************************************************/ #ifdef RTMP_MAC_PCI -dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, - int sd_idx, int direction); -void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, - int direction); +struct rt_rtmp_adapter; +dma_addr_t linux_pci_map_single(struct rt_rtmp_adapter *pAd, void *ptr, + size_t size, int sd_idx, int direction); +void linux_pci_unmap_single(struct rt_rtmp_adapter *pAd, dma_addr_t dma_addr, + size_t size, int direction); #define PCI_MAP_SINGLE(_handle, _ptr, _size, _sd_idx, _dir) \ linux_pci_map_single(_handle, _ptr, _size, _sd_idx, _dir) @@ -475,11 +476,6 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, #define DEV_ALLOC_SKB(_length) \ dev_alloc_skb(_length) #endif /* RTMP_MAC_PCI // */ -#ifdef RTMP_MAC_USB -#define PCI_MAP_SINGLE(_handle, _ptr, _size, _dir) (unsigned long)0 - -#define PCI_UNMAP_SINGLE(_handle, _ptr, _size, _dir) -#endif /* RTMP_MAC_USB // */ /* * unsigned long |