[PATCH] complain when users abuse the pm_qos API by updating a request thatisn't registered yet.

From: mgross
Date: Sat May 29 2010 - 00:36:06 EST


---
kernel/pm_qos_params.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index f42d3f7..8e55bf1 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -266,6 +266,10 @@ void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
spin_unlock_irqrestore(&pm_qos_lock, flags);
if (pending_update)
update_target(pm_qos_req->pm_qos_class);
+ } else {
+ WARN(true, "pm_qos: updating an unregistered request "
+ "does nothing");
+ dump_stack();
}
}
EXPORT_SYMBOL_GPL(pm_qos_update_request);
--
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/