diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-10-26 10:35:15 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-01-08 01:04:53 -0500 |
commit | e5a087fdc1ebe5bba40bcecb53c28a0af70e3b47 (patch) | |
tree | 729413f91a92c1ce3a98fffa273363a17ff44666 /include/linux/dmaengine.h | |
parent | e63a47a361e03eaf79e0f2f6cdaca8e7679d1867 (diff) |
dmaengine: use for_each_set_bit
Use for_each_set_bit() to implement for_each_dma_cap_mask() and
remove unused first_dma_cap() and next_dma_cap().
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'include/linux/dmaengine.h')
-rw-r--r-- | include/linux/dmaengine.h | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index c88f302d91c9..4c8643794e0d 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -849,20 +849,6 @@ static inline bool async_tx_test_ack(struct dma_async_tx_descriptor *tx) | |||
849 | return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK; | 849 | return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK; |
850 | } | 850 | } |
851 | 851 | ||
852 | #define first_dma_cap(mask) __first_dma_cap(&(mask)) | ||
853 | static inline int __first_dma_cap(const dma_cap_mask_t *srcp) | ||
854 | { | ||
855 | return min_t(int, DMA_TX_TYPE_END, | ||
856 | find_first_bit(srcp->bits, DMA_TX_TYPE_END)); | ||
857 | } | ||
858 | |||
859 | #define next_dma_cap(n, mask) __next_dma_cap((n), &(mask)) | ||
860 | static inline int __next_dma_cap(int n, const dma_cap_mask_t *srcp) | ||
861 | { | ||
862 | return min_t(int, DMA_TX_TYPE_END, | ||
863 | find_next_bit(srcp->bits, DMA_TX_TYPE_END, n+1)); | ||
864 | } | ||
865 | |||
866 | #define dma_cap_set(tx, mask) __dma_cap_set((tx), &(mask)) | 852 | #define dma_cap_set(tx, mask) __dma_cap_set((tx), &(mask)) |
867 | static inline void | 853 | static inline void |
868 | __dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp) | 854 | __dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp) |
@@ -891,9 +877,7 @@ __dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp) | |||
891 | } | 877 | } |
892 | 878 | ||
893 | #define for_each_dma_cap_mask(cap, mask) \ | 879 | #define for_each_dma_cap_mask(cap, mask) \ |
894 | for ((cap) = first_dma_cap(mask); \ | 880 | for_each_set_bit(cap, mask.bits, DMA_TX_TYPE_END) |
895 | (cap) < DMA_TX_TYPE_END; \ | ||
896 | (cap) = next_dma_cap((cap), (mask))) | ||
897 | 881 | ||
898 | /** | 882 | /** |
899 | * dma_async_issue_pending - flush pending transactions to HW | 883 | * dma_async_issue_pending - flush pending transactions to HW |