From patchwork Thu Aug 9 15:08:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 955698 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embeddedor.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41mWqt73cHz9s1x for ; Fri, 10 Aug 2018 01:09:14 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732645AbeHIReb (ORCPT ); Thu, 9 Aug 2018 13:34:31 -0400 Received: from gateway34.websitewelcome.com ([192.185.148.200]:12872 "EHLO gateway34.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732570AbeHIRea (ORCPT ); Thu, 9 Aug 2018 13:34:30 -0400 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 21B8E829C96 for ; Thu, 9 Aug 2018 10:09:10 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id nmY7fTEG9PvAdnmYWfUFsq; Thu, 09 Aug 2018 10:09:09 -0500 X-Authority-Reason: nr=8 Received: from [189.250.54.46] (port=49984 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1fnmY6-001q4T-Ei; Thu, 09 Aug 2018 10:08:26 -0500 Date: Thu, 9 Aug 2018 10:08:24 -0500 From: "Gustavo A. R. Silva" To: Richard Cochran , Andrew Lunn , Florian Fainelli , "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH net-next] net: dp83640: Mark expected switch fall-throughs Message-ID: <20180809150824.GA15116@embeddedor.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) 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.54.46 X-Source-L: No X-Exim-ID: 1fnmY6-001q4T-Ei X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.54.46]:49984 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I replaced the code comment at the top of the switch statement with a proper "fall through" annotation for each case, which is what GCC is expecting to find. Addresses-Coverity-ID: 1056542 ("Missing break in switch") Addresses-Coverity-ID: 1339579 ("Missing break in switch") Addresses-Coverity-ID: 1369526 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Acked-by: Richard Cochran --- drivers/net/phy/dp83640.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index 79e9b10..29aa8d7 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c @@ -757,13 +757,16 @@ static int decode_evnt(struct dp83640_private *dp83640, phy_txts = data; - switch (words) { /* fall through in every case */ + switch (words) { case 3: dp83640->edata.sec_hi = phy_txts->sec_hi; + /* fall through */ case 2: dp83640->edata.sec_lo = phy_txts->sec_lo; + /* fall through */ case 1: dp83640->edata.ns_hi = phy_txts->ns_hi; + /* fall through */ case 0: dp83640->edata.ns_lo = phy_txts->ns_lo; }