* [PATCH] ARM: localtimer: add header linux/errno.h explicitly
@ 2011-09-23 17:22 Shawn Guo
2011-09-30 2:02 ` Shawn Guo
2011-10-02 8:20 ` [PATCH v2] " Shawn Guo
0 siblings, 2 replies; 4+ messages in thread
From: Shawn Guo @ 2011-09-23 17:22 UTC (permalink / raw)
To: linux-arm-kernel
Per the text in Documentation/SubmitChecklist as below, we should
explicitly have header linux/errno.h in localtimer.h for ENXIO
reference.
1: If you use a facility then #include the file that defines/declares
that facility. Don't depend on other header files pulling in ones
that you use.
Otherwise, we may run into some compiling error like the following one,
if any file includes localtimer.h without CONFIG_LOCAL_TIMERS defined.
arch/arm/include/asm/localtimer.h: In function ?local_timer_setup?:
arch/arm/include/asm/localtimer.h:53:10: error: ?ENXIO? undeclared (first use in this function)
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/include/asm/localtimer.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index 080d74f..698ff73 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -48,6 +48,8 @@ int local_timer_setup(struct clock_event_device *);
#else
+#include <linux/errno.h>
+
static inline int local_timer_setup(struct clock_event_device *evt)
{
return -ENXIO;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ARM: localtimer: add header linux/errno.h explicitly
2011-09-23 17:22 [PATCH] ARM: localtimer: add header linux/errno.h explicitly Shawn Guo
@ 2011-09-30 2:02 ` Shawn Guo
2011-10-01 16:37 ` Russell King - ARM Linux
2011-10-02 8:20 ` [PATCH v2] " Shawn Guo
1 sibling, 1 reply; 4+ messages in thread
From: Shawn Guo @ 2011-09-30 2:02 UTC (permalink / raw)
To: linux-arm-kernel
Hi Russell,
Do you have any comment on this patch? Otherwise, I will put it into
patch tracker.
Regards,
Shawn
On Sat, Sep 24, 2011 at 01:22:25AM +0800, Shawn Guo wrote:
> Per the text in Documentation/SubmitChecklist as below, we should
> explicitly have header linux/errno.h in localtimer.h for ENXIO
> reference.
>
> 1: If you use a facility then #include the file that defines/declares
> that facility. Don't depend on other header files pulling in ones
> that you use.
>
> Otherwise, we may run into some compiling error like the following one,
> if any file includes localtimer.h without CONFIG_LOCAL_TIMERS defined.
>
> arch/arm/include/asm/localtimer.h: In function ?local_timer_setup?:
> arch/arm/include/asm/localtimer.h:53:10: error: ?ENXIO? undeclared (first use in this function)
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> arch/arm/include/asm/localtimer.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
> index 080d74f..698ff73 100644
> --- a/arch/arm/include/asm/localtimer.h
> +++ b/arch/arm/include/asm/localtimer.h
> @@ -48,6 +48,8 @@ int local_timer_setup(struct clock_event_device *);
>
> #else
>
> +#include <linux/errno.h>
> +
> static inline int local_timer_setup(struct clock_event_device *evt)
> {
> return -ENXIO;
> --
> 1.7.4.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: localtimer: add header linux/errno.h explicitly
2011-09-30 2:02 ` Shawn Guo
@ 2011-10-01 16:37 ` Russell King - ARM Linux
0 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2011-10-01 16:37 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Sep 30, 2011 at 10:02:10AM +0800, Shawn Guo wrote:
> Hi Russell,
>
> Do you have any comment on this patch? Otherwise, I will put it into
> patch tracker.
Only that the include should be towards the top of the file rather
than conditionally included. That avoids potential surprise compile
errors caused by changes in configuration. (Ok, you may argue that
they shouldn't happen but with the amount of includes we have it's
very difficult to ensure that everything explicitly includes everything
it actually needs.)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] ARM: localtimer: add header linux/errno.h explicitly
2011-09-23 17:22 [PATCH] ARM: localtimer: add header linux/errno.h explicitly Shawn Guo
2011-09-30 2:02 ` Shawn Guo
@ 2011-10-02 8:20 ` Shawn Guo
1 sibling, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2011-10-02 8:20 UTC (permalink / raw)
To: linux-arm-kernel
Per the text in Documentation/SubmitChecklist as below, we should
explicitly have header linux/errno.h in localtimer.h for ENXIO
reference.
1: If you use a facility then #include the file that defines/declares
that facility. Don't depend on other header files pulling in ones
that you use.
Otherwise, we may run into some compiling error like the following one,
if any file includes localtimer.h without CONFIG_LOCAL_TIMERS defined.
arch/arm/include/asm/localtimer.h: In function ?local_timer_setup?:
arch/arm/include/asm/localtimer.h:53:10: error: ?ENXIO? undeclared (first use in this function)
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
Changes since v1:
* Move the include towards the top of the file
arch/arm/include/asm/localtimer.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index 080d74f..ff66638 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -10,6 +10,8 @@
#ifndef __ASM_ARM_LOCALTIMER_H
#define __ASM_ARM_LOCALTIMER_H
+#include <linux/errno.h>
+
struct clock_event_device;
/*
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-02 8:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-23 17:22 [PATCH] ARM: localtimer: add header linux/errno.h explicitly Shawn Guo
2011-09-30 2:02 ` Shawn Guo
2011-10-01 16:37 ` Russell King - ARM Linux
2011-10-02 8:20 ` [PATCH v2] " Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).