Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2737940ybi; Sun, 28 Jul 2019 16:38:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqz38hYsv3WqiY3Opg32e05o4uHD6Fv2kf2XZAC3Zk6hrX/F4NL1IT9kdaf6N0JOnYRulzuR X-Received: by 2002:a63:f13:: with SMTP id e19mr101311828pgl.132.1564357101407; Sun, 28 Jul 2019 16:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564357101; cv=none; d=google.com; s=arc-20160816; b=Bqzd01mly0L62rIN6qxP1H/JFm8XtXiNxx+9dkUObm4h3/ruoDY5C+CI7Bh5DYNf1d BJDfl5PUaV1VSmGcnHe+ddtIk7GAaoByMxwO0OFZSxeDFwg0y3LgjRtuz2xsb9WONYbs paMFGtyHzTgaAn3LALRUSPCS2SZCPz0ZIpc2wLDvkSkdlarG9Cx0Hm7x8Salbbcf390y ilYaHoR48Of3d3ojKK8TwHpUWkszt3QqHQdYee5k33c4r/2zvqGuz9czwvknqDVA3bGO noep+n1ldCVOncfUWL8R7Xnu3QdcOmtDUQh5FwE8KMJ5XNslHwmyWi+4lp+dAY/82POQ XqPw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=gFOhRgiLCWqAtA+XK/RAuaL7jkQmglufRYbAQt84N1k=; b=lByLTOVnZ29gSjn/amLucEYCrZFEec3n0Uq1ZnPuVyRkKDvxkGKLx96wQwBNy8aGQ2 +yvtoZZWDFScP1uhCig0+ViitYxdnseIx+ajsZ1FByzonoKdwetd7fjWYUQsh3DFeNwO aUV+Qfu9BnY+OfAH+njCed3fkcfEfa/7ekzFecBQmr7aS71AmB5DXgwZaspJnHpZeh5K DAUlLt5m4HbjeU1N7qSbRSUSxvHEC5q/5y6n16l0TLaIA/mCyTSORrFEtPWafW6mPTHw 1JzPKetbTkJ02S5n2cZYpYAC4/leqz3qgLbvNJBjjoMQhlxplXY2rtJgwYWMMDy6ybax OMdQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a36si51122476pje.14.2019.07.28.16.38.03; Sun, 28 Jul 2019 16:38:21 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726217AbfG1Xhc convert rfc822-to-8bit (ORCPT + 99 others); Sun, 28 Jul 2019 19:37:32 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43460 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbfG1Xhb (ORCPT ); Sun, 28 Jul 2019 19:37:31 -0400 Received: by mail-lf1-f68.google.com with SMTP id c19so40732900lfm.10 for ; Sun, 28 Jul 2019 16:37:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=8rxfba6tlD0hwZ133j08GN9B4ltnDc1brl6g+eS6jPo=; b=eo8XsKggOCdzahQaaqWKeSuvoWhbFAlUxA3OD+8iAe8xGs3RWwCpHzIQYger2YfMty ibucUkPzH4f8n5htIk7lGo3+l1QOzE8/N5eBjoeOEWkgNh8gH7HATogpGrLQt+w55AjP 99/li4XrVL8v3oEwFW+pBHnhmuybcSivCszSeHoimGoISmg2yo+/Wj5scS5WCbkF19Pt U5d1FCE0vDe3wsD7Uz+PBTIPzzCtXqtRfBMWQ8K8CZwOcfn3dvSTR7pO05A/KF/oe4gE K+ulk+h8UXKRmwHg0C9UyA8t+qJPzbMGM+OI5RzuX3KtVR2htWygMHhURS8EdSQfSSJY AVaQ== X-Gm-Message-State: APjAAAXyIViJBMKphcAGjajRL4E4EOqN9mACusugRUz5zgyzW+D0dqgt aDV4ycr2XuMc9BGdu24UCEDZvsaoNiumVALUM5L7NQ== X-Received: by 2002:a19:48c5:: with SMTP id v188mr49040248lfa.69.1564357049901; Sun, 28 Jul 2019 16:37:29 -0700 (PDT) MIME-Version: 1.0 References: <20190728232706.7396-1-mcroce@redhat.com> <763dd408-7ac0-436c-d952-1decff5c696e@embeddedor.com> In-Reply-To: <763dd408-7ac0-436c-d952-1decff5c696e@embeddedor.com> From: Matteo Croce Date: Mon, 29 Jul 2019 01:36:53 +0200 Message-ID: Subject: Re: [PATCH] arm64: hw_breakpoint: mark expected switch fall-through To: "Gustavo A. R. Silva" Cc: Linux ARM , Mark Rutland , Catalin Marinas , Will Deacon , LKML 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 Feel free di discard the patch then. What compiler are you using? I' using gcc version 8.3.0 (Ubuntu/Linaro 8.3.0-6ubuntu1) On Mon, Jul 29, 2019 at 1:34 AM Gustavo A. R. Silva wrote: > > Hi Matteo, > > I sent a patch for this some minutes ago: > > https://lore.kernel.org/patchwork/patch/1106585/ > > It seems there are more warnings in that file than the ones you are > addressing. > > Thanks > -- > Gustavo > > On 7/28/19 6:27 PM, Matteo Croce wrote: > > Mark switch cases where we are expecting to fall through, > > fixes the following warning: > > > > CC arch/arm64/kernel/hw_breakpoint.o > > 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: > > ^~~~~~~ > > > > Signed-off-by: Matteo Croce > > --- > > arch/arm64/kernel/hw_breakpoint.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c > > index dceb84520948..7d846985b133 100644 > > --- a/arch/arm64/kernel/hw_breakpoint.c > > +++ b/arch/arm64/kernel/hw_breakpoint.c > > @@ -539,10 +539,12 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, > > /* Allow single byte watchpoint. */ > > if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1) > > break; > > + /* fallthrough */ > > case 2: > > /* Allow halfword watchpoints and breakpoints. */ > > if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2) > > break; > > + /* fallthrough */ > > default: > > return -EINVAL; > > } > > -- Matteo Croce per aspera ad upstream