Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp465905rdb; Thu, 2 Nov 2023 08:38:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCRHkzMHfyjfK6naWm1Ya6rHOlj0D8urK7YO/AmvuV/PrKsn8RTFw2hjz5jBXVt1GZM8yj X-Received: by 2002:a05:6a20:ae25:b0:16b:bd0f:ad0d with SMTP id dp37-20020a056a20ae2500b0016bbd0fad0dmr13760861pzb.28.1698939522629; Thu, 02 Nov 2023 08:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698939522; cv=none; d=google.com; s=arc-20160816; b=pbbAJK5icdBz83uHlBzxB1S7X42WzhQCvtk4zUFXeIKgexrdJCiiQ34+qYA2N0WPaY GuBxs9kLtkZkGeib9ZqQU8QbKZPJL0kcMMF+q/vQYjxf14BUznraIzgH0xyMMvC0epA2 JBZq7AzmJnDO8HDnlDNadjBaufq+LspgNmOI3KlwRj9TlZcFViJCiAhrK09LLK7zB/Em GdEVXEHH4IFuf9HfpWBgnJUCi+lWnXs1Jzam2CLN9utnd4SBlPO83nU4wpxE2nsOjsjM kcZHCefZT9gTnkR6w4IjSJTIMWnWczUyMGNjOjGuLjRj9kyqlgRWWtatEJYMg91ceZ9U IeyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SJ9bxtvYCNVrayYjDQIr0pRzzwehB7LtUyLsGmPpIoU=; fh=4jrFF1O0ET+HSwk7fT0R52wtqJ069QYzUS84PO6ydWU=; b=xD7LhgyIyQ+rktJFVs6mtAJeZUEB9dWeKxue8skXqCTTrvThNWToK0jmfQvqC+n5bn D3QM9H5pgeSaL+dYq1PBixA/ShDSt+y1pF9AZ7eAfzw8eSCM0/+pF9NUtC137eq1vWg3 9Dku8HGI2BxO7L47h4gNcvOMtdZqBWCWwvVPOP2wAjut6ecDQQpjl8m/pNL6gld7yL20 Hiyc/6G56uSUCWUlV2W0TKjvY0JL/icYHD857XxM+gYwmix8k6SxBO4CM1OxpPrDUgQX qIgJwgp181yLouqJeFfRPaxMaq3X4cyaXkZc2bLRay1dI/M4iK9RD4tJzYo66w7KQPec Nb+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=qYDmT76N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m70-20020a633f49000000b00574035fd472si1924915pga.31.2023.11.02.08.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 08:38:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=qYDmT76N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C4A6E8273306; Thu, 2 Nov 2023 08:38:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347580AbjKBPij (ORCPT + 99 others); Thu, 2 Nov 2023 11:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235171AbjKBPii (ORCPT ); Thu, 2 Nov 2023 11:38:38 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631C81B4; Thu, 2 Nov 2023 08:37:59 -0700 (PDT) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EC7CA8C2; Thu, 2 Nov 2023 16:37:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698939460; bh=DT6KLFROME6gQwGlCCzP0AGObJaawrMfnQVmIvWpWNA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qYDmT76NHBPJgjme5FiNiLXeOAQot69NwrxIEc26GkBDLZkpjpCWqAPLVoBPV5kGx EHB58asAICMbrWB0pzaoMtfgEjGuyLAwi9OQhNFJlLdrKqTouq3D8OLkvbut4Jbyp+ 2Qex6Zc4DIF485SjXLJcjU6ZGWcEFzMc8fKr2F40= Date: Thu, 2 Nov 2023 17:38:04 +0200 From: Laurent Pinchart To: Alexandra Diupina Cc: Jacopo Mondi , Kieran Bingham , Niklas =?utf-8?Q?S=C3=B6derlund?= , Mauro Carvalho Chehab , Hans de Goede , Sakari Ailus , Greg Kroah-Hartman , Andy Shevchenko , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Rob Herring , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, lvc-project@linuxtesting.org Subject: Re: [PATCH 2/4] Remove redundant return value check Message-ID: <20231102153804.GA7129@pendragon.ideasonboard.com> References: <20231102141135.369-1-adiupina@astralinux.ru> <20231102141135.369-2-adiupina@astralinux.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231102141135.369-2-adiupina@astralinux.ru> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 08:38:40 -0700 (PDT) On Thu, Nov 02, 2023 at 05:11:33PM +0300, Alexandra Diupina wrote: > media_entity_pads_init() will not return 0 only if the > 2nd parameter >= MEDIA_ENTITY_MAX_PADS (512), but 1 is > passed, so checking the return value is redundant That may be the case today, but may not be true tomorrow if the function is extended to perform extra checks. I don't think dropping the error check in drivers is a good idea. > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver") > Signed-off-by: Alexandra Diupina > --- > drivers/media/i2c/rdacm20.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c > index f4e2e2f3972a..ed249ade54e0 100644 > --- a/drivers/media/i2c/rdacm20.c > +++ b/drivers/media/i2c/rdacm20.c > @@ -611,9 +611,7 @@ static int rdacm20_probe(struct i2c_client *client) > > dev->pad.flags = MEDIA_PAD_FL_SOURCE; > dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; > - ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad); > - if (ret < 0) > - goto error_free_ctrls; > + media_entity_pads_init(&dev->sd.entity, 1, &dev->pad); > > ret = v4l2_async_register_subdev(&dev->sd); > if (ret) -- Regards, Laurent Pinchart