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: <566D35DC.6090801@emindsoft.com.cn>
Date:	Sun, 13 Dec 2015 17:09:48 +0800
From:	Chen Gang <chengang@...ndsoft.com.cn>
To:	arnd@...db.de, Andrew Morton <akpm@...ux-foundation.org>
CC:	linux-arch@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Chen Gang <gang.chen.5i5j@...il.com>, chenwei@...ndsoft.com.cn
Subject: [PATCH] include/asm-generic/pgtable.h: Remove redundant variable
 r


Return the immediate number directly.

Signed-off-by: Chen Gang <gang.chen.5i5j@...il.com>
---
 include/asm-generic/pgtable.h | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index aecf0141..069536a 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -51,12 +51,11 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
 					    pte_t *ptep)
 {
 	pte_t pte = *ptep;
-	int r = 1;
+
 	if (!pte_young(pte))
-		r = 0;
-	else
-		set_pte_at(vma->vm_mm, address, ptep, pte_mkold(pte));
-	return r;
+		return 0;
+	set_pte_at(vma->vm_mm, address, ptep, pte_mkold(pte));
+	return 1;
 }
 #endif
 
@@ -67,12 +66,11 @@ static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
 					    pmd_t *pmdp)
 {
 	pmd_t pmd = *pmdp;
-	int r = 1;
+
 	if (!pmd_young(pmd))
-		r = 0;
-	else
-		set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd));
-	return r;
+		return 0;
+	set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd));
+	return 1;
 }
 #else
 static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
-- 
1.9.3
--
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