All of lore.kernel.org
 help / color / mirror / Atom feed
From: ahaslam@baylibre.com
To: rjw@rjwysocki.net, linux-pm@vger.kernel.org
Cc: Axel Haslam <ahaslam@baylibre.com>
Subject: [PATCH 1/2] PM / QoS: Fix check for invalid request
Date: Tue, 23 Aug 2016 15:43:46 +0200	[thread overview]
Message-ID: <1471959827-19837-1-git-send-email-ahaslam@baylibre.com> (raw)

From: Axel Haslam <ahaslam@baylibre.com>

The check for a invalid request is using the "type" member
of the request pointer which is not yet set when this function
is called at the start of __dev_pm_qos_add_request.

Fix this by passing a type directly, and not the request
pointer.

Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
---
 drivers/base/power/qos.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index 7f3646e..0bd03e6 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -291,9 +291,9 @@ void dev_pm_qos_constraints_destroy(struct device *dev)
 }
 
 static bool dev_pm_qos_invalid_request(struct device *dev,
-				       struct dev_pm_qos_request *req)
+				       enum dev_pm_qos_req_type type)
 {
-	return !req || (req->type == DEV_PM_QOS_LATENCY_TOLERANCE
+	return (type == DEV_PM_QOS_LATENCY_TOLERANCE
 			&& !dev->power.set_latency_tolerance);
 }
 
@@ -303,7 +303,7 @@ static int __dev_pm_qos_add_request(struct device *dev,
 {
 	int ret = 0;
 
-	if (!dev || dev_pm_qos_invalid_request(dev, req))
+	if (!dev || !req || dev_pm_qos_invalid_request(dev, type))
 		return -EINVAL;
 
 	if (WARN(dev_pm_qos_request_active(req),
-- 
2.7.1


             reply	other threads:[~2016-08-23 13:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 13:43 ahaslam [this message]
2016-08-23 13:43 ` [PATCH 2/2] PM / QoS: Introduce per device bandwidth request PM QoS type ahaslam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471959827-19837-1-git-send-email-ahaslam@baylibre.com \
    --to=ahaslam@baylibre.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.