From: Dan Carpenter <dan.carpenter@oracle.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Cc: Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] regulator: max77802: precedence error in max77802_set_suspend_mode()
Date: Fri, 24 Oct 2014 08:16:46 +0000 [thread overview]
Message-ID: <20141024081646.GB11140@mwanda> (raw)
The "!" operation has higher precedence that the comparison.
Fixes: 2e0eaa1aa008 ('regulator: max77802: Add set suspend mode for BUCKs and simplify code')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/regulator/max77802.c b/drivers/regulator/max77802.c
index 5839c45..57e37fd 100644
--- a/drivers/regulator/max77802.c
+++ b/drivers/regulator/max77802.c
@@ -179,7 +179,7 @@ static int max77802_set_suspend_mode(struct regulator_dev *rdev,
* If the regulator has been disabled for suspend
* then is invalid to try setting a suspend mode.
*/
- if (!max77802->opmode[id] = MAX77802_OFF_PWRREQ) {
+ if (max77802->opmode[id] != MAX77802_OFF_PWRREQ) {
dev_warn(&rdev->dev, "%s: is disabled, mode: 0x%x not set\n",
rdev->desc->name, mode);
return 0;
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Cc: Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] regulator: max77802: precedence error in max77802_set_suspend_mode()
Date: Fri, 24 Oct 2014 11:16:46 +0300 [thread overview]
Message-ID: <20141024081646.GB11140@mwanda> (raw)
The "!" operation has higher precedence that the comparison.
Fixes: 2e0eaa1aa008 ('regulator: max77802: Add set suspend mode for BUCKs and simplify code')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/regulator/max77802.c b/drivers/regulator/max77802.c
index 5839c45..57e37fd 100644
--- a/drivers/regulator/max77802.c
+++ b/drivers/regulator/max77802.c
@@ -179,7 +179,7 @@ static int max77802_set_suspend_mode(struct regulator_dev *rdev,
* If the regulator has been disabled for suspend
* then is invalid to try setting a suspend mode.
*/
- if (!max77802->opmode[id] == MAX77802_OFF_PWRREQ) {
+ if (max77802->opmode[id] != MAX77802_OFF_PWRREQ) {
dev_warn(&rdev->dev, "%s: is disabled, mode: 0x%x not set\n",
rdev->desc->name, mode);
return 0;
next reply other threads:[~2014-10-24 8:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 8:16 Dan Carpenter [this message]
2014-10-24 8:16 ` [patch] regulator: max77802: precedence error in max77802_set_suspend_mode() Dan Carpenter
2014-10-24 9:04 ` Javier Martinez Canillas
2014-10-24 9:04 ` Javier Martinez Canillas
2014-10-27 10:45 ` [patch v2] regulator: max77802: fix a test " Dan Carpenter
2014-10-27 10:45 ` Dan Carpenter
2014-10-27 13:21 ` Javier Martinez Canillas
2014-10-27 13:21 ` Javier Martinez Canillas
2014-10-27 18:18 ` Mark Brown
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=20141024081646.GB11140@mwanda \
--to=dan.carpenter@oracle.com \
--cc=broonie@kernel.org \
--cc=javier.martinez@collabora.co.uk \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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.