From: Dan Carpenter <dan.carpenter@oracle.com>
To: Henrik Rydberg <rydberg@bitmath.org>
Cc: Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
Brad Campbell <brad@fnarfbargle.com>,
linux-hwmon@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] hwmon: (applesmc) Fix smc_sane() function
Date: Tue, 17 Nov 2020 07:24:01 +0000 [thread overview]
Message-ID: <20201117072401.GE1111239@mwanda> (raw)
This test is reversed so the function will return without sending
the APPLESMC_READ_CMD or completing the rest of the function.
Fixes: 4d64bb4ba5ec ("hwmon: (applesmc) Re-work SMC comms")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/hwmon/applesmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 79b498f816fe..289b39537683 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -227,7 +227,7 @@ static int smc_sane(void)
int ret;
ret = wait_status(0, SMC_STATUS_BUSY);
- if (!ret)
+ if (ret)
return ret;
ret = send_command(APPLESMC_READ_CMD);
if (ret)
--
2.29.2
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Henrik Rydberg <rydberg@bitmath.org>
Cc: Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
Brad Campbell <brad@fnarfbargle.com>,
linux-hwmon@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] hwmon: (applesmc) Fix smc_sane() function
Date: Tue, 17 Nov 2020 10:24:01 +0300 [thread overview]
Message-ID: <20201117072401.GE1111239@mwanda> (raw)
This test is reversed so the function will return without sending
the APPLESMC_READ_CMD or completing the rest of the function.
Fixes: 4d64bb4ba5ec ("hwmon: (applesmc) Re-work SMC comms")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/hwmon/applesmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 79b498f816fe..289b39537683 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -227,7 +227,7 @@ static int smc_sane(void)
int ret;
ret = wait_status(0, SMC_STATUS_BUSY);
- if (!ret)
+ if (ret)
return ret;
ret = send_command(APPLESMC_READ_CMD);
if (ret)
--
2.29.2
next reply other threads:[~2020-11-17 7:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-17 7:24 Dan Carpenter [this message]
2020-11-17 7:24 ` [PATCH] hwmon: (applesmc) Fix smc_sane() function Dan Carpenter
2020-11-17 9:25 ` Brad Campbell
2020-11-17 9:25 ` Brad Campbell
2020-11-17 9:58 ` Brad Campbell
2020-11-17 9:58 ` Brad Campbell
2020-11-17 14:02 ` Dan Carpenter
2020-11-17 14:02 ` Dan Carpenter
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=20201117072401.GE1111239@mwanda \
--to=dan.carpenter@oracle.com \
--cc=brad@fnarfbargle.com \
--cc=jdelvare@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=rydberg@bitmath.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.