On 26 May 2014 11:57, Preeti U Murthy preeti@linux.vnet.ibm.com wrote:
Ok in that case you must be returning an error in clockevent_set_mode() right? You currently just return. clockevent_set_mode() should be made to return an integer type to signify that setting clock modes will fail. Handling of these errors at the call site can be done in the next patchset when ONESHOT_STOPPED mode is introduced.
I had that earlier in my patches earlier and it looked irrelevant there and I decided to move that to the ONESHOT_STOPPED patchset. As returning an error wouldn't be useful with this patchset alone (Callers aren't handling it yet)...
The same goes for clockevents_update_freq(). On warning, we need to return an error code. This will ensure that this patchset is complete in itself. As of now since none of the modes are expected to fail, the call sites needn't handle the return value of clockevents_set_mode() and clockevents_update_freq().
In update_freq() we must never fail as all we are doing is setting a valid mode. So, we don't need to return an error even (to make it complex for call sites..)
I wasn't sure if WARN_ON() is the right thing to do here or we should rather have a BUG_ON() :) ..