[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1544165056-52579-1-git-send-email-yuehaibing@huawei.com>
Date: Fri, 7 Dec 2018 06:44:16 +0000
From: YueHaibing <yuehaibing@...wei.com>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Christophe Leroy <christophe.leroy@....fr>
CC: YueHaibing <yuehaibing@...wei.com>,
<linuxppc-dev@...ts.ozlabs.org>, <linux-kernel@...r.kernel.org>,
<kernel-janitors@...r.kernel.org>
Subject: [PATCH -next] powerpc/mm: drop test in pp_601
The test selects between two identical values, so it doesn't look useful.
It turns out that the tested expression can only be true anyway, so drop
the test, the corresponding parameter, and the corresponding argument at
the only call site.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e,e1;
@@
* e ? e1 : e1
// </smpl>
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
arch/powerpc/mm/dump_bats.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/mm/dump_bats.c b/arch/powerpc/mm/dump_bats.c
index a0d23e9..33450a8 100644
--- a/arch/powerpc/mm/dump_bats.c
+++ b/arch/powerpc/mm/dump_bats.c
@@ -17,8 +17,8 @@ static char *pp_601(int k, int pp)
if (pp == 1)
return k ? "ROX" : "RWX";
if (pp == 2)
- return k ? "RWX" : "RWX";
- return k ? "ROX" : "ROX";
+ return "RWX";
+ return "ROX";
}
static void bat_show_601(struct seq_file *m, int idx, u32 lower, u32 upper)
Powered by blists - more mailing lists