Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp12081072ybi; Fri, 26 Jul 2019 04:29:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdc6OyGZHzqFADuBpaZiUr+EuB/Hfaf6cNlYIV3rbLVRbHW2WNfWYCRMWtmWN0rDB3YG0r X-Received: by 2002:a63:7245:: with SMTP id c5mr77306525pgn.11.1564140566740; Fri, 26 Jul 2019 04:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564140566; cv=none; d=google.com; s=arc-20160816; b=FrsKaXwe6PUgCOxQqHcz4hlt/hPy4AomDxRSWTRIASkcCuvi0GSeGFvZHr9jEO7yYn eLSylFEyPIZ2zChO6C7kkuE8PEkwX7gNk/0bwPL4p3PZ9Cg8gXg6WISVRmQR9fF/k+zO zUtVYvXVP98WGkEuSbcQAa9hqwp9vKOwZlgvVve4fvlCbmvc+vqJuxbPv7+XZftnkqnr IKTieMkpMFvcllQYi70eHvERdKFH9cmgCr7MRrPCx2xmteklUrPBTKgjJr0Dt3Dk+5GD ol2Iad/QbtbzAQ8zB8DNGBiDiarnhDMMjheMMUEx4jRSKYWWv60hWYKyUyjT2U0pPkMy CY2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WJ4oeV5ZLHJeESLEdUy9aN7H7bQ/Va6Qh1QrIFzI99g=; b=psGOjKrJiYO6TFFstAk/OQyMq7bcTtpPG20APHMghAOzQ0qM/DUPT+HewghMgYbFU3 52wEeog5FfLcmsf0Vpwo3yJqmRnJesepqUyGDIAn1XUnx/zUNgV340BCmZ+kxP9Ci6sQ cvqRVs4bO1lxvQ6X/B2KhTYIQ0phQL7jD+BmJWeMfjZ7kJfhBqPa0Qffa2WzTi9c/aBL OddDjMKal+Cda+lcwbmgH73ZxDLzQ83NxtL1MgRXmblhK+F3MnWoe1wfEABUvPvrD5Xp sMmfd1i/p4vQaKEPJOPL83/yC3vgaVEpINhKLAIcqTd2Yr/+ImeOC9E2Gm0VPnx6OGcI XqxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xG8ocYYA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w186si23262811pgd.176.2019.07.26.04.29.11; Fri, 26 Jul 2019 04:29:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xG8ocYYA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726950AbfGZL1j (ORCPT + 99 others); Fri, 26 Jul 2019 07:27:39 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:38784 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726004AbfGZL1j (ORCPT ); Fri, 26 Jul 2019 07:27:39 -0400 Received: by mail-lf1-f66.google.com with SMTP id h28so36808336lfj.5 for ; Fri, 26 Jul 2019 04:27:37 -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=WhOqkpiLNQs81EN+LjdRyNBaU7beeTxrc2PtiQ3M88E6Ur3jn4WzpkYDJ+AjlcMOSm prj2xfRssYWbmyY/aPljCHO1jIUzylwkdyUvhvR/lSM6EKEstoQfZVZdts7SBgRbW1ie 6BRC6rAL3X7egPuq+LTpZu9YDAA9lPleCfB2OAxe+7lXxk6f5Wu5OKMIejVSYz8IhSfd fRg+An3L+WUD0SpokcC5IS+vOY2599qAyQeDzW0veTcvpRqRlwHqFIYcVAQdbwxqp7Sz UheeuHPCq5M8Nx4nRhyPQL5M8h9TTJd6KdVxYjbhQ9Td+nuuLY6mDoS0bBzvKiGbPcQR LUFg== X-Gm-Message-State: APjAAAW3NbwLBuEQGtIA+GfOXAS0AFXvKG2iCuRoJpZFOAn4DRcvWKba TPVvK5+UhtV8SNFmJyUK7XmXXg== 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Anders Roxell , stable@vger.kernel.org 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.20.1