All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: asus-wmi: Fix condition in charge_threshold_store()
@ 2019-09-02 14:38 Dan Carpenter
  2019-09-02 15:12 ` Andy Shevchenko
  2019-09-02 17:24 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-09-02 14:38 UTC (permalink / raw)
  To: kernel-janitors

This error handling is reversed so we return early.

Fixes: 84d8e80b0a36 ("platform/x86: asus-wmi: Refactor charge_threshold_store()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/platform/x86/asus-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 14467748b343..848b23764fc3 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -2068,7 +2068,7 @@ static ssize_t charge_threshold_store(struct device *dev,
 		return -EINVAL;
 
 	ret = asus_wmi_set_devstate(ASUS_WMI_CHARGE_THRESHOLD, value, &rv);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (rv != 1)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-02 17:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-02 14:38 [PATCH] platform/x86: asus-wmi: Fix condition in charge_threshold_store() Dan Carpenter
2019-09-02 15:12 ` Andy Shevchenko
2019-09-02 17:24 ` Dan Carpenter

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.