From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Wed, 08 Jul 2015 07:01:16 +0200 Subject: [U-Boot] [RFC PATCH 02/12] linux_compat: remove cpu_relax() define In-Reply-To: <1436329782-9179-3-git-send-email-yamada.masahiro@socionext.com> References: <1436329782-9179-1-git-send-email-yamada.masahiro@socionext.com> <1436329782-9179-3-git-send-email-yamada.masahiro@socionext.com> Message-ID: <559CAE9C.1090904@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Masahiro, Am 08.07.2015 um 06:29 schrieb Masahiro Yamada: > 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 > from some sources. Drop the latter. > > Signed-off-by: Masahiro Yamada > --- > > 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 > #include "linux-compat.h" > +#include > #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) > - doesn;t this lead to compie errors on archs, which does not define this? If so, we should add this in arch/{xxx}/include/asm/processor.h beside of that. Reviewed-by: Heiko Schocher bye, Heiko > #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) > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany