All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] platform/x86: ideapad-laptop: Remove unnesscary else
@ 2017-12-02 13:45 Jiaxun Yang
  2017-12-02 13:45 ` [PATCH 2/4] platform/x86: ideapad-laptop: Use __func__ instead of write_ec_cmd in pr_err Jiaxun Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Jiaxun Yang @ 2017-12-02 13:45 UTC (permalink / raw)
  To: Ike Panhc
  Cc: Darren Hart, Andy Shevchenko, platform-driver-x86, linux-kernel,
	Roger Jargoyhen, Jiaxun Yang

To deal with checkpatch warning:
WARNING: else is not generally useful after a break or return

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 drivers/platform/x86/ideapad-laptop.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 53ab4e0f8962..9f2a4bc58df0 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -124,10 +124,10 @@ static int read_method_int(acpi_handle handle, const char *method, int *val)
 	if (ACPI_FAILURE(status)) {
 		*val = -1;
 		return -1;
-	} else {
-		*val = result;
-		return 0;
 	}
+	*val = result;
+	return 0;
+
 }
 
 static int method_gbmd(acpi_handle handle, unsigned long *ret)
@@ -164,10 +164,10 @@ static int method_vpcr(acpi_handle handle, int cmd, int *ret)
 	if (ACPI_FAILURE(status)) {
 		*ret = -1;
 		return -1;
-	} else {
-		*ret = result;
-		return 0;
 	}
+	*ret = result;
+	return 0;
+
 }
 
 static int method_vpcw(acpi_handle handle, int cmd, int data)
-- 
2.14.1

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

end of thread, other threads:[~2017-12-08 23:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-02 13:45 [PATCH 1/4] platform/x86: ideapad-laptop: Remove unnesscary else Jiaxun Yang
2017-12-02 13:45 ` [PATCH 2/4] platform/x86: ideapad-laptop: Use __func__ instead of write_ec_cmd in pr_err Jiaxun Yang
2017-12-02 13:45 ` [PATCH 3/4] platform/x86: ideapad-laptop: use kstrto instead of sscanf and do clean up Jiaxun Yang
2017-12-08 23:39   ` Darren Hart
2017-12-02 13:45 ` [PATCH 4/4] platform/x86: ideapad-laptop: add lenovo RESCUER R720-15IKBN to no_hw_rfkill_list Jiaxun Yang
2017-12-08 23:41 ` [PATCH 1/4] platform/x86: ideapad-laptop: Remove unnesscary else Darren Hart

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.