diff mbox

[1/4] platform/x86: ideapad-laptop: Remove unnesscary else

Message ID 20171202134534.3252-1-jiaxun.yang@flygoat.com (mailing list archive)
State Accepted, archived
Delegated to: Darren Hart
Headers show

Commit Message

Jiaxun Yang Dec. 2, 2017, 1:45 p.m. UTC
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(-)

Comments

Darren Hart Dec. 8, 2017, 11:41 p.m. UTC | #1
On Sat, Dec 02, 2017 at 09:45:31PM +0800, Jiaxun Yang wrote:
> To deal with checkpatch warning:
> WARNING: else is not generally useful after a break or return
> 

Patches 1,2, and 4 queued for testing. Thanks. See comments in 3 of 4.
diff mbox

Patch

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)