From: Thomas Gleixner <tglx@linutronix.de>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org,
fweisbec@gmail.com, arvind.chauhan@arm.com,
preeti@linux.vnet.ibm.com, khilman@linaro.org
Subject: Re: [PATCH 2/2] tick: SHUTDOWN event-dev if no events are required for KTIME_MAX
Date: Sat, 10 May 2014 13:01:15 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.02.1405101256430.6261@ionos.tec.linutronix.de> (raw)
In-Reply-To: <alpine.DEB.2.02.1405091728450.6261@ionos.tec.linutronix.de>
On Fri, 9 May 2014, Thomas Gleixner wrote:
> On Fri, 9 May 2014, Viresh Kumar wrote:
> So the right thing to do this is:
>
> 1A) Change the prototype of the set_mode callback to return int and
> fixup all users. Either add the missing default clause or remove
> the existing BUG()/ pr_err()/whatever handling in the existing
> default clause and return a UNIQUE error code.
>
> I know I should have done that from the very beginning, but in
> hindsight one could have done everything better.
>
> coccinelle is your friend (if you need help ask me or Julia
> Lawall). But it's going to be quite some manual work on top.
There is even a better way to do that:
1) Create a new callback set_state() which has an
int return value.
2) Make the callsites do
if (dev->set_state) {
ret = dev->set_state();
handle_return_value();
} else
dev->set_mode();
3) Convert implementations one by one to use the new callback
4) Remove the set_mode callback
5) Implement new features.
Thanks,
tglx
next prev parent reply other threads:[~2014-05-10 11:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 8:40 [PATCH 0/2] tick: NO_HZ_FULL: get rid of unnecessary interruption Viresh Kumar
2014-05-09 8:40 ` [PATCH 1/2] hrtimer: reprogram event for expires=KTIME_MAX in hrtimer_force_reprogram() Viresh Kumar
2014-05-09 10:34 ` Preeti U Murthy
2014-05-09 10:57 ` Viresh Kumar
2014-05-10 16:17 ` Preeti U Murthy
2014-05-12 5:53 ` Viresh Kumar
2014-05-13 4:57 ` Preeti U Murthy
2014-05-09 8:40 ` [PATCH 2/2] tick: SHUTDOWN event-dev if no events are required for KTIME_MAX Viresh Kumar
2014-05-09 20:09 ` Thomas Gleixner
2014-05-10 11:01 ` Thomas Gleixner [this message]
2014-05-12 7:07 ` Viresh Kumar
2014-05-12 7:39 ` Thomas Gleixner
2014-05-12 5:35 ` Viresh Kumar
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.02.1405101256430.6261@ionos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=arvind.chauhan@arm.com \
--cc=fweisbec@gmail.com \
--cc=khilman@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=preeti@linux.vnet.ibm.com \
--cc=viresh.kumar@linaro.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;
as well as URLs for NNTP newsgroup(s).