From patchwork Fri Jul 26 11:27:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 11060823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 25A391399 for ; Fri, 26 Jul 2019 11:29:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11A1D28A75 for ; Fri, 26 Jul 2019 11:29:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0289228A8C; Fri, 26 Jul 2019 11:29:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A00EA28A75 for ; Fri, 26 Jul 2019 11:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ZLt/hWi8Er3Nf1ixhfBU2/FM8hLxkjWtNXLmK9z76zo=; b=dusAQGKlkyLREU 1cE6TjW/9EcRUBo6PQlEwUDBlwwXqpJKs5dVM107ZUPimdOudhWeQkEz88fSLG222GPrHxzQSrDTU 3Y6rNVFKD58Kwf6LaZLp8hSPlS8vDRKrR2ZMZyF2jf9p8BP1cuKjPwj1skY8xjortZYRwGroUYRWR VaUpAeep4ttzTA42bG7TFxHTCpzR9+x2eU4G1IICnO/FjjAtIqIkLF5LIxvcRQ49R5Hiule9X1y2s +LfgMb8qm2HRYwM5H7m8BKVV8jTrNt7pAzqtT/gNxqdabQeoHLh7GVb4I2Nimla74wPyLxzG8WD+7 GIl3yGgsmEajnIAxHmpg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hqyPO-0002xF-0f; Fri, 26 Jul 2019 11:29:10 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hqyNu-0001p9-R3 for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2019 11:27:40 +0000 Received: by mail-lf1-x143.google.com with SMTP id c9so36798149lfh.4 for ; Fri, 26 Jul 2019 04:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WJ4oeV5ZLHJeESLEdUy9aN7H7bQ/Va6Qh1QrIFzI99g=; b=xG8ocYYAMVyrT+fps7Ci3OpR1wI6YXEKPlizWNxS60+b9FbANZFGs/wC2hhclrgCmv 55v4U/Zf+1LhEPq7LC1Y1cEQQHtwFwuUvCj5CNmzqYyzQct5/fVjkoTGnd10sSfnC5V0 Hf+hL1vZACofkVZT/824XWihTsoLfe4Thp+o/40y9kSdsqD/HUVj++MnnfFRl7qYzdvF +5ExUCQXug6wUu6+Z3l6cuXe+29DSYpXZRRB9Zrfg69tWctJwzzxCBftUTTRdBIa8MhL bg/B/cPhoW0/TOldXnTgHzrzw5FfOpbMXBFcTYGl9OaxoQgUc7kD+JzWlPamB6tU+ytk 0Kvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WJ4oeV5ZLHJeESLEdUy9aN7H7bQ/Va6Qh1QrIFzI99g=; b=EBPY9fQjWMsJ14a8J+M7q9/OJE+XuKu0qd556tA372Rj9Bc+PO5NADeoYFiwnEH5wj ++Dq6VdAw5PITR9kMdNEAWZLjNewdnMBpAEvhGHjDsbb5Nqdw1mZpuVdgpNCnyK9qNoY fM6G5rMYXG8LyGhPOnWxKSh97g3UBl6r+HAbgRmPF+bBx4d901C/sr/oAYQRR+SXE3Ec M9n8rteRQVWJB4hEYf1wV6UNDec0EA3KwgEWgMPxYmwoZq3Bu9NLshs4Th+UPYoTJlXj x1MDik8CoS/axI81+CJQpXIEegC/5azkLMvDtqt46d6qFz+jGTGGKBMRIDo1+vx2n8qs iqEw== X-Gm-Message-State: APjAAAUHwhlR7/+yA1Uu13Z7i3YwninMXvfbB4kaHWA+vqdUZp3OWI7g O00j/Onjrmhcq3+6SLvwdQd0wQ== X-Google-Smtp-Source: APXvYqy19sSMEhoiwI1rduoX5SnYPS74HR9JH6CK0bVMOr3rdq3xpST/Q6wPbjIyPh4IZqzaDa1XzA== X-Received: by 2002:ac2:518d:: with SMTP id u13mr9418914lfi.40.1564140456984; Fri, 26 Jul 2019 04:27:36 -0700 (PDT) Received: from localhost (c-243c70d5.07-21-73746f28.bbcust.telenor.se. [213.112.60.36]) by smtp.gmail.com with ESMTPSA id c1sm8257268lfh.13.2019.07.26.04.27.36 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 04:27:36 -0700 (PDT) From: Anders Roxell To: will@kernel.org, mark.rutland@arm.com Subject: [PATCH] arm: perf: Mark expected switch fall-through Date: Fri, 26 Jul 2019 13:27:32 +0200 Message-Id: <20190726112732.19257-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190726_042739_055695_A03EC5EB X-CRM114-Status: UNSURE ( 9.53 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable@vger.kernel.org, Anders Roxell , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When fall-through warnings was enabled by default, d93512ef0f0e ("Makefile: Globally enable fall-through warning"), we could see the following warnings was starting to show up. However, this was originally introduced in commit 6ee33c2712fc ("ARM: hw_breakpoint: correct and simplify alignment fixup code"). Commit d968d2b801d8 ("ARM: 7497/1: hw_breakpoint: allow single-byte watchpoints on all addresses") was written with the intent to allow single-byte watchpoints on all addresses but forgot to move 'case 1:' down below 'case 2:'. ../arch/arm/kernel/hw_breakpoint.c: In function ‘hw_breakpoint_arch_parse’: ../arch/arm/kernel/hw_breakpoint.c:609:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2) ^ ../arch/arm/kernel/hw_breakpoint.c:611:3: note: here case 3: ^~~~ ../arch/arm/kernel/hw_breakpoint.c:613:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1) ^ ../arch/arm/kernel/hw_breakpoint.c:615:3: note: here default: ^~~~~~~ Rework so 'case 1:' are next to 'case 3:' and also add '/* Fall through */' so that the compiler doesn't warn about fall-through. Cc: stable@vger.kernel.org # v3.16 Fixes: 6ee33c2712fc ("ARM: hw_breakpoint: correct and simplify alignment fixup code") Signed-off-by: Anders Roxell --- arch/arm/kernel/hw_breakpoint.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c index af8b8e15f589..c14d506969ba 100644 --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c @@ -603,15 +603,17 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, case 0: /* Aligned */ break; - case 1: case 2: /* Allow halfword watchpoints and breakpoints. */ if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2) break; + /* Fall through */ + case 1: case 3: /* Allow single byte watchpoint. */ if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1) break; + /* Fall through */ default: ret = -EINVAL; goto out;