Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2180978pxb; Sat, 21 Nov 2020 11:52:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOmpRYqsXTzrY00eFvZXgGVT5Jtib0/PlacC4ajehmMSSIbZVZmCyml/2VwzI6RqJ8vZTS X-Received: by 2002:aa7:d607:: with SMTP id c7mr39871602edr.70.1605988320861; Sat, 21 Nov 2020 11:52:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605988320; cv=none; d=google.com; s=arc-20160816; b=h1Wr2ADoGIjb0DdlaOteetpuamLQMmUSqvi0xJ/1fxBbNxWVq9IlOS19XYBgxyYvsr fqFY8/BYt2ttpjIVsN3Q/TCSODThYBREL2IQk0wanh9AZ87DEqUPfNics2Hcp59bYSG9 JAVH2iyKEdfKsYaUKVZC0KA9TOA9O/Y5mQ37HE/wOZOyBvCNns2jqy83S0X8DGfNeuFE 44egTIhRFtlX1YzLPKllaM/RoNghcGN/rLeG6x7J6op0P50K2r8VZlvpiAQ5n44IgtO/ 4usfxwClTs70RaRFFOUuGZHaaJIxuPMQdEZYofksHipVOkYHowI49RG7/8iNZNT2RF+N xHyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=7bS+FHmzxcLT8AXrm3x0cRVj2W7eiBc1JVfqQMRrW4Y=; b=OxOvx3SGn5EWHgyoYWPAIH1cxwlmwfg3aTeyLNEMLti2iTQT/jEOoYpyK1sq/Aq+mS Vf3Qca06Nt94ZDEEkRUB2D2ZPNNCro+2/1tWcS8cWMdhmI5TyxywlpwspYqCyRF45GMY FRGBKRXbVf5vKpar9Rqd1o1Yp43DUQEIMOMIAEVFHa7thhsfn4tl1PuT9hcpxWYYdaq9 iXlBu0OjBfS6RVxBWenBaOKbAVHyXx4GG5UZSi2Pq6y+J6wxwnArCJAgbftHevEaMDMe 0A1BLg2hkv/XTane2EeGx3CKapqI08G3WIL+xZ8BqrcXYFbch0TbmbaNteUzE9KW8cge ve/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si3988052eds.446.2020.11.21.11.51.37; Sat, 21 Nov 2020 11:52:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728505AbgKUTuX (ORCPT + 99 others); Sat, 21 Nov 2020 14:50:23 -0500 Received: from smtprelay0079.hostedemail.com ([216.40.44.79]:56188 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728402AbgKUTuW (ORCPT ); Sat, 21 Nov 2020 14:50:22 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 9CD14127B; Sat, 21 Nov 2020 19:50:20 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1801:2393:2525:2560:2563:2682:2685:2828:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:7903:9025:10004:10400:10848:11026:11232:11233:11657:11658:11783:11914:12043:12048:12297:12438:12679:12740:12895:13069:13311:13357:13439:13894:14181:14659:14721:21080:21451:21627:21939:30012:30046:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:102,LUA_SUMMARY:none X-HE-Tag: knee97_180892727356 X-Filterd-Recvd-Size: 2999 Received: from XPS-9350.home (unknown [47.151.128.180]) (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA; Sat, 21 Nov 2020 19:50:18 +0000 (UTC) Message-ID: Subject: Re: [PATCH 072/141] can: peak_usb: Fix fall-through warnings for Clang From: Joe Perches To: Marc Kleine-Budde , "Gustavo A. R. Silva" , Wolfgang Grandegger , "David S. Miller" , Jakub Kicinski Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Date: Sat, 21 Nov 2020 11:50:17 -0800 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2020-11-21 at 14:17 +0100, Marc Kleine-Budde wrote: > On 11/20/20 7:34 PM, Gustavo A. R. Silva wrote: > > In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning > > by explicitly adding a break statement instead of letting the code fall > > through to the next case. > > > > Link: https://github.com/KSPP/linux/issues/115 > > Signed-off-by: Gustavo A. R. Silva [] > > diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c [] > > @@ -299,6 +299,8 @@ static void peak_usb_write_bulk_callback(struct urb *urb) > > ? if (net_ratelimit()) > > ? netdev_err(netdev, "Tx urb aborted (%d)\n", > > ? urb->status); > > + break; > > + > > ? case -EPROTO: > > ? case -ENOENT: > > ? case -ECONNRESET: > > > > What about moving the default to the end if the case, which is more common anyways: > > diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c [] > @@ -295,16 +295,16 @@ static void peak_usb_write_bulk_callback(struct urb *urb) > ????????????????netif_trans_update(netdev); > ????????????????break; > ? > > - default: > - if (net_ratelimit()) > - netdev_err(netdev, "Tx urb aborted (%d)\n", > - urb->status); > ????????case -EPROTO: > ????????case -ENOENT: > ????????case -ECONNRESET: > ????????case -ESHUTDOWN: > - > ????????????????break; > + > + default: > + if (net_ratelimit()) > + netdev_err(netdev, "Tx urb aborted (%d)\n", > + urb->status); That's fine and is more generally used style but this default: case should IMO also end with a break; + break; > ????????}