Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp435132rdb; Thu, 2 Nov 2023 07:56:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGik57askLh8yN3+0yZ6DImhwq4+7pWf6Foj7496AhGL04lkGEY/rS6zcgGchNj6bJU2297 X-Received: by 2002:a05:6a00:1389:b0:6be:5a1a:3b93 with SMTP id t9-20020a056a00138900b006be5a1a3b93mr19228357pfg.4.1698936976428; Thu, 02 Nov 2023 07:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698936976; cv=none; d=google.com; s=arc-20160816; b=cdDsgPJe21cecRU6WK5D5TbR4H1B6mU3JoqaUns71VaJQYOZdIjxmPdlu7WMOYzj6a je8p0pemogLdTWvGjhJysphUa042pwy4rEyd/9TTvbPNP+DPtSxCj3l4JG8RMofiPtjm Qbk3jtb6ArV2ReLfLToZ8u/DsY7c7hKhsaBfHwTxgq18IsiXmtUjxOlLGW76wcW3f2RP iOxFi6xspz3mVeYNogKxcJEWj6jBMV2z7CsEKhvGDMC8sx8gGQrwhLN40Bd8YxayKDHI Og6gVDbP/rQK7sD0UnVwk3CUtTQTt+xHJWb0Mg5ska/9jPhnPOlyqABPnm2VL7MHC5B2 +k/g== 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=QJZxsg76ry4uCmEZXnI+2p6Rt+xE5Ybk6rXVrum5pZM=; fh=P7tmeft+t7E7v0VhxZ3BrwY1lmY+F+bC4TzhTxifq1o=; b=m88tCrS7ncuWPlEIx6Bxt6rmgatdzLVR/TaIQB90C2yLkKcizSOWLQkkAnX1qtIp9M w9afWCtCuvckP1SNiE+cisnH+MGTscfit6O/sO6vSIv9It6mF2aB9961C5YBkVLgbxw8 QNnx0hcl21Ni1TsfKRqHpWGPyJ77HXwGPE/WObVnxMnZFORCuGHdGIZgxBxo6e/HbI5J 6y+QmTEWyF4Y9NRHMAe8FjD0SSh2TNYiyhnVCEeHqDFnckNF2TpVDCHoEAKZqnDRVa7g vaKyqyBNLXyoarNL3gkw+nkWmIfL0uSIlSD7gHPoCXDKkR5wSajUSl9QPGSaCboi+kpU OhBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Cs+pJMCX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id h4-20020a056a00230400b006c34cacf9bfsi92655pfh.284.2023.11.02.07.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:56:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Cs+pJMCX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 37B8882D879F; Thu, 2 Nov 2023 07:56:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230149AbjKBOzz (ORCPT + 99 others); Thu, 2 Nov 2023 10:55:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjKBOzw (ORCPT ); Thu, 2 Nov 2023 10:55:52 -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 AC5A311B; Thu, 2 Nov 2023 07:55:45 -0700 (PDT) Received: from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8BDCD8C1; Thu, 2 Nov 2023 15:55:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698936924; bh=rXfEvh5nSr6U891GXJKcDjrkDgnjLsjVT9M6OziGS48=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Cs+pJMCX0wUvva8pWbLz1gR2aD+BiJ5yIzUwgNgLSVoobUb9ksmuXPU8SVpAxe/43 qklVgY+qe8srVlTSLNPa/gKMEJTRRcUX6T32qu5odxP6qqYmMncU2JLqIb9zDaton5 4ZHs6UUPPPrnTHIEHPRKX4mImhuCRI/i2pGxaCqU= Date: Thu, 2 Nov 2023 15:55:39 +0100 From: Jacopo Mondi To: Alexandra Diupina Cc: Jacopo Mondi , Kieran Bingham , Laurent Pinchart , 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: 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=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Thu, 02 Nov 2023 07:56:09 -0700 (PDT) Hi Alexandra 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 I do also see if (hweight32(iter->flags & (MEDIA_PAD_FL_SINK | MEDIA_PAD_FL_SOURCE)) != 1) { ret = -EINVAL; break; } as a possible failure in in media_entity_pads_init(). > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver") And this does not really qualify as a fix imho In general, being defensive and check for return errors in not a bad thing. I would keep the check in place, it really doesn't hurt. Same for the other patches in the series. Thanks j > 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) > -- > 2.30.2 >