mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 14:12:06 +00:00
PM / QoS: Properly use the WARN() macro in dev_pm_qos_add_request()
Make dev_pm_qos_add_request() use WARN() in a better way and do not hardcode the function's name into the message (use __func__ instead). Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
This commit is contained in:
parent
24050956e0
commit
af4c720efc
@ -212,11 +212,9 @@ int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
|
||||
if (!dev || !req) /*guard against callers passing in null */
|
||||
return -EINVAL;
|
||||
|
||||
if (dev_pm_qos_request_active(req)) {
|
||||
WARN(1, KERN_ERR "dev_pm_qos_add_request() called for already "
|
||||
"added request\n");
|
||||
if (WARN(dev_pm_qos_request_active(req),
|
||||
"%s() called for already added request\n", __func__))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
req->dev = dev;
|
||||
|
||||
@ -271,11 +269,9 @@ int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
|
||||
if (!req) /*guard against callers passing in null */
|
||||
return -EINVAL;
|
||||
|
||||
if (!dev_pm_qos_request_active(req)) {
|
||||
WARN(1, KERN_ERR "dev_pm_qos_update_request() called for "
|
||||
"unknown object\n");
|
||||
if (WARN(!dev_pm_qos_request_active(req),
|
||||
"%s() called for unknown object\n", __func__))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mutex_lock(&dev_pm_qos_mtx);
|
||||
|
||||
@ -312,11 +308,9 @@ int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
|
||||
if (!req) /*guard against callers passing in null */
|
||||
return -EINVAL;
|
||||
|
||||
if (!dev_pm_qos_request_active(req)) {
|
||||
WARN(1, KERN_ERR "dev_pm_qos_remove_request() called for "
|
||||
"unknown object\n");
|
||||
if (WARN(!dev_pm_qos_request_active(req),
|
||||
"%s() called for unknown object\n", __func__))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mutex_lock(&dev_pm_qos_mtx);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user