diff mbox

[U-Boot,v2,02/14] linux_compat: remove cpu_relax() define

Message ID 1436761037-19635-3-git-send-email-yamada.masahiro@socionext.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Masahiro Yamada July 13, 2015, 4:17 a.m. UTC
The macro cpu_relax() is defined by several headers in different
ways.

arch/{arm,avr32,mips}/include/asm/processor.h defines it as follows:
  #define cpu_relax()	barrier()

On the other hand, include/linux/compat.h defines it as follows:
  #define cpu_relax() do {} while (0)

If both headers are included from the same source file, the warning
  warning: "cpu_relax" redefined [enabled by default]
is displayed.

It effectively makes it impossible to include <linux/compat.h>
from some sources.  Drop the latter.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 drivers/usb/musb-new/musb_gadget_ep0.c | 1 +
 include/linux/compat.h                 | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

Comments

Ɓukasz Majewski July 13, 2015, 7:38 a.m. UTC | #1
Hi Masahiro,

> The macro cpu_relax() is defined by several headers in different
> ways.
> 
> arch/{arm,avr32,mips}/include/asm/processor.h defines it as follows:
>   #define cpu_relax()	barrier()
> 
> On the other hand, include/linux/compat.h defines it as follows:
>   #define cpu_relax() do {} while (0)
> 
> If both headers are included from the same source file, the warning
>   warning: "cpu_relax" redefined [enabled by default]
> is displayed.
> 
> It effectively makes it impossible to include <linux/compat.h>
> from some sources.  Drop the latter.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Reviewed-by: Heiko Schocher <hs@denx.de>
> Acked-by: Simon Glass <sjg@chromium.org>
> ---
> 
> Changes in v2: None
> 
>  drivers/usb/musb-new/musb_gadget_ep0.c | 1 +
>  include/linux/compat.h                 | 2 --
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/musb-new/musb_gadget_ep0.c
> b/drivers/usb/musb-new/musb_gadget_ep0.c index 5a71501..415a9f2 100644
> --- a/drivers/usb/musb-new/musb_gadget_ep0.c
> +++ b/drivers/usb/musb-new/musb_gadget_ep0.c
> @@ -43,6 +43,7 @@
>  #else
>  #include <common.h>
>  #include "linux-compat.h"
> +#include <asm/processor.h>
>  #endif
>  
>  #include "musb_core.h"
> diff --git a/include/linux/compat.h b/include/linux/compat.h
> index 6ff3915..da1420f 100644
> --- a/include/linux/compat.h
> +++ b/include/linux/compat.h
> @@ -315,8 +315,6 @@ struct notifier_block {};
>  
>  typedef unsigned long dmaaddr_t;
>  
> -#define cpu_relax() do {} while (0)
> -
>  #define pm_runtime_get_sync(dev) do {} while (0)
>  #define pm_runtime_put(dev) do {} while (0)
>  #define pm_runtime_put_sync(dev) do {} while (0)

Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
Simon Glass July 22, 2015, 11:24 p.m. UTC | #2
On 13 July 2015 at 01:38, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Hi Masahiro,
>
>> The macro cpu_relax() is defined by several headers in different
>> ways.
>>
>> arch/{arm,avr32,mips}/include/asm/processor.h defines it as follows:
>>   #define cpu_relax() barrier()
>>
>> On the other hand, include/linux/compat.h defines it as follows:
>>   #define cpu_relax() do {} while (0)
>>
>> If both headers are included from the same source file, the warning
>>   warning: "cpu_relax" redefined [enabled by default]
>> is displayed.
>>
>> It effectively makes it impossible to include <linux/compat.h>
>> from some sources.  Drop the latter.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> Reviewed-by: Heiko Schocher <hs@denx.de>
>> Acked-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>> Changes in v2: None
>>
>>  drivers/usb/musb-new/musb_gadget_ep0.c | 1 +
>>  include/linux/compat.h                 | 2 --
>>  2 files changed, 1 insertion(+), 2 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox

Patch

diff --git a/drivers/usb/musb-new/musb_gadget_ep0.c b/drivers/usb/musb-new/musb_gadget_ep0.c
index 5a71501..415a9f2 100644
--- a/drivers/usb/musb-new/musb_gadget_ep0.c
+++ b/drivers/usb/musb-new/musb_gadget_ep0.c
@@ -43,6 +43,7 @@ 
 #else
 #include <common.h>
 #include "linux-compat.h"
+#include <asm/processor.h>
 #endif
 
 #include "musb_core.h"
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 6ff3915..da1420f 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -315,8 +315,6 @@  struct notifier_block {};
 
 typedef unsigned long dmaaddr_t;
 
-#define cpu_relax() do {} while (0)
-
 #define pm_runtime_get_sync(dev) do {} while (0)
 #define pm_runtime_put(dev) do {} while (0)
 #define pm_runtime_put_sync(dev) do {} while (0)