mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] clocksource/drivers/timer-of: mark timer_of_exit as __init
Date: Sun, 12 Nov 2017 23:27:43 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1711122326541.1993@nanos> (raw)
In-Reply-To: <CAK8P3a29i=4_W4Asx6b_ZJ+vCtUzdp5_WbHsAM4WaDJNNe1yuw@mail.gmail.com>

On Sun, 12 Nov 2017, Arnd Bergmann wrote:
> On Sun, Nov 12, 2017 at 10:16 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Mon, 6 Nov 2017, Arnd Bergmann wrote:
> >> The newly added function triggers a harmless Kbuild warning because
> >> of a missing annotation:
> >>
> >> WARNING: vmlinux.o(.text+0x448098): Section mismatch in reference from the function timer_of_exit() to the function .init.text:timer_clk_exit()
> >> The function timer_of_exit() references
> >> the function __init timer_clk_exit().
> >> This is often because timer_of_exit lacks a __init
> >> annotation or the annotation of timer_clk_exit is wrong.
> >>
> >> The function is only called from other __init functions, so it
> >> can safely be marked as __init as well.
> >
> > Hmm. I don't see any caller at all. From the intention of the patch I
> > assume this isn't designed for using from init functions, so we rather have
> > to remove the __init annotations from the called functions.
> >
> > Sudeep posted a patch which does that:
> >
> >  https://lkml.kernel.org/r/1509979716-10646-1-git-send-email-sudeep.holla@arm.com
> >
> > Though I rather would know whether this function is going to be used at
> > all and what the intention of this patch was.
> >
> > Benjamin????
> 
> My interpretation was that timer drivers are still supposed to be unregistered
> at module unload time, but that you might use the new timer_of_exit()
> in the failure path of whatever function calls timer_of_init() successfully
> when something fails in the next step.
> 
> Sudeep's interpretation also makes sense, I had not thought of that, but
> I now found the patch that adds a user in an init function:
> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1519644.html
> 
> It seems I guessed right and Sudeep guessed wrong (both by pure chance
> I admit). Both patches solve the problem, Sudeep's version is a little
> more robust in case we ever add a caller in an __exit function (which I
> think is currently not allowed), while mine saves a little bit of memory
> and matches the current usage better.

Right, but if the only use case is the cleanup in an error path, then the
function name is a misnomer.

Thanks,

	tglx

  reply	other threads:[~2017-11-12 22:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06 13:34 Arnd Bergmann
2017-11-12 21:16 ` Thomas Gleixner
2017-11-12 22:24   ` Arnd Bergmann
2017-11-12 22:27     ` Thomas Gleixner [this message]
2017-11-13  9:27       ` Benjamin Gaignard
2017-11-13 10:11     ` Sudeep Holla
2017-11-13 14:58       ` Daniel Lezcano
2017-11-13 15:10         ` Thomas Gleixner
2017-11-13 15:10         ` Sudeep Holla

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.1711122326541.1993@nanos \
    --to=tglx@linutronix.de \
    --cc=arnd@arndb.de \
    --cc=benjamin.gaignard@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudeep.holla@arm.com \
    /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

all inboxes | Powered by JetHome®