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,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable 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 609D1C433E2 for ; Mon, 31 Aug 2020 14:35:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 220D220767 for ; Mon, 31 Aug 2020 14:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598884535; bh=tRBcPIP46PIv9mvYzx8qR3efQWkqbvGf3UbDReEJolA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=dhAgQ+MKii10ImLn15CpK05wA6kOlDddM1wS9ZX2++bz2LgcNEEupdqxBP6dKv69T yaXKjGXBC+GDlQkydSfdwtL/SzZcGrX98arN9JjPcq1BanR5iUI+Tmbo810p2F84eL KIk5MMelu+ENDovte9CE/ZZmg8shntWVK7jE8j1A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727991AbgHaOfa (ORCPT ); Mon, 31 Aug 2020 10:35:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:43868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbgHaOfV (ORCPT ); Mon, 31 Aug 2020 10:35:21 -0400 Received: from coco.lan (ip5f5ad5da.dynamic.kabel-deutschland.de [95.90.213.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62BE720767; Mon, 31 Aug 2020 14:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598884521; bh=tRBcPIP46PIv9mvYzx8qR3efQWkqbvGf3UbDReEJolA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bdLjsyhixcxLBkSG5UVO9cNWid/B3Lx3PX/Cu+N5k1lbkhpcN2NkEuhGLLeU0wWkJ ZwbY4uQoHjCbqpKuHOgg0e02obaMzfjGrascd7RQpkC7ShBXTGW/jaoEsCWUfj6W2t 2umU3WL1qZDhrhrfHVyWIFcyx5AwOSTO4GF3iSdg= Date: Mon, 31 Aug 2020 16:35:16 +0200 From: Mauro Carvalho Chehab To: Cengiz Can Cc: "Gustavo A . R . Silva" , Sakari Ailus , Andy Shevchenko , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: atomisp: Fix fallthrough keyword warning Message-ID: <20200831163516.490f5941@coco.lan> In-Reply-To: <20200831133011.91258-1-cengiz@kernel.wtf> References: <20200831133011.91258-1-cengiz@kernel.wtf> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, 31 Aug 2020 16:30:12 +0300 Cengiz Can escreveu: > 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; Actually, the actual fix here would be to get rid of fallthrough. Regards, Thanks, Mauro 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,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_2 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 006AFC433E6 for ; Mon, 31 Aug 2020 14:35:24 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 CA40120767 for ; Mon, 31 Aug 2020 14:35:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="bdLjsyhi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA40120767 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A810487938; Mon, 31 Aug 2020 14:35:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8ZOPjqSGbs8b; Mon, 31 Aug 2020 14:35:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 2B9F887812; Mon, 31 Aug 2020 14:35:23 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id BA35F1BF37B for ; Mon, 31 Aug 2020 14:35:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B5F3287812 for ; Mon, 31 Aug 2020 14:35:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WY0BxpD7wYRl for ; Mon, 31 Aug 2020 14:35:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by hemlock.osuosl.org (Postfix) with ESMTPS id 39FB987347 for ; Mon, 31 Aug 2020 14:35:21 +0000 (UTC) Received: from coco.lan (ip5f5ad5da.dynamic.kabel-deutschland.de [95.90.213.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62BE720767; Mon, 31 Aug 2020 14:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598884521; bh=tRBcPIP46PIv9mvYzx8qR3efQWkqbvGf3UbDReEJolA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bdLjsyhixcxLBkSG5UVO9cNWid/B3Lx3PX/Cu+N5k1lbkhpcN2NkEuhGLLeU0wWkJ ZwbY4uQoHjCbqpKuHOgg0e02obaMzfjGrascd7RQpkC7ShBXTGW/jaoEsCWUfj6W2t 2umU3WL1qZDhrhrfHVyWIFcyx5AwOSTO4GF3iSdg= Date: Mon, 31 Aug 2020 16:35:16 +0200 From: Mauro Carvalho Chehab To: Cengiz Can Subject: Re: [PATCH] staging: atomisp: Fix fallthrough keyword warning Message-ID: <20200831163516.490f5941@coco.lan> In-Reply-To: <20200831133011.91258-1-cengiz@kernel.wtf> References: <20200831133011.91258-1-cengiz@kernel.wtf> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 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, linux-kernel@vger.kernel.org, "Gustavo A . R . Silva" , 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" Em Mon, 31 Aug 2020 16:30:12 +0300 Cengiz Can escreveu: > 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; Actually, the actual fix here would be to get rid of fallthrough. Regards, Thanks, Mauro _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel