On 06/04/2014 02:58 PM, Viresh Kumar wrote:
On 4 June 2014 14:51, Preeti U Murthy preeti@linux.vnet.ibm.com wrote:
-static void decrementer_set_mode(enum clock_event_mode mode, +static int decrementer_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) {
if (mode != CLOCK_EVT_MODE_ONESHOT)
int ret = 0;
switch (mode) {
default:
ret = -ENOSYS;
case CLOCK_EVT_MODE_UNUSED:
case CLOCK_EVT_MODE_SHUTDOWN:
case CLOCK_EVT_MODE_RESUME: decrementer_set_next_event(DECREMENTER_MAX, dev);
break;
case CLOCK_EVT_MODE_ONESHOT:
break;
}
return ret;
The ordering of the cases and the indentation got messed up here?
No, what looked awkward to you ?
In the above the default case comes first followed by the other cases. This will compile and run fine but this is not a conventional way of writing switch cases right?
Regards Preeti U Murthy