Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp946028img; Tue, 26 Feb 2019 11:17:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IZqWpneUwaLnMC2LCNMv4aLTgl3mee41diYaqcD5PkKBwyOI2hdaJH7Rd+kXLdXOII9uR0/ X-Received: by 2002:a17:902:e711:: with SMTP id co17mr27307598plb.171.1551208638813; Tue, 26 Feb 2019 11:17:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551208638; cv=none; d=google.com; s=arc-20160816; b=rJ+mS242NxrSYp19m8KvPCIBEDoC8EeFzpi6ito+qxudjIrkcSIerK/56G4sOuaGJ6 vwa6sB/PKB+bChESJn76ib/EdmSn2BR7oqP+Cb7p3ELPipmQD35+jfQ4u6IeStwGQmTz UGw0pgML8ufOZBEUPzvfDAqdBk2zULlLYNnI6ZMP0PQUG8nGkKNLOI5ZVuqqGgTytUQ5 5QkeIjZSTEXdqWs+rE5omWBB5vA3QvBDNipwpyRGB5iG/EcVbU12TiArXTMbUMK+G+Kp /jMnFKmrTbLcAbI6P86tGPCcBh8sq8zYRtQivOM7B6INFKUFSkEmFISTd2Fa09RBCDh1 miJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date; bh=o3ZodrElt8P55G9v6krawC1RjsjTXxXJH1ECEgdzrwY=; b=j4PPaGOLECilZUx/iwJT5rTzKqmN4Lba8DyHxQbTrCK+yJidHwVVoLcg7E0zS6kitn ka8leitqTp31Cz9JurCaz3oLj9/yT3NzDXW0Yck9DO+xQP4zUbzy3qoXOd/RPeo4Pwee Ifa9h8tgFNt6p77e787VctWWGMZe0KO9yOHar6DX6AcrmmZc4tCXMuCOxZSlau9J/F3i s/trUcdXb2xd+5lOgszhjJUegsSGzV9ObOgUEhEYw0lEGrrPv1oChrI3x3gOzTMBCHMX ifW/KopxB+6E+4s1FGpYe4w+lxvOnI5tEmN0qED9vKk0ad5xbxlElSOfxFXulWwj+fhN G+Ow== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j191si12292983pge.254.2019.02.26.11.17.01; Tue, 26 Feb 2019 11:17:18 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728195AbfBZTQQ (ORCPT + 99 others); Tue, 26 Feb 2019 14:16:16 -0500 Received: from gateway24.websitewelcome.com ([192.185.51.61]:45924 "EHLO gateway24.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727196AbfBZTQQ (ORCPT ); Tue, 26 Feb 2019 14:16:16 -0500 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway24.websitewelcome.com (Postfix) with ESMTP id C7A811D8A4 for ; Tue, 26 Feb 2019 13:16:15 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id yiD9gV2XF90onyiD9gpmBc; Tue, 26 Feb 2019 13:16:15 -0600 X-Authority-Reason: nr=8 Received: from [189.250.127.169] (port=33964 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1gyiD8-003vjy-MQ; Tue, 26 Feb 2019 13:16:14 -0600 Date: Tue, 26 Feb 2019 13:16:14 -0600 From: "Gustavo A. R. Silva" To: Jason Wessel , Daniel Thompson Cc: kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , Kees Cook Subject: [PATCH] gdbstub: mark expected switch fall-throughs Message-ID: <20190226191614.GA21908@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.9.4 (2018-02-28) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.250.127.169 X-Source-L: No X-Exim-ID: 1gyiD8-003vjy-MQ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.127.169]:33964 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 9 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.21.0