From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57D2CC433E6 for ; Mon, 31 Aug 2020 13:40:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C1902071B for ; Mon, 31 Aug 2020 13:40:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="EzcrI3fl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727872AbgHaNko (ORCPT ); Mon, 31 Aug 2020 09:40:44 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:46666 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726446AbgHaNkm (ORCPT ); Mon, 31 Aug 2020 09:40:42 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07VDZXad170145; Mon, 31 Aug 2020 13:40:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=UcZelzQz1egJztiC3oTDk5ObhFphp8EDAemUUbgfzx0=; b=EzcrI3fl/j7LAYCVchRSS8yiMf1hxzALf1nC45FgeNVpJUpwmh/VXDoGRYlvnvUgG/cW Ei3UwfEhAuhwXJuUVo6OSoNN1Z5pgkWq+rpXR4eb42haH0FLjfEDlGHujPz5F6FXhujp BsBolisY6mRw3h0OUKxUBJap/rEXh7hUhyXuNOMw2LeujcMekBpYKRRHGWbUJ+i8ba1o mT6E0YSKRguPWDqiplkM4ZHXJ9YL7MVnuVzPS5g7EaMxED9DH+hOcCCRJeQ4vKE8dHrg l1DYrmUW8QtTEKZh60OMQ800A2N4fyyimqdc32qjLeuONNgcYgruTVV/MG05tPNXWCnl MQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 337qrhdb27-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 31 Aug 2020 13:40:34 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07VDYujg030703; Mon, 31 Aug 2020 13:40:33 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 3380sq0y92-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 Aug 2020 13:40:33 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 07VDeS4Y015193; Mon, 31 Aug 2020 13:40:29 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 31 Aug 2020 06:40:28 -0700 Date: Mon, 31 Aug 2020 16:40:21 +0300 From: Dan Carpenter To: Cengiz Can Cc: "Gustavo A . R . Silva" , Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [PATCH] staging: atomisp: Fix fallthrough keyword warning Message-ID: <20200831134021.GV8299@kadam> References: <20200831133011.91258-1-cengiz@kernel.wtf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200831133011.91258-1-cengiz@kernel.wtf> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9729 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008310079 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9729 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 spamscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008310079 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 31, 2020 at 04:30:12PM +0300, Cengiz Can wrote: > commit df561f6688fe ("treewide: Use fallthrough pseudo-keyword") from > Gustavo A. R. Silva replaced and standardized /* fallthrough */ comments > with 'fallthrough' pseudo-keyword. > > However, in one of the switch-case statements, Coverity Static Analyzer > throws a warning that 'fallthrough' is unreachable due to the adjacent > 'return false' statement. > > Since 'fallthrough' is actually an empty "do {} while(0)" this might be > due to compiler optimizations. But that needs further investigation. > > In order to fix the unreachable code warning, make adjacent 'return > false' a part of the previous if statement's else clause. > > Reported-by: Coverity Static Analyzer CID 1466511 > Signed-off-by: Cengiz Can > --- > drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c > index 1b2b2c68025b..aaa2d0e0851b 100644 > --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c > +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c > @@ -709,8 +709,8 @@ static bool is_pipe_valid_to_current_run_mode(struct atomisp_sub_device *asd, > if (pipe_id == IA_CSS_PIPE_ID_CAPTURE || > pipe_id == IA_CSS_PIPE_ID_PREVIEW) > return true; > - > - return false; > + else > + return false; > fallthrough; Heh... Still unreachable, but now it has a checkpatch.pl warning as well. Just get rid of the bogus fallthrough annotation. > case ATOMISP_RUN_MODE_VIDEO: > if (!asd->continuous_mode->val) { regards, dan carpenter From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85A9DC433E6 for ; Mon, 31 Aug 2020 13:40:38 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53AFF2071B for ; Mon, 31 Aug 2020 13:40:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="EzcrI3fl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53AFF2071B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3653B85BC4; Mon, 31 Aug 2020 13:40:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m6kkclW6jtKi; Mon, 31 Aug 2020 13:40:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B31A185C1D; Mon, 31 Aug 2020 13:40:37 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id EB72B1BF302 for ; Mon, 31 Aug 2020 13:40:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E85CB85C1D for ; Mon, 31 Aug 2020 13:40:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F2NGuVYp6KBt for ; Mon, 31 Aug 2020 13:40:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 00E0385BC4 for ; Mon, 31 Aug 2020 13:40:34 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07VDZXad170145; Mon, 31 Aug 2020 13:40:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=UcZelzQz1egJztiC3oTDk5ObhFphp8EDAemUUbgfzx0=; b=EzcrI3fl/j7LAYCVchRSS8yiMf1hxzALf1nC45FgeNVpJUpwmh/VXDoGRYlvnvUgG/cW Ei3UwfEhAuhwXJuUVo6OSoNN1Z5pgkWq+rpXR4eb42haH0FLjfEDlGHujPz5F6FXhujp BsBolisY6mRw3h0OUKxUBJap/rEXh7hUhyXuNOMw2LeujcMekBpYKRRHGWbUJ+i8ba1o mT6E0YSKRguPWDqiplkM4ZHXJ9YL7MVnuVzPS5g7EaMxED9DH+hOcCCRJeQ4vKE8dHrg l1DYrmUW8QtTEKZh60OMQ800A2N4fyyimqdc32qjLeuONNgcYgruTVV/MG05tPNXWCnl MQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 337qrhdb27-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 31 Aug 2020 13:40:34 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07VDYujg030703; Mon, 31 Aug 2020 13:40:33 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 3380sq0y92-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 Aug 2020 13:40:33 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 07VDeS4Y015193; Mon, 31 Aug 2020 13:40:29 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 31 Aug 2020 06:40:28 -0700 Date: Mon, 31 Aug 2020 16:40:21 +0300 From: Dan Carpenter To: Cengiz Can Subject: Re: [PATCH] staging: atomisp: Fix fallthrough keyword warning Message-ID: <20200831134021.GV8299@kadam> References: <20200831133011.91258-1-cengiz@kernel.wtf> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200831133011.91258-1-cengiz@kernel.wtf> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9729 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008310079 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9729 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 spamscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008310079 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Mauro Carvalho Chehab , "Gustavo A . R . Silva" , linux-kernel@vger.kernel.org, Sakari Ailus , Andy Shevchenko , linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Mon, Aug 31, 2020 at 04:30:12PM +0300, Cengiz Can wrote: > commit df561f6688fe ("treewide: Use fallthrough pseudo-keyword") from > Gustavo A. R. Silva replaced and standardized /* fallthrough */ comments > with 'fallthrough' pseudo-keyword. > > However, in one of the switch-case statements, Coverity Static Analyzer > throws a warning that 'fallthrough' is unreachable due to the adjacent > 'return false' statement. > > Since 'fallthrough' is actually an empty "do {} while(0)" this might be > due to compiler optimizations. But that needs further investigation. > > In order to fix the unreachable code warning, make adjacent 'return > false' a part of the previous if statement's else clause. > > Reported-by: Coverity Static Analyzer CID 1466511 > Signed-off-by: Cengiz Can > --- > drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c > index 1b2b2c68025b..aaa2d0e0851b 100644 > --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c > +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c > @@ -709,8 +709,8 @@ static bool is_pipe_valid_to_current_run_mode(struct atomisp_sub_device *asd, > if (pipe_id == IA_CSS_PIPE_ID_CAPTURE || > pipe_id == IA_CSS_PIPE_ID_PREVIEW) > return true; > - > - return false; > + else > + return false; > fallthrough; Heh... Still unreachable, but now it has a checkpatch.pl warning as well. Just get rid of the bogus fallthrough annotation. > case ATOMISP_RUN_MODE_VIDEO: > if (!asd->continuous_mode->val) { regards, dan carpenter _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel