public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clocksource: add __ro_after_init to cyclecounter
Date: Sat, 11 Feb 2017 21:36:21 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1702112136090.3734@nanos> (raw)
In-Reply-To: <CAKv+Gu99ZqLwzPtq1+MjvHt8BrzZDvCe=-Owy5mucsTqXSB+Qw@mail.gmail.com>

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.

  reply	other threads:[~2017-02-11 20:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=alpine.DEB.2.20.1702112136090.3734@nanos \
    --to=tglx@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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