diff mbox

[U-Boot,09/11] dma: ti-edma3: Add BIT(x) macro definition

Message ID 1435922173-6531-10-git-send-email-vigneshr@ti.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Vignesh Raghavendra July 3, 2015, 11:16 a.m. UTC
Add BIT(x) macro definition to edma3 driver file. Fixes following
compiler warning when CONFIG_TI_EDMA3 is enabled for am437x and dra7x:

drivers/dma/ti-edma3.c: In function ‘edma3_set_dest’:
drivers/dma/ti-edma3.c:92:10: warning: implicit declaration of function
‘BIT’ [-Wimplicit-function-declaration]

Signed-off-by: Vignesh R <vigneshr@ti.com>
---
 drivers/dma/ti-edma3.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andy Pont July 3, 2015, 1:57 p.m. UTC | #1
Vignesh wrote...

[snip]

> +#define BIT(x)					(1 << (x))
> +

Is this not something that would be better in a global header file somewhere rather than it starting a trend of a per-driver, per-arch, etc. definitions?

Andy.
Vignesh Raghavendra July 4, 2015, 12:53 p.m. UTC | #2
On 7/3/2015 7:27 PM, Andy Pont wrote:
> Vignesh wrote...
> 
> [snip]
> 
>> +#define BIT(x)					(1 << (x))
>> +
> 
> Is this not something that would be better in a global header file somewhere rather than it starting a trend of a per-driver, per-arch, etc. definitions?

I agree there are few per arch defintions.
How about adding it to include/linux/bitops.h as in linux kernel?

Regards
Vignesh
Jagan Teki July 4, 2015, 3:35 p.m. UTC | #3
On 4 July 2015 at 18:23, R, Vignesh <vigneshr@ti.com> wrote:
>
>
> On 7/3/2015 7:27 PM, Andy Pont wrote:
>> Vignesh wrote...
>>
>> [snip]
>>
>>> +#define BIT(x)                                      (1 << (x))
>>> +
>>
>> Is this not something that would be better in a global header file somewhere rather than it starting a trend of a per-driver, per-arch, etc. definitions?
>
> I agree there are few per arch defintions.
> How about adding it to include/linux/bitops.h as in linux kernel?

Patch is under review [1] in fact you may give comment on the same.

[1] https://patchwork.ozlabs.org/patch/470478/

thanks!
diff mbox

Patch

diff --git a/drivers/dma/ti-edma3.c b/drivers/dma/ti-edma3.c
index 8184ded9fa81..638cf525a278 100644
--- a/drivers/dma/ti-edma3.c
+++ b/drivers/dma/ti-edma3.c
@@ -13,6 +13,8 @@ 
 #include <common.h>
 #include <asm/ti-common/ti-edma3.h>
 
+#define BIT(x)					(1 << (x))
+
 #define EDMA3_SL_BASE(slot)			(0x4000 + ((slot) << 5))
 #define EDMA3_SL_MAX_NUM			512
 #define EDMA3_SLOPT_FIFO_WIDTH_MASK		(0x7 << 8)