lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1437757256-10228-1-git-send-email-shraddha.6596@gmail.com>
Date:	Fri, 24 Jul 2015 22:30:56 +0530
From:	Shraddha Barke <shraddha.6596@...il.com>
To:	Anton Vorontsov <anton@...msg.org>,
	Colin Cross <ccross@...roid.com>,
	Kees Cook <keescook@...omium.org>,
	Tony Luck <tony.luck@...el.com>
Cc:	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	Shraddha Barke <shraddha.6596@...il.com>
Subject: [PATCH 2756/2756] Staging: acpi: Merge lines for immediate return

This patch merges two lines in a single line if immediate return is found.
This is done using Coccinelle.Semantic patch used for this is as follows:

@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
-return ret;

Signed-off-by: Shraddha Barke <shraddha.6596@...il.com>
---
 drivers/acpi/apei/erst.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 3670bba..58e1bdd 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -162,8 +162,7 @@ static int erst_exec_add_value(struct apei_exec_context *ctx,
 	if (rc)
 		return rc;
 	val += ctx->value;
-	rc = __apei_exec_write_register(entry, val);
-	return rc;
+	return __apei_exec_write_register(entry, val);
 }
 
 static int erst_exec_subtract_value(struct apei_exec_context *ctx,
@@ -176,8 +175,7 @@ static int erst_exec_subtract_value(struct apei_exec_context *ctx,
 	if (rc)
 		return rc;
 	val -= ctx->value;
-	rc = __apei_exec_write_register(entry, val);
-	return rc;
+	return __apei_exec_write_register(entry, val);
 }
 
 static int erst_exec_stall(struct apei_exec_context *ctx,
@@ -979,9 +977,7 @@ static int erst_open_pstore(struct pstore_info *psi)
 	if (erst_disable)
 		return -ENODEV;
 
-	rc = erst_get_record_id_begin(&reader_pos);
-
-	return rc;
+	return erst_get_record_id_begin(&reader_pos);
 }
 
 static int erst_close_pstore(struct pstore_info *psi)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ