* [PATCH] clocksource: add __ro_after_init to cyclecounter
@ 2017-02-11 19:20 Bhumika Goyal
2017-02-11 20:31 ` Ard Biesheuvel
2017-02-11 20:35 ` Thomas Gleixner
0 siblings, 2 replies; 9+ messages in thread
From: Bhumika Goyal @ 2017-02-11 19:20 UTC (permalink / raw)
To: linux-arm-kernel
The object cyclecounter of type cyclecounter is not getting modified
after getting initialized by arch_counter_register. Apart from
initialization in arch_counter_register it is also passed as an argument
to the function timecounter_init but this argument is of type const.
Therefore, add __ro_after_init to its declaration.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/clocksource/arm_arch_timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 4c8c3fb..a10506b 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -580,7 +580,7 @@ static u64 arch_counter_read_cc(const struct cyclecounter *cc)
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
-static struct cyclecounter cyclecounter = {
+static struct cyclecounter cyclecounter __ro_after_init = {
.read = arch_counter_read_cc,
.mask = CLOCKSOURCE_MASK(56),
};
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] clocksource: add __ro_after_init to cyclecounter
2017-02-11 19:20 [PATCH] clocksource: add __ro_after_init to cyclecounter Bhumika Goyal
@ 2017-02-11 20:31 ` Ard Biesheuvel
2017-02-11 20:36 ` Thomas Gleixner
2017-02-12 18:20 ` Bhumika Goyal
2017-02-11 20:35 ` Thomas Gleixner
1 sibling, 2 replies; 9+ messages in thread
From: Ard Biesheuvel @ 2017-02-11 20:31 UTC (permalink / raw)
To: linux-arm-kernel
On 11 February 2017 at 19:20, Bhumika Goyal <bhumirks@gmail.com> wrote:
> The object cyclecounter of type cyclecounter is not getting modified
> after getting initialized by arch_counter_register. Apart from
> initialization in arch_counter_register it is also passed as an argument
> to the function timecounter_init but this argument is of type const.
> Therefore, add __ro_after_init to its declaration.
>
I think adding __ro_after_init is fine if this struct is never
modified after init. But the reference in the commit log to the
constness of the timecounter_init() argument makes no sense: that
only means timecounter_init() will not modify the object, which allows
pointers to const objects to be passed to it as well. The opposite is
not true, though: there is no requirement whatsoever that objects
passed into const pointer arguments should be const themselves.
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> drivers/clocksource/arm_arch_timer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index 4c8c3fb..a10506b 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -580,7 +580,7 @@ static u64 arch_counter_read_cc(const struct cyclecounter *cc)
> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> };
>
> -static struct cyclecounter cyclecounter = {
> +static struct cyclecounter cyclecounter __ro_after_init = {
> .read = arch_counter_read_cc,
> .mask = CLOCKSOURCE_MASK(56),
> };
> --
> 1.9.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] clocksource: add __ro_after_init to cyclecounter
2017-02-11 19:20 [PATCH] clocksource: add __ro_after_init to cyclecounter Bhumika Goyal
2017-02-11 20:31 ` Ard Biesheuvel
@ 2017-02-11 20:35 ` Thomas Gleixner
2017-02-12 18:21 ` Bhumika Goyal
1 sibling, 1 reply; 9+ messages in thread
From: Thomas Gleixner @ 2017-02-11 20:35 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, 12 Feb 2017, Bhumika Goyal wrote:
Please be more careful with your subject line. The prefix for this is
definitely not 'clocksource'. git log would have told you the proper one:
clocksource/drivers/arm_arch_timer
'clocksource' is the general subsystem and used for system wide changes or
core changes, but not for a particular driver.
> The object cyclecounter of type cyclecounter is not getting modified
> after getting initialized by arch_counter_register. Apart from
> initialization in arch_counter_register it is also passed as an argument
> to the function timecounter_init but this argument is of type const.
> Therefore, add __ro_after_init to its declaration.
Other than that this is fine. I'll fix it up when applying.
Thanks,
tglx
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] clocksource: add __ro_after_init to cyclecounter
2017-02-11 20:31 ` Ard Biesheuvel
@ 2017-02-11 20:36 ` Thomas Gleixner
2017-02-12 18:20 ` Bhumika Goyal
1 sibling, 0 replies; 9+ messages in thread
From: Thomas Gleixner @ 2017-02-11 20:36 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, 11 Feb 2017, Ard Biesheuvel wrote:
> On 11 February 2017 at 19:20, Bhumika Goyal <bhumirks@gmail.com> wrote:
> > The object cyclecounter of type cyclecounter is not getting modified
> > after getting initialized by arch_counter_register. Apart from
> > initialization in arch_counter_register it is also passed as an argument
> > to the function timecounter_init but this argument is of type const.
> > Therefore, add __ro_after_init to its declaration.
> >
>
> I think adding __ro_after_init is fine if this struct is never
> modified after init. But the reference in the commit log to the
> constness of the timecounter_init() argument makes no sense: that
> only means timecounter_init() will not modify the object, which allows
> pointers to const objects to be passed to it as well. The opposite is
> not true, though: there is no requirement whatsoever that objects
> passed into const pointer arguments should be const themselves.
Indeed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] clocksource: add __ro_after_init to cyclecounter
2017-02-11 20:31 ` Ard Biesheuvel
2017-02-11 20:36 ` Thomas Gleixner
@ 2017-02-12 18:20 ` Bhumika Goyal
2017-02-12 18:56 ` Thomas Gleixner
1 sibling, 1 reply; 9+ messages in thread
From: Bhumika Goyal @ 2017-02-12 18:20 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Feb 12, 2017 at 2:01 AM, Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
> On 11 February 2017 at 19:20, Bhumika Goyal <bhumirks@gmail.com> wrote:
>> The object cyclecounter of type cyclecounter is not getting modified
>> after getting initialized by arch_counter_register. Apart from
>> initialization in arch_counter_register it is also passed as an argument
>> to the function timecounter_init but this argument is of type const.
>> Therefore, add __ro_after_init to its declaration.
>>
>
> I think adding __ro_after_init is fine if this struct is never
> modified after init. But the reference in the commit log to the
> constness of the timecounter_init() argument makes no sense: that
> only means timecounter_init() will not modify the object, which allows
> pointers to const objects to be passed to it as well. The opposite is
> not true, though: there is no requirement whatsoever that objects
> passed into const pointer arguments should be const themselves.
>
>
Yes, true. I will change the commit log and send a v2. Thanks for explaining.
Thanks,
Bhumika
>> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
>> ---
>> drivers/clocksource/arm_arch_timer.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
>> index 4c8c3fb..a10506b 100644
>> --- a/drivers/clocksource/arm_arch_timer.c
>> +++ b/drivers/clocksource/arm_arch_timer.c
>> @@ -580,7 +580,7 @@ static u64 arch_counter_read_cc(const struct cyclecounter *cc)
>> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
>> };
>>
>> -static struct cyclecounter cyclecounter = {
>> +static struct cyclecounter cyclecounter __ro_after_init = {
>> .read = arch_counter_read_cc,
>> .mask = CLOCKSOURCE_MASK(56),
>> };
>> --
>> 1.9.1
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] clocksource: add __ro_after_init to cyclecounter
2017-02-11 20:35 ` Thomas Gleixner
@ 2017-02-12 18:21 ` Bhumika Goyal
0 siblings, 0 replies; 9+ messages in thread
From: Bhumika Goyal @ 2017-02-12 18:21 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Feb 12, 2017 at 2:05 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Sun, 12 Feb 2017, Bhumika Goyal wrote:
>
> Please be more careful with your subject line. The prefix for this is
> definitely not 'clocksource'. git log would have told you the proper one:
>
> clocksource/drivers/arm_arch_timer
>
> 'clocksource' is the general subsystem and used for system wide changes or
> core changes, but not for a particular driver.
>
I will be more careful about this in future.
Thanks,
Bhumika
>> The object cyclecounter of type cyclecounter is not getting modified
>> after getting initialized by arch_counter_register. Apart from
>> initialization in arch_counter_register it is also passed as an argument
>> to the function timecounter_init but this argument is of type const.
>> Therefore, add __ro_after_init to its declaration.
>
> Other than that this is fine. I'll fix it up when applying.
>
> Thanks,
>
> tglx
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] clocksource: add __ro_after_init to cyclecounter
2017-02-12 18:20 ` Bhumika Goyal
@ 2017-02-12 18:56 ` Thomas Gleixner
2017-02-12 19:00 ` Bhumika Goyal
2017-02-12 20:07 ` Daniel Lezcano
0 siblings, 2 replies; 9+ messages in thread
From: Thomas Gleixner @ 2017-02-12 18:56 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, 12 Feb 2017, Bhumika Goyal wrote:
> On Sun, Feb 12, 2017 at 2:01 AM, Ard Biesheuvel
> <ard.biesheuvel@linaro.org> wrote:
> > On 11 February 2017 at 19:20, Bhumika Goyal <bhumirks@gmail.com> wrote:
> >> The object cyclecounter of type cyclecounter is not getting modified
> >> after getting initialized by arch_counter_register. Apart from
> >> initialization in arch_counter_register it is also passed as an argument
> >> to the function timecounter_init but this argument is of type const.
> >> Therefore, add __ro_after_init to its declaration.
> >>
> >
> > I think adding __ro_after_init is fine if this struct is never
> > modified after init. But the reference in the commit log to the
> > constness of the timecounter_init() argument makes no sense: that
> > only means timecounter_init() will not modify the object, which allows
> > pointers to const objects to be passed to it as well. The opposite is
> > not true, though: there is no requirement whatsoever that objects
> > passed into const pointer arguments should be const themselves.
> >
> >
>
> Yes, true. I will change the commit log and send a v2. Thanks for explaining.
I've applied it already and fixed up the subject/changelog. You should have
mail from tip-bot ...
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] clocksource: add __ro_after_init to cyclecounter
2017-02-12 18:56 ` Thomas Gleixner
@ 2017-02-12 19:00 ` Bhumika Goyal
2017-02-12 20:07 ` Daniel Lezcano
1 sibling, 0 replies; 9+ messages in thread
From: Bhumika Goyal @ 2017-02-12 19:00 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 13, 2017 at 12:26 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Sun, 12 Feb 2017, Bhumika Goyal wrote:
>
>> On Sun, Feb 12, 2017 at 2:01 AM, Ard Biesheuvel
>> <ard.biesheuvel@linaro.org> wrote:
>> > On 11 February 2017 at 19:20, Bhumika Goyal <bhumirks@gmail.com> wrote:
>> >> The object cyclecounter of type cyclecounter is not getting modified
>> >> after getting initialized by arch_counter_register. Apart from
>> >> initialization in arch_counter_register it is also passed as an argument
>> >> to the function timecounter_init but this argument is of type const.
>> >> Therefore, add __ro_after_init to its declaration.
>> >>
>> >
>> > I think adding __ro_after_init is fine if this struct is never
>> > modified after init. But the reference in the commit log to the
>> > constness of the timecounter_init() argument makes no sense: that
>> > only means timecounter_init() will not modify the object, which allows
>> > pointers to const objects to be passed to it as well. The opposite is
>> > not true, though: there is no requirement whatsoever that objects
>> > passed into const pointer arguments should be const themselves.
>> >
>> >
>>
>> Yes, true. I will change the commit log and send a v2. Thanks for explaining.
>
> I've applied it already and fixed up the subject/changelog. You should have
> mail from tip-bot ...
Okay. Thanks. I thought the patch is not applied yet because I haven't
received a mail from tip-bot yet.
Thanks,
Bhumika
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] clocksource: add __ro_after_init to cyclecounter
2017-02-12 18:56 ` Thomas Gleixner
2017-02-12 19:00 ` Bhumika Goyal
@ 2017-02-12 20:07 ` Daniel Lezcano
1 sibling, 0 replies; 9+ messages in thread
From: Daniel Lezcano @ 2017-02-12 20:07 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Feb 12, 2017 at 07:56:41PM +0100, Thomas Gleixner wrote:
[ ... ]
> I've applied it already and fixed up the subject/changelog. You should have
> mail from tip-bot ...
For the record, I did not receive the mails from the tip-bot when the patches
from the PR were applied.
-- 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
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-02-12 20:07 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-11 19:20 [PATCH] clocksource: add __ro_after_init to cyclecounter Bhumika Goyal
2017-02-11 20:31 ` Ard Biesheuvel
2017-02-11 20:36 ` Thomas Gleixner
2017-02-12 18:20 ` Bhumika Goyal
2017-02-12 18:56 ` Thomas Gleixner
2017-02-12 19:00 ` Bhumika Goyal
2017-02-12 20:07 ` Daniel Lezcano
2017-02-11 20:35 ` Thomas Gleixner
2017-02-12 18:21 ` Bhumika Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox