From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>,
Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Mans Rullgard <mans@mansr.com>, Mason <slash.tmp@free.fr>
Subject: Re: [PATCH v1] clocksource: Sigma Designs Tango 27 MHz xtal
Date: Wed, 7 Oct 2015 11:47:15 +0200 [thread overview]
Message-ID: <5614EA23.5080503@linaro.org> (raw)
In-Reply-To: <5614D66A.1060402@sigmadesigns.com>
On 10/07/2015 10:23 AM, Marc Gonzalez wrote:
[ ... ]
>>> +++ b/drivers/clocksource/tango_xtal.c
>>> @@ -0,0 +1,46 @@
>>> +#include <linux/clocksource.h>
>>> +#include <linux/sched_clock.h>
>>> +#include <linux/of_address.h>
>>> +#include <linux/delay.h>
>>> +#include <linux/clk.h>
>>
>> #include <linux/init.h> is missing.
>
> For my education: this header is already indirectly included;
> The directive should be explicit to prevent breakage in case
> other (implicit) includes are reorganized?
Yes, exactly.
The 'clocksource.h' header includes 'init.h' only for the
'clocksource_default_clock' function. If this function disappears, or
the __init section is removed, then the 'init.h' inclusion won't make
sense anymore in the header file. By removing it, that will break all
code relying on the implicit inclusion.
So the rule of thumb I apply to myself is always to explicitly include
the headers in the C file even if it is already implicitly included.
This rule is valid only if the header file is not using intensively code
coming from the implicit inclusion like static inlines etc ...
>>> +static void __iomem *xtal_in_cnt;
>>> +static struct delay_timer delay_timer;
>>> +
>>> +static unsigned long read_xtal_counter(void)
>>> +{
>>> + return readl_relaxed(xtal_in_cnt);
>>> +}
>>> +
>>> +static u64 read_sched_clock(void)
>>> +{
>>> + return read_xtal_counter();
>>> +}
>>
>> static u64 *notrace* read_sched_clock(void)
>
> What about read_clocksource? and read_xtal_counter?
See commit 89e6a13b88.
-- Daniel
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2015-10-07 9:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 15:10 [PATCH v1] clocksource: Sigma Designs Tango 27 MHz xtal Marc Gonzalez
2015-10-06 23:09 ` Daniel Lezcano
2015-10-07 8:23 ` Marc Gonzalez
2015-10-07 9:47 ` Daniel Lezcano [this message]
2015-10-07 11:14 ` Marc Gonzalez
2015-10-07 11:35 ` Daniel Lezcano
2015-10-07 11:35 ` [PATCH v2] clocksource/drivers/tango_xtal: Add new timer for Tango SoCs Marc Gonzalez
2015-10-07 12:31 ` Daniel Lezcano
2015-10-07 13:17 ` Marc Gonzalez
2015-10-07 16:03 ` Daniel Lezcano
2015-10-07 20:12 ` Mason
2015-10-09 12:13 ` [PATCH v3] " Marc Gonzalez
2015-10-09 13:24 ` Daniel Lezcano
2015-10-09 13:46 ` Marc Gonzalez
2015-10-09 14:21 ` Daniel Lezcano
2015-10-09 16:39 ` Nicolas Pitre
2015-10-09 14:37 ` [PATCH v4] " Marc Gonzalez
2015-10-09 14:42 ` Daniel Lezcano
2015-10-09 14:59 ` [PATCH v5] " Marc Gonzalez
2015-10-16 12:07 ` Daniel Lezcano
2015-10-09 14:51 ` [PATCH v4] " Måns Rullgård
2015-10-09 15:42 ` Marc Gonzalez
2015-10-09 16:01 ` Måns Rullgård
2015-10-09 16:36 ` Marc Gonzalez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5614EA23.5080503@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mans@mansr.com \
--cc=marc_gonzalez@sigmadesigns.com \
--cc=slash.tmp@free.fr \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).