From patchwork Fri Jul 26 11:27:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 11060807 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 CA6C71399 for ; Fri, 26 Jul 2019 11:27:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B98FC28A75 for ; Fri, 26 Jul 2019 11:27:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD59D28A8C; Fri, 26 Jul 2019 11:27:55 +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 5A71E28A75 for ; Fri, 26 Jul 2019 11:27:55 +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=Jq1zAEB12aWUTbd0aSpvAgShcGbYXGB8reV5xpoasmc=; b=HsH1Dg0bMaL9aV 5CUsLmgD0f9mWYrqkmwxB/FF6cyE9io6LSTN/IO1b75NPpyPPsYVPc2iqy4dJOgX9LzAKsQ79Vo82 ZUAHOnbwvV4NDZV7DB+KEjKym0JZ9VD/3KJtXCkvM4ag9iBH23W65+U28b5JJS6LNB7etuhRZ7Xrx QsjUmKReOdaecuCqU+ilazqZH7BbHejPWimYN2Q6/1ZApTgc71oKhB/ymAqo6UjGSo+dA423cbw6d DxZKpbuMIonY6xkdveRGMpI1w4No/Z7iotEDGdMNmOBuPcPuIPnmdifqv9k/tUGk5wIJuevfTkCEI fuVi5snZilw6MntWjB1g==; 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 1hqyOA-00022p-Hc; Fri, 26 Jul 2019 11:27:54 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hqyNg-0001cE-1b for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2019 11:27:25 +0000 Received: by mail-lf1-x144.google.com with SMTP id x3so36943416lfc.0 for ; Fri, 26 Jul 2019 04:27:22 -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=g0nLERSg4u07PeLcbnJNifTNV6Ww1N/l/brHYj7jzWs=; b=tEZoMFkZNgKAf/ALc17jFdnG9AJ4QvVybihHJF/c2D6S8n5SsN+L+0XjTStbuw6X3M bhiLIFDVRKQDJwMjvY2YSPQW6Z18SiYmYS/N8UJts90hythAR+0+zfg+jIGnVVW2J+rP 8qs/GJBVLpPG9EnfUtu3StUmEO0+4fVONMAQaypVDPNuMax6SLKkNRDcIq3OFdqbtPzf Bzga0dDpWlbFfGCELpmpkhKsiNExxgIJHjumwcK/j5zDry2aUVodOsIv/Y0GsUrnIZOY dk6ZmzAJmE/wTwCzcPDS8Gbt0fcwWyQ/djnGDjygEEDWDm/NHJI6XyPIxmmU41YyBfip K++A== 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=g0nLERSg4u07PeLcbnJNifTNV6Ww1N/l/brHYj7jzWs=; b=IXmF9+LICmPFGXwOaW9aIYpFTxkFulToi30H6ZmVVnp+Q5a76GhLrj5QXAEOXQUwb+ v7AdMRn8czv1qZXW+dwbxZOYaLJP8akIqXnR7/3GKACY6Ye/vURjHXoxaLJDpIy+yoZi gtc4CYYDrfmq3ywgRaMGoYswx/3bA3eqeTZPsuujBngc4nVq+UHGQyLoP7/321LUj9gV zDIYrUK7kFOjxu9V5n25mBrrJixVV2dTXKfk7Q5a4N+nLYFohga+1L9HzhGBPVJYvSxd l3SwWj0uAcSjfvxBdDZztwTlQ/U/JRFqcai/pa46kjBm3k6pddKhSvMBl9S9NWgGT6iB P0LA== X-Gm-Message-State: APjAAAVWnCncHPtZev1j8hJLwQ5krbvpr+ixkOTRm+XZGoaseIY89qH4 rGowT7xsNLKvJivE8bygWcDDdA== X-Google-Smtp-Source: APXvYqzA4M9X20guHIBIplEQvEBB6Y95fjhGaemXWIsOmXfspEG/yh8Z8jnFK4oopjvXljlNC+Uf6w== X-Received: by 2002:a19:234c:: with SMTP id j73mr1078425lfj.96.1564140441031; Fri, 26 Jul 2019 04:27:21 -0700 (PDT) Received: from localhost (c-243c70d5.07-21-73746f28.bbcust.telenor.se. [213.112.60.36]) by smtp.gmail.com with ESMTPSA id l22sm9910671ljc.4.2019.07.26.04.27.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 04:27:20 -0700 (PDT) From: Anders Roxell To: will@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com Subject: [PATCH 1/3] arm64: perf: Mark expected switch fall-through Date: Fri, 26 Jul 2019 13:27:16 +0200 Message-Id: <20190726112716.19104-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_042724_160172_320303E9 X-CRM114-Status: GOOD ( 10.68 ) 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, commit d93512ef0f0e ("Makefile: Globally enable fall-through warning"), the following warnings was starting to show up: ../arch/arm64/kernel/hw_breakpoint.c: In function ‘hw_breakpoint_arch_parse’: ../arch/arm64/kernel/hw_breakpoint.c:540:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1) ^ ../arch/arm64/kernel/hw_breakpoint.c:542:3: note: here case 2: ^~~~ ../arch/arm64/kernel/hw_breakpoint.c:544:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2) ^ ../arch/arm64/kernel/hw_breakpoint.c:546:3: note: here default: ^~~~~~~ Rework so that the compiler doesn't warn about fall-through. Rework so the code looks like the arm code. Since the comment in the function indicates taht this is supposed to behave the same way as arm32 because it handles 32-bit tasks also. Cc: stable@vger.kernel.org # v3.16+ Fixes: 6ee33c2712fc ("ARM: hw_breakpoint: correct and simplify alignment fixup code") Signed-off-by: Anders Roxell Acked-by: Mark Rutland --- arch/arm64/kernel/hw_breakpoint.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c index dceb84520948..ea616adf1cf1 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c @@ -535,14 +535,17 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, case 0: /* Aligned */ break; - case 1: - /* Allow single byte watchpoint. */ - if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1) - break; 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: return -EINVAL; }