diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-05-15 05:51:52 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-06-04 05:12:07 -0400 |
commit | 8a3b6e143c3aa31fab4a820105e91e1cdb17ad42 (patch) | |
tree | 5651714c25d6522a3287c23e9c60dfa4029bb00f /drivers/dma/ste_dma40.c | |
parent | 1e74043a29cdec67279d6e4f494dd1674a1b2365 (diff) |
dmaengine: ste_dma40: Use the BIT macro to replace ugly '(1 << x)'s
The aim is to make the code that little more readable.
Acked-by: Vinod Koul <vnod.koul@intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/dma/ste_dma40.c')
-rw-r--r-- | drivers/dma/ste_dma40.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 6ed775736853..08bc58ae4ceb 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -54,8 +54,8 @@ | |||
54 | #define MAX_LCLA_ALLOC_ATTEMPTS 256 | 54 | #define MAX_LCLA_ALLOC_ATTEMPTS 256 |
55 | 55 | ||
56 | /* Bit markings for allocation map */ | 56 | /* Bit markings for allocation map */ |
57 | #define D40_ALLOC_FREE (1 << 31) | 57 | #define D40_ALLOC_FREE BIT(31) |
58 | #define D40_ALLOC_PHY (1 << 30) | 58 | #define D40_ALLOC_PHY BIT(30) |
59 | #define D40_ALLOC_LOG_FREE 0 | 59 | #define D40_ALLOC_LOG_FREE 0 |
60 | 60 | ||
61 | /* Reserved event lines for memcpy only. */ | 61 | /* Reserved event lines for memcpy only. */ |
@@ -1738,7 +1738,7 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data) | |||
1738 | } | 1738 | } |
1739 | 1739 | ||
1740 | /* ACK interrupt */ | 1740 | /* ACK interrupt */ |
1741 | writel(1 << idx, base->virtbase + il[row].clr); | 1741 | writel(BIT(idx), base->virtbase + il[row].clr); |
1742 | 1742 | ||
1743 | spin_lock(&d40c->lock); | 1743 | spin_lock(&d40c->lock); |
1744 | 1744 | ||
@@ -1828,8 +1828,8 @@ static bool d40_alloc_mask_set(struct d40_phy_res *phy, | |||
1828 | if (phy->allocated_src == D40_ALLOC_FREE) | 1828 | if (phy->allocated_src == D40_ALLOC_FREE) |
1829 | phy->allocated_src = D40_ALLOC_LOG_FREE; | 1829 | phy->allocated_src = D40_ALLOC_LOG_FREE; |
1830 | 1830 | ||
1831 | if (!(phy->allocated_src & (1 << log_event_line))) { | 1831 | if (!(phy->allocated_src & BIT(log_event_line))) { |
1832 | phy->allocated_src |= 1 << log_event_line; | 1832 | phy->allocated_src |= BIT(log_event_line); |
1833 | goto found; | 1833 | goto found; |
1834 | } else | 1834 | } else |
1835 | goto not_found; | 1835 | goto not_found; |
@@ -1840,8 +1840,8 @@ static bool d40_alloc_mask_set(struct d40_phy_res *phy, | |||
1840 | if (phy->allocated_dst == D40_ALLOC_FREE) | 1840 | if (phy->allocated_dst == D40_ALLOC_FREE) |
1841 | phy->allocated_dst = D40_ALLOC_LOG_FREE; | 1841 | phy->allocated_dst = D40_ALLOC_LOG_FREE; |
1842 | 1842 | ||
1843 | if (!(phy->allocated_dst & (1 << log_event_line))) { | 1843 | if (!(phy->allocated_dst & BIT(log_event_line))) { |
1844 | phy->allocated_dst |= 1 << log_event_line; | 1844 | phy->allocated_dst |= BIT(log_event_line); |
1845 | goto found; | 1845 | goto found; |
1846 | } else | 1846 | } else |
1847 | goto not_found; | 1847 | goto not_found; |
@@ -1871,11 +1871,11 @@ static bool d40_alloc_mask_free(struct d40_phy_res *phy, bool is_src, | |||
1871 | 1871 | ||
1872 | /* Logical channel */ | 1872 | /* Logical channel */ |
1873 | if (is_src) { | 1873 | if (is_src) { |
1874 | phy->allocated_src &= ~(1 << log_event_line); | 1874 | phy->allocated_src &= ~BIT(log_event_line); |
1875 | if (phy->allocated_src == D40_ALLOC_LOG_FREE) | 1875 | if (phy->allocated_src == D40_ALLOC_LOG_FREE) |
1876 | phy->allocated_src = D40_ALLOC_FREE; | 1876 | phy->allocated_src = D40_ALLOC_FREE; |
1877 | } else { | 1877 | } else { |
1878 | phy->allocated_dst &= ~(1 << log_event_line); | 1878 | phy->allocated_dst &= ~BIT(log_event_line); |
1879 | if (phy->allocated_dst == D40_ALLOC_LOG_FREE) | 1879 | if (phy->allocated_dst == D40_ALLOC_LOG_FREE) |
1880 | phy->allocated_dst = D40_ALLOC_FREE; | 1880 | phy->allocated_dst = D40_ALLOC_FREE; |
1881 | } | 1881 | } |
@@ -2356,7 +2356,7 @@ static void __d40_set_prio_rt(struct d40_chan *d40c, int dev_type, bool src) | |||
2356 | u32 rtreg; | 2356 | u32 rtreg; |
2357 | u32 event = D40_TYPE_TO_EVENT(dev_type); | 2357 | u32 event = D40_TYPE_TO_EVENT(dev_type); |
2358 | u32 group = D40_TYPE_TO_GROUP(dev_type); | 2358 | u32 group = D40_TYPE_TO_GROUP(dev_type); |
2359 | u32 bit = 1 << event; | 2359 | u32 bit = BIT(event); |
2360 | u32 prioreg; | 2360 | u32 prioreg; |
2361 | struct d40_gen_dmac *dmac = &d40c->base->gen_dmac; | 2361 | struct d40_gen_dmac *dmac = &d40c->base->gen_dmac; |
2362 | 2362 | ||