From patchwork Thu Nov 2 14:11:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandra Diupina X-Patchwork-Id: 160889 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp382563vqu; Thu, 2 Nov 2023 07:12:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJk4lQicORInNJLrQXps2zVJ1ad2RtWAAHSjWHW+sSHEKxFl5rJfyQV3O8kfvzeE9VRkl0 X-Received: by 2002:a17:902:ec91:b0:1cc:3bfc:69b1 with SMTP id x17-20020a170902ec9100b001cc3bfc69b1mr13195622plg.24.1698934340542; Thu, 02 Nov 2023 07:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698934340; cv=none; d=google.com; s=arc-20160816; b=jsJKyQtjjQm0yEhONvykkiGI87lw1q5m9P8699Yrg0D73C9DGrdNkazm1IDzxs2fib 6Cc+euu4yCdsCw3e/1ocjyZwU+LKg252qI89Ehk00RRc62Hef9rBUUBeym5CI28MxK/6 Ja6veT8F8Uw4jnXbWpGTuGBS+b50KJjVe8pZGwCl0O0lUlUWGcNune8ZuGFgiTyxc/Yo /MOgJJhQLV2Jpb1ltTZTqls291OJf+aUuKdl1O2wdW35D0ZsMCVo0vc1+fNpVb0juiWk X1w4lddDVRtxvEhGLnHn6gSmKdwDAeaGBQIOo0ikLQ5k4SDKmV/fyyxCIsw6ergbjvX+ 5ONw== 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 :message-id:date:subject:cc:to:from; bh=fdSCpCIgero5ToByGqUdJF61XPoot/le5ORJi5RCaJQ=; fh=Zl+v2JKDthIZHhHASuByBDqtjfYiGnx3GOhbpDE1n8A=; b=TBlqqmCdZBf22oxFiJ9XRmX3HmU0ErjAiT09CPp+rOW7AdngbO2Zm2He4LDuA4MNQX giv7xnzulwYGmtIjYpQNThAMPjLaBBXHnsmDcf95axAB3XbY4bmvq2C6BSE7gW8cvdqc n7TRBb0Y+iEf/t+1QhbatUwIrc/m44v63FjYm/RnwLQbdIYURxtQUnyTL3/1IXfVHXYn P1X2gik5YXCiCg6CEO9rX9wtJHKTtCOBenT36uSSSiv3V6c2o3DR3qkHVikt3eP1iamJ yBppo+JvTG+71xD505Xc4gqXUorXxn9rtQqZKS2XpVIC6mFVf5WxlJWPYxQ5n31AVMzf 6CSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d2-20020a170902cec200b001cc5d28bb2csi5242384plg.151.2023.11.02.07.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:12:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 E1535822D0A0; Thu, 2 Nov 2023 07:12:07 -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 S1376772AbjKBOMD (ORCPT + 36 others); Thu, 2 Nov 2023 10:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234984AbjKBOL6 (ORCPT ); Thu, 2 Nov 2023 10:11:58 -0400 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0642EB7; Thu, 2 Nov 2023 07:11:52 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 92E0C186AD7F; Thu, 2 Nov 2023 17:11:47 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Fb5gFKlPjCnD; Thu, 2 Nov 2023 17:11:47 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 2C2A6186AD7D; Thu, 2 Nov 2023 17:11:47 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id NxnAeH7SuxPo; Thu, 2 Nov 2023 17:11:47 +0300 (MSK) Received: from rbta-msk-lt-302690.astralinux.ru (unknown [10.177.237.131]) by mail.astralinux.ru (Postfix) with ESMTPSA id C627C186AD74; Thu, 2 Nov 2023 17:11:45 +0300 (MSK) From: Alexandra Diupina To: Hans de Goede Cc: Alexandra Diupina , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Andy Shevchenko , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH 1/4] Remove redundant return value check Date: Thu, 2 Nov 2023 17:11:32 +0300 Message-Id: <20231102141135.369-1-adiupina@astralinux.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 07:12:07 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781461764372167446 X-GMAIL-MSGID: 1781461774947345223 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 Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: ad85094b293e ("Revert "media: staging: atomisp: Remove driver"") Signed-off-by: Alexandra Diupina --- drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 4 +--- drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c | 6 +----- drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 2 -- drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c | 2 -- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c index 9fa390fbc5f3..f10931a03285 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c @@ -840,9 +840,7 @@ static int gc2235_probe(struct i2c_client *client) dev->ctrl_handler.lock = &dev->input_lock; dev->sd.ctrl_handler = &dev->ctrl_handler; - ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad); - if (ret) - gc2235_remove(client); + media_entity_pads_init(&dev->sd.entity, 1, &dev->pad); return atomisp_register_i2c_module(&dev->sd, gcpdev, RAW_CAMERA); diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c index 1c6643c442ef..b7a940fdbd0a 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c @@ -1581,11 +1581,7 @@ static int mt9m114_probe(struct i2c_client *client) /* REVISIT: Do we need media controller? */ ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad); - if (ret) { - mt9m114_remove(client); - return ret; - } - return 0; + return ret; } static const struct acpi_device_id mt9m114_acpi_match[] = { diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c index 6a72691ed5b7..922774293bf4 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c @@ -993,8 +993,6 @@ static int ov2722_probe(struct i2c_client *client) dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad); - if (ret) - ov2722_remove(client); return atomisp_register_i2c_module(&dev->sd, ovpdev, RAW_CAMERA); diff --git a/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c b/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c index 460a4e34c55b..8d5b74fb5d9c 100644 --- a/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c +++ b/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c @@ -1733,8 +1733,6 @@ static int ov5693_probe(struct i2c_client *client) dev->sd.ctrl_handler = &dev->ctrl_handler; ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad); - if (ret) - ov5693_remove(client); return ret; out_free: