Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1577288
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH V2 1/6] PM / QOS: Add default case to the switch |
| Date | 2017-02-09 04:50 +0100 |
| Message-ID | <t8NU6-LX-13@gated-at.bofh.it> (permalink) |
| References | <t8NU6-LX-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The switch block handles all the QOS request types present today, but starts giving compilation warnings as soon as a new type is added and not handled in this. To prevent against that, add the default case as well and do a WARN from it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> --- drivers/base/power/qos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 58fcc758334e..01f615b18055 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c @@ -621,6 +621,9 @@ static void __dev_pm_qos_drop_user_request(struct device *dev, req = dev->power.qos->flags_req; dev->power.qos->flags_req = NULL; break; + default: + WARN_ON(1); + return; } __dev_pm_qos_remove_request(req); kfree(req); -- 2.7.1.410.g6faf27b
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH V2 1/6] PM / QOS: Add default case to the switch Viresh Kumar <viresh.kumar@linaro.org> - 2017-02-09 04:50 +0100
Re: [PATCH V2 1/6] PM / QOS: Add default case to the switch Pavel Machek <pavel@ucw.cz> - 2017-02-09 15:30 +0100
Re: [PATCH V2 1/6] PM / QOS: Add default case to the switch Viresh Kumar <viresh.kumar@linaro.org> - 2017-02-10 07:10 +0100
Re: [PATCH V2 1/6] PM / QOS: Add default case to the switch Pavel Machek <pavel@ucw.cz> - 2017-02-10 13:30 +0100
Re: [PATCH V2 1/6] PM / QOS: Add default case to the switch Viresh Kumar <viresh.kumar@linaro.org> - 2017-02-13 04:20 +0100
Re: [PATCH V2 1/6] PM / QOS: Add default case to the switch Pavel Machek <pavel@ucw.cz> - 2017-02-10 22:30 +0100
csiph-web