diff options
author | Quentin Lambert <lambert.quentin@gmail.com> | 2015-02-09 10:45:32 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-02-12 02:00:52 +0100 |
commit | 59d84ca8c46a93ad62f9129458e897e7fe5075de (patch) | |
tree | 9476854453199ad93851f272ab2acf5bbee7b147 /drivers/base/power/opp.c | |
parent | 04bf1c7f76b05be8134a833ec023f1c96f81b8a1 (diff) | |
download | linux-59d84ca8c46a93ad62f9129458e897e7fe5075de.tar.bz2 |
PM / OPP / clk: Remove unnecessary OOM message
This patch reduces the kernel size by removing error messages that duplicate
the normal OOM message.
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr)
@@
identifier f,print,l;
expression e;
constant char[] c;
@@
e = \(kzalloc\|kmalloc\|devm_kzalloc\|devm_kmalloc\)(...);
if (e == NULL) {
<+...
- print(...,c,...);
... when any
(
goto l;
|
return ...;
)
...+> }
Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/power/opp.c')
-rw-r--r-- | drivers/base/power/opp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 15bf29974c31..677fb2843553 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -474,10 +474,8 @@ static int _opp_add_dynamic(struct device *dev, unsigned long freq, /* allocate new OPP node */ new_opp = kzalloc(sizeof(*new_opp), GFP_KERNEL); - if (!new_opp) { - dev_warn(dev, "%s: Unable to create new OPP node\n", __func__); + if (!new_opp) return -ENOMEM; - } /* Hold our list modification lock here */ mutex_lock(&dev_opp_list_lock); @@ -695,10 +693,8 @@ static int _opp_set_availability(struct device *dev, unsigned long freq, /* keep the node allocated */ new_opp = kmalloc(sizeof(*new_opp), GFP_KERNEL); - if (!new_opp) { - dev_warn(dev, "%s: Unable to create OPP\n", __func__); + if (!new_opp) return -ENOMEM; - } mutex_lock(&dev_opp_list_lock); |