Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1049927yba; Thu, 4 Apr 2019 03:15:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSbp/uFYdIBf+y7f5y00bAWlmH2chUGELV502tEvJpaSOck6US/zdaRrC/FIijgZ1Pg8qX X-Received: by 2002:a17:902:bd82:: with SMTP id q2mr5479502pls.201.1554372906463; Thu, 04 Apr 2019 03:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554372906; cv=none; d=google.com; s=arc-20160816; b=TCSKjUs+K2NurMV1lYNNMv6citwedcmgRkFzl7AAnRWGMQ2l76dE17uWeONob83IuX NJ7wpK5Rr6J1gtqqZbPM+wrTeDIops7wGnskkyL/SJqAaDtOWIAqU3SDxMNx7TGCjMIf 7g1M+QD9Dl7TlVIohCebL6MVBsEoAuAeY4KdWa7feaGMzb8PyQKZXSda5atKFCwsOnaV C6PNOhdtSiqeMF0Xrm6iemcPgx5HGf+kkj87GtJPFglc/wv9VJKkJg2pcAR2pnkw+Ig3 yfrgUN2ESaMcK+rM6XbOojABwGFXkxLvlMXaxfynaxd69Szh5GQbLGCiAN4JGsvAjPEf abbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Sh1iuY3EYkCwi70YrYiIV4FQVluhuBi89y90QhrWs78=; b=1LGoO8qqu8+hpXS9otIetCkihNLq+AEznUrEFT4sqSjlqvdK0mgQoV5bzQPxHYSSlJ 97NyPWm265/GpoLh+p5zecEt+KbeLNWX7kgd9fYlU19C6r0JxEVAdAB0XIKsZWP4cSp3 senOzNfIQNheQebAjS/KN0NLct657Znb8U244b2AdU3h7luumGHimanajY3K8g4E7dYN ZP1erf0/cn85IitTsFWdRIl5uPgH9M1xEH56V1YmcrRTIjMYWlRvGaPsUVJzwOkcgWvh 38UG0wnWEiiXujl8tRkUCWHc8iCAJXjgxSpPvJcJyQGxcsdqGfeUYmi0vmrDKe+RfIj5 a/qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Frznn9LJ; 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 n12si16132953pgm.191.2019.04.04.03.14.50; Thu, 04 Apr 2019 03:15:06 -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=Frznn9LJ; 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 S1728733AbfDDKMn (ORCPT + 99 others); Thu, 4 Apr 2019 06:12:43 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44795 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbfDDKMm (ORCPT ); Thu, 4 Apr 2019 06:12:42 -0400 Received: by mail-pf1-f196.google.com with SMTP id y13so1115779pfm.11 for ; Thu, 04 Apr 2019 03:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Sh1iuY3EYkCwi70YrYiIV4FQVluhuBi89y90QhrWs78=; b=Frznn9LJ1QtmG2CHriFjDNn2lHSqyrZQqzsOlB2Ta9bw+9GMwD/WuNYU7iyYU776w0 EE9Sx9D2uu9vJo7urG81scbuxria5NgVAygY11Kkq7yLtRr3/PK9pZPUsy6RIPl3PnPA IHwodid9his3Maic11nLOvpXiw2WdDR7Iw1NWCDK9kVb/JRjMOCiZZC5yb6XWkaIdx/m tdV0+ZkJ9fF7MwLXIE/qGdeqUzzkSYYp6iR04Y7YsXdsdkieRThYpFONKCSccdd7uNxG zGix8XpivQwiXbBt+mV0QTrWDhKGVjbJWwlwLsvpzuf/u5euPehRAf1HrnbmcY2YaaBd Gu2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Sh1iuY3EYkCwi70YrYiIV4FQVluhuBi89y90QhrWs78=; b=gWz2f+7KW0XmqPyNJkeEZzr2XbqDmOC4Xtbm1FLhQxkhtZxdoDu094ngibrEDAGC25 L7DhKTXBDKMdmpHdmrZDUNSSoxTP7YAOA9MSwAw5FUStZ5zaUdpVzyyKTKJTiGhKJGGs ImIfHx1OR5rFYqy8JysXAqkN2leniVuPZiMWPatID9EtNWblsBAuSTEF7XiZdClaRRkb EHIUKv1YEUhUKkQu45AtMftVGmO0Kzl3qULQdkW6VeauIS3xvMWYOx2+F9gAmEbDETFJ 0FN9iNIPXx6rFHiPoXR7mupRlnOU5lzbMw0IeSU1U+XUuaAvHvXyldq4y9Veuc8S45hC pubg== X-Gm-Message-State: APjAAAUMayLFS3euONwSEhp4ksQlsgY/dLQLUSHL6wb/Ze2CJYuoReVC 9+Ft3tmAzY9CbMkJnR2sVO/0Rg== X-Received: by 2002:a63:7444:: with SMTP id e4mr5004312pgn.261.1554372762083; Thu, 04 Apr 2019 03:12:42 -0700 (PDT) Received: from holly.lan ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id u13sm41046518pfa.169.2019.04.04.03.12.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 03:12:41 -0700 (PDT) Date: Thu, 4 Apr 2019 17:12:36 +0700 From: Daniel Thompson To: "Gustavo A. R. Silva" Cc: Jason Wessel , kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, Kees Cook Subject: Re: [PATCH] gdbstub: mark expected switch fall-throughs Message-ID: <20190404101236.7bq5xg7evzi7zpns@holly.lan> References: <20190226191614.GA21908@embeddedor> <533203bb-2f2a-6bee-659b-4385bce90575@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <533203bb-2f2a-6bee-659b-4385bce90575@embeddedor.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 01, 2019 at 02:57:36PM -0500, Gustavo A. R. Silva wrote: > > > On 2/26/19 2:47 PM, Jason Wessel wrote: > > We'll have to fix them at some point. > > > > Acked-by: Jason Wessel > > > > Thank you, Jason. > > Friendly ping: > > Who can take this? I happy to put it in my tree (probably next week). Daniel. > > Thanks > -- > Gustavo > > > > > Cheers, > > Jason. > > > > On 2/26/19 1:16 PM, Gustavo A. R. Silva wrote: > >> In preparation to enabling -Wimplicit-fallthrough, mark switch > >> cases where we are expecting to fall through. > >> > >> This patch fixes the following warnings: > >> > >> kernel/debug/gdbstub.c: In function ‘gdb_serial_stub’: > >> kernel/debug/gdbstub.c:1031:7: warning: this statement may fall through [-Wimplicit-fallthrough=] > >>      if (remcom_in_buffer[1] == '\0') { > >>         ^ > >> kernel/debug/gdbstub.c:1036:3: note: here > >>     case 'C': /* Exception passing */ > >>     ^~~~ > >> kernel/debug/gdbstub.c:1040:7: warning: this statement may fall through [-Wimplicit-fallthrough=] > >>      if (tmp == 0) > >>         ^ > >> kernel/debug/gdbstub.c:1043:3: note: here > >>     case 'c': /* Continue packet */ > >>     ^~~~ > >> kernel/debug/gdbstub.c:1050:4: warning: this statement may fall through [-Wimplicit-fallthrough=] > >>      dbg_activate_sw_breakpoints(); > >>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > >> kernel/debug/gdbstub.c:1052:3: note: here > >>     default: > >>     ^~~~~~~ > >> > >> Warning level 3 was used: -Wimplicit-fallthrough=3 > >> > >> Notice that, in this particular case, the code comment is modified > >> in accordance with what GCC is expecting to find. > >> > >> This patch is part of the ongoing efforts to enable > >> -Wimplicit-fallthrough. > >> > >> Signed-off-by: Gustavo A. R. Silva > >> --- > >>   kernel/debug/gdbstub.c | 5 +++-- > >>   1 file changed, 3 insertions(+), 2 deletions(-) > >> > >> diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c > >> index 7510dc687c0d..9f267b8905b4 100644 > >> --- a/kernel/debug/gdbstub.c > >> +++ b/kernel/debug/gdbstub.c > >> @@ -1033,13 +1033,14 @@ int gdb_serial_stub(struct kgdb_state *ks) > >>                   return DBG_PASS_EVENT; > >>               } > >>   #endif > >> +            /* Fall through */ > >>           case 'C': /* Exception passing */ > >>               tmp = gdb_cmd_exception_pass(ks); > >>               if (tmp > 0) > >>                   goto default_handle; > >>               if (tmp == 0) > >>                   break; > >> -            /* Fall through on tmp < 0 */ > >> +            /* Fall through - on tmp < 0 */ > >>           case 'c': /* Continue packet */ > >>           case 's': /* Single step packet */ > >>               if (kgdb_contthread && kgdb_contthread != current) { > >> @@ -1048,7 +1049,7 @@ int gdb_serial_stub(struct kgdb_state *ks) > >>                   break; > >>               } > >>               dbg_activate_sw_breakpoints(); > >> -            /* Fall through to default processing */ > >> +            /* Fall through - to default processing */ > >>           default: > >>   default_handle: > >>               error = kgdb_arch_handle_exception(ks->ex_vector, > >> > >