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>] [day] [month] [year] [list]
Message-Id: <1410106715-9573-5-git-send-email-Julia.Lawall@lip6.fr>
Date:	Sun,  7 Sep 2014 18:18:33 +0200
From:	Julia Lawall <Julia.Lawall@...6.fr>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	kernel-janitors@...r.kernel.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org,
	"Dilger, Andreas" <andreas.dilger@...el.com>,
	"Drokin, Oleg" <oleg.drokin@...el.com>,
	Peng Tao <bergwolf@...il.com>
Subject: [PATCH 5/7] staging: lustre: obdclass: expand double GOTO macros

From: Julia Lawall <Julia.Lawall@...6.fr>

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier lbl;
@@

if (...)
  GOTO(lbl,...);
+else
GOTO(lbl,...);

@@
identifier lbl;
expression e,e1,e2;
@@

if (e)
-  GOTO(lbl,e1);
-else GOTO(lbl,e2);
+  e1;
+else e2;
+goto lbl;

@@
identifier lbl1,lbl2;
expression e,e1,e2;
@@

+ e1=e2;
if (e)
-  GOTO(lbl1,e1=e2);
-GOTO(lbl2,e1=e2);
+  goto lbl1;
+goto lbl2;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>

---
 drivers/staging/lustre/lustre/obdclass/dt_object.c |    6 ++++--
 drivers/staging/lustre/lustre/obdclass/llog.c      |    5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/dt_object.c b/drivers/staging/lustre/lustre/obdclass/dt_object.c
index 130b8dd..4060173 100644
--- a/drivers/staging/lustre/lustre/obdclass/dt_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/dt_object.c
@@ -689,8 +689,10 @@ static int dt_index_page_build(const struct lu_env *env, union lu_page *lp,
 
 		if (nob < size) {
 			if (lip->lip_nr == 0)
-				GOTO(out, rc = -EINVAL);
-			GOTO(out, rc = 0);
+				rc = -EINVAL;
+			else
+				rc = 0;
+			goto out;
 		}
 
 		if ((ii->ii_flags & II_FL_NOHASH) == 0) {
diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c
index ebdc42f..1cf604d 100644
--- a/drivers/staging/lustre/lustre/obdclass/llog.c
+++ b/drivers/staging/lustre/lustre/obdclass/llog.c
@@ -336,9 +336,10 @@ repeat:
 
 			if (rec->lrh_index == 0) {
 				/* probably another rec just got added? */
+				rc = 0;
 				if (index <= loghandle->lgh_last_idx)
-					GOTO(repeat, rc = 0);
-				GOTO(out, rc = 0); /* no more records */
+					goto repeat;
+				goto out; /* no more records */
 			}
 			if (rec->lrh_len == 0 ||
 			    rec->lrh_len > LLOG_CHUNK_SIZE) {
--
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