diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2015-03-25 16:54:43 +0530 |
---|---|---|
committer | Santosh Shukla <sshukla@mvista.com> | 2015-04-15 09:38:39 +0000 |
commit | 2f254590995c19e4404eef999353b08bd8b6cb42 (patch) | |
tree | 3472c389e1162e188307329ce373ade19d2e88ff /kernel | |
parent | 44dce63b735d3c4cdf09ba4daead3e2dff370f29 (diff) |
clocksource: Add (missing) default case for switch blocks
Many clockevent drivers are using a switch block for handling modes in their
->set_mode() callback. Some of these do not have a 'default' case and adding a
new mode in the enum clock_event_mode, starts giving warnings for these
platforms about unhandled modes.
This patch adds default cases for them.
In order to keep things simple, add these two lines to the switch blocks:
default:
break;
This can lead to different behavior for individual cases. Some of the drivers
don't do any special stuff in their ->set_mode() callback before or after the
switch blocks. And so this default case would simply return for them without any
updates to the clockevent device.
But in some cases, the clockevent device is stopped as soon as we enter the
->set_mode() callback and so it will stay stopped if we hit the default case.
The rationale behind this approach was that the default case *will never* be hit
during execution of code. All new modes (beyond RESUME) are handled with mode
specific ->set_mode_*() callbacks and ->set_mode() is never called for them. And
all modes before and including RESUME are handled by the clockevent drivers.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
[forward port to 3.18 ,
ignore these files as they doesn't exist in 3.18 kernel
- arch/mips/loongson/loongson-3/hpet.c
- arch/nios2/kernel/time.c
]
Signed-off-by: Santosh Shukla <santosh.shukla@linaro.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions