Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2297884pxm; Fri, 4 Mar 2022 13:22:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFXceKclrtN20xsPzzHt857hmNllhzozgpZQusGWzHeqUfxnYuRfjNCS33hdQFWbwkvU6b X-Received: by 2002:a17:907:629a:b0:6d7:b33e:43f4 with SMTP id nd26-20020a170907629a00b006d7b33e43f4mr555862ejc.149.1646428956698; Fri, 04 Mar 2022 13:22:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646428956; cv=none; d=google.com; s=arc-20160816; b=chkFNrg3VdLliPChXBbU5dipJx+Yzm3R/iGC35A/lRN6IzuCKTbEP8OiwmE3++g1+h QCc4fmXEjbY2Cch10gYUmH4vPqyPEh9Ayu3B1wjvcmrbpqdwlHkFHwiE4jmh8mbSlHB1 rjdy1FbnkUQDOap6/Uy5/Ts4/FeOK9XE1UuWQYEEusvlqSp2ZauEPBhNmpTZ/Lb6zxEG fVbXgQWkSmjPmWI8xQRRo5yZVnyFOL/mIWtlfZG0RFI+yQEG1FZva6pSMfmEMUkyqAm8 mHUw0UwmYZMpauFZjTrlcYU/DZeZXIDy3DO0cdsLKhEGgXHa+XjgkcHOBe/A35sEK4iY Og0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:subject:cc:to :from:date; bh=IQiaZu3+seTYUEUfZFoWTFgGgBceG0qoy3OQ8ZLkYg0=; b=lVwkCsN7fYM8kki1tAC2HF0n7JyfQblZ+WTwJVt0YpccG4zDBCYu88lbKLoHOUmkPo P11dZMbWFhnyPuFmmOu+8FqvXrBFkRhd7rsANoxHP4mPq6W+fmVN1wLhCik5ZXjIItpr kLjNSHVKeqfTshVB735DL0iDQuU/2yehOQ7F08lcAw4ac7BwQegi8WsRhKWHSkBMd9vV 5lTLHRR6eKZjX3LMTi953v0or2KWKnwypKfYGPAGCFEWktdgzKaqiibO7vHMtJUzxkcq oiz1B75j7TNSosAidb/7iRWAFhgiwJ6yhjFO2zDu4M0aoUQnKD92M2bJvhHB8dxyg8Y9 yeZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p22-20020a056402045600b00412982a1c2csi3733485edw.481.2022.03.04.13.22.12; Fri, 04 Mar 2022 13:22:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229595AbiCDVOC (ORCPT + 99 others); Fri, 4 Mar 2022 16:14:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbiCDVOB (ORCPT ); Fri, 4 Mar 2022 16:14:01 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9952213CEC1; Fri, 4 Mar 2022 13:13:12 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id BDB1892009C; Fri, 4 Mar 2022 22:13:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id B6A0792009B; Fri, 4 Mar 2022 21:13:11 +0000 (GMT) Date: Fri, 4 Mar 2022 21:13:11 +0000 (GMT) From: "Maciej W. Rozycki" To: Thomas Bogendoerfer cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: Sanitise Cavium switch cases in TLB handler synthesizers Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HDRS_LCASE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It makes no sense to fall through to `break'. Therefore reorder the switch statements so as to have the Cavium cases first, followed by the default case, which improves readability and pacifies code analysis tools. No change in semantics, assembly produced is exactly the same. Reported-by: kernel test robot Signed-off-by: Maciej W. Rozycki Fixes: bc431d2153cc ("MIPS: Fix fall-through warnings for Clang") --- arch/mips/mm/tlbex.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) linux-mips-tlbex-cavium-odd-switch.diff Index: linux-macro/arch/mips/mm/tlbex.c =================================================================== --- linux-macro.orig/arch/mips/mm/tlbex.c +++ linux-macro/arch/mips/mm/tlbex.c @@ -2160,16 +2160,14 @@ static void build_r4000_tlb_load_handler uasm_i_tlbr(&p); switch (current_cpu_type()) { - default: - if (cpu_has_mips_r2_exec_hazard) { - uasm_i_ehb(&p); - fallthrough; - case CPU_CAVIUM_OCTEON: case CPU_CAVIUM_OCTEON_PLUS: case CPU_CAVIUM_OCTEON2: - break; - } + break; + default: + if (cpu_has_mips_r2_exec_hazard) + uasm_i_ehb(&p); + break; } /* Examine entrylo 0 or 1 based on ptr. */ @@ -2236,15 +2234,14 @@ static void build_r4000_tlb_load_handler uasm_i_tlbr(&p); switch (current_cpu_type()) { - default: - if (cpu_has_mips_r2_exec_hazard) { - uasm_i_ehb(&p); - case CPU_CAVIUM_OCTEON: case CPU_CAVIUM_OCTEON_PLUS: case CPU_CAVIUM_OCTEON2: - break; - } + break; + default: + if (cpu_has_mips_r2_exec_hazard) + uasm_i_ehb(&p); + break; } /* Examine entrylo 0 or 1 based on ptr. */