[PATCH] include/asm-generic/pgtable.h: Remove redundant variable r
From: Chen Gang
Date: Sun Dec 13 2015 - 04:12:57 EST
Return the immediate number directly.
Signed-off-by: Chen Gang <gang.chen.5i5j@xxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/