lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5614EA23.5080503@linaro.org>
Date:	Wed, 7 Oct 2015 11:47:15 +0200
From:	Daniel Lezcano <daniel.lezcano@...aro.org>
To:	Marc Gonzalez <marc_gonzalez@...madesigns.com>,
	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Mans Rullgard <mans@...sr.com>, Mason <slash.tmp@...e.fr>
Subject: Re: [PATCH v1] clocksource: Sigma Designs Tango 27 MHz xtal

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ