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: <4BE2C5D5.2050207@redflag-linux.com>
Date:	Thu, 06 May 2010 21:36:21 +0800
From:	"潘卫平(Peter Pan)" <wppan@...flag-linux.com>
To:	tj@...nel.org, Christoph Lameter <cl@...ux-foundation.org>,
	hch@....de, akpm@...ux-foundation.org, adilger@....com
CC:	linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: [PATCH] ext2/ext3:useless code for return value


When rsv is the right hand side of goal, we should return NULL,
because now rsv's prev is NULL, or we return rsv.

Signed-off-by: Peter Pan(潘卫平) <wppan@...flag-linux.com>

---
 fs/ext2/balloc.c |    6 +-----
 fs/ext3/balloc.c |    6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index 3cf038c..023990f 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -323,11 +323,7 @@ search_reserve_window(struct rb_root *root,
ext2_fsblk_t goal)
 	 * side of the interval containing the goal.  If it's the RHS,
 	 * we need to back up one.
 	 */
-	if (rsv->rsv_start > goal) {
-		n = rb_prev(&rsv->rsv_node);
-		rsv = rb_entry(n, struct ext2_reserve_window_node, rsv_node);
-	}
-	return rsv;
+    return (rsv->rsv_start < goal) ? rsv : NULL;
 }

 /*
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index a177122..bfa62e9 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -310,11 +310,7 @@ search_reserve_window(struct rb_root *root,
ext3_fsblk_t goal)
 	 * side of the interval containing the goal.  If it's the RHS,
 	 * we need to back up one.
 	 */
-	if (rsv->rsv_start > goal) {
-		n = rb_prev(&rsv->rsv_node);
-		rsv = rb_entry(n, struct ext3_reserve_window_node, rsv_node);
-	}
-	return rsv;
+    return (rsv->rsv_start < goal) ? rsv : NULL;
 }

 /**
-- 
1.6.6


-- 
Peter Pan(潘卫平)
Red Flag Software Co.,Ltd
--
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