From patchwork Fri Dec 7 06:44:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 1009193 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43B2pT0CVDz9s3q for ; Fri, 7 Dec 2018 17:37:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43B2pS5cHxzDrfh for ; Fri, 7 Dec 2018 17:37:52 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=huawei.com (client-ip=45.249.212.35; helo=huawei.com; envelope-from=yuehaibing@huawei.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 43B2md62XJzDr0P for ; Fri, 7 Dec 2018 17:36:16 +1100 (AEDT) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id AE81F5BAE0484; Fri, 7 Dec 2018 14:36:10 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.408.0; Fri, 7 Dec 2018 14:36:04 +0800 From: YueHaibing To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Christophe Leroy Subject: [PATCH -next] powerpc/mm: drop test in pp_601 Date: Fri, 7 Dec 2018 06:44:16 +0000 Message-ID: <1544165056-52579-1-git-send-email-yuehaibing@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.org, YueHaibing , linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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/) // @@ expression e,e1; @@ * e ? e1 : e1 // Signed-off-by: YueHaibing --- 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)