[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1405101256430.6261@ionos.tec.linutronix.de>
Date: Sat, 10 May 2014 13:01:15 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Viresh Kumar <viresh.kumar@...aro.org>
cc: linaro-kernel@...ts.linaro.org, linux-kernel@...r.kernel.org,
fweisbec@...il.com, arvind.chauhan@....com,
preeti@...ux.vnet.ibm.com, khilman@...aro.org
Subject: Re: [PATCH 2/2] tick: SHUTDOWN event-dev if no events are required
for KTIME_MAX
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
--
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