Messages in this thread | | | Date | Sat, 10 May 2014 13:01:15 +0200 (CEST) | From | Thomas Gleixner <> | 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
| |