Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3031577imj; Mon, 11 Feb 2019 12:37:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IaH9swAMrrhNhB8ejiIZfCkO3qrRYv8zUOhExclDZ+OUhIcYoo8TIeAoeod9GdVpQwmuyh1 X-Received: by 2002:a17:902:e3:: with SMTP id a90mr127934pla.82.1549917445197; Mon, 11 Feb 2019 12:37:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549917445; cv=none; d=google.com; s=arc-20160816; b=wmeAzl/NdVdmPWuG0kxFTI0b9uDf/wR6OJ7vHv/cBPXTW7cCt+0r6dICDVTdQEagHC p/Ah3TeH7KKi1xt9uut7DYp877++Y2CukIANouh6JRK0BqMvJVAhvRFveDDLoOAHz+aB Aw8Ap96l2Yfts5C0rsB5Juq3oBq19GcKZDOSrbaiZq3odyw5lK3FybRpx4GmdBXxU/Sr 2e6NSd+CuEka+fhIJnaeg3s3ZzpDvYnvW31Ts8yyOPosZYtfICoE52drL7sv423uoWlb 2kAcG1LiPq6iYLB8cANFMflurPzjisJuv2WKrnc52CXA22ANRsteQsPTzjiw0pi99wv9 Jh+A== 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=9PoBgxKT53zDlJ213wOZosVfYtiRqCb+4BXZs3fBQ9k=; b=d4aK3e+/ptqvSOV1dEsi48lusk6Ydi1K5WLHbwliIMVOiHJfRgeFvfFK6Ril0CdbIv nTuAZ+DKkGZ2U+ESLOGbfXXoo0P2LgSin7yS3AaGTQfgzmIICkU6mJ3YqiodlblnUllF ftgPPiz9ieL9FDGYRyHEVq63T0Ed5nQTDPpeQujvAVmHFBwKRpArQ+viPB48TDwJVAw7 BdWaoDgLKwEMNpEGMr9V4BIdetzlffCz5PRXiUqQgCAyHQOLMYs+ur0dzZ7/ZGBxGLbS PnuXsK5qbNUArjVRA05AEtrA0kTURzg2ebbqfUgiLnbiOxmkEC+KhrhCozUJRQ+je69x gwWQ== 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 b26si10549687pgl.539.2019.02.11.12.37.08; Mon, 11 Feb 2019 12:37:25 -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 S1731207AbfBKSEA (ORCPT + 99 others); Mon, 11 Feb 2019 13:04:00 -0500 Received: from gateway31.websitewelcome.com ([192.185.144.96]:15335 "EHLO gateway31.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727896AbfBKSD7 (ORCPT ); Mon, 11 Feb 2019 13:03:59 -0500 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 7282C179510 for ; Mon, 11 Feb 2019 12:03:58 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id tFvygdrfm4FKptFvygym6R; Mon, 11 Feb 2019 12:03:58 -0600 X-Authority-Reason: nr=8 Received: from [189.250.49.191] (port=41304 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1gtFvx-001s9Q-Mh; Mon, 11 Feb 2019 12:03:57 -0600 Date: Mon, 11 Feb 2019 12:03:56 -0600 From: "Gustavo A. R. Silva" To: Stefan Richter Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , Kees Cook Subject: [PATCH] firewire: mark expected switch fall-throughs Message-ID: <20190211180356.GA27613@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.49.191 X-Source-L: No X-Exim-ID: 1gtFvx-001s9Q-Mh X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.49.191]:41304 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 3 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: drivers/firewire/core-device.c: In function ‘set_broadcast_channel’: drivers/firewire/core-device.c:969:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (data & cpu_to_be32(1 << 31)) { ^ drivers/firewire/core-device.c:974:3: note: here case RCODE_ADDRESS_ERROR: ^~~~ drivers/firewire/core-iso.c: In function ‘manage_channel’: drivers/firewire/core-iso.c:308:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if ((data[0] & bit) == (data[1] & bit)) ^ drivers/firewire/core-iso.c:312:3: note: here default: ^~~~~~~ drivers/firewire/core-topology.c: In function ‘count_ports’: drivers/firewire/core-topology.c:69:23: warning: this statement may fall through [-Wimplicit-fallthrough=] (*child_port_count)++; ~~~~~~~~~~~~~~~~~~~^~ drivers/firewire/core-topology.c:70:3: note: here case SELFID_PORT_PARENT: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 Notice that in some cases, 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 --- drivers/firewire/core-device.c | 2 +- drivers/firewire/core-iso.c | 2 +- drivers/firewire/core-topology.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index 7c2eed76011e..0c86548fa4a7 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -970,7 +970,7 @@ static void set_broadcast_channel(struct fw_device *device, int generation) device->bc_implemented = BC_IMPLEMENTED; break; } - /* else fall through to case address error */ + /* else, fall through - to case address error */ case RCODE_ADDRESS_ERROR: device->bc_implemented = BC_UNIMPLEMENTED; } diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 35e784cffc23..7e5c98840b80 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -308,7 +308,7 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation, if ((data[0] & bit) == (data[1] & bit)) continue; - /* 1394-1995 IRM, fall through to retry. */ + /* fall through - to retry for 1394-1995 IRM */ default: if (retry) { retry--; diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c index 7db234d3fbdd..82c67e900aad 100644 --- a/drivers/firewire/core-topology.c +++ b/drivers/firewire/core-topology.c @@ -67,6 +67,7 @@ static u32 *count_ports(u32 *sid, int *total_port_count, int *child_port_count) switch (port_type) { case SELFID_PORT_CHILD: (*child_port_count)++; + /* fall through */ case SELFID_PORT_PARENT: case SELFID_PORT_NCONN: (*total_port_count)++; -- 2.20.1