From patchwork Tue Nov 7 09:51:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13448232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D1CBC4167B for ; Tue, 7 Nov 2023 09:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=g4VfS4oiS5YZKfuPRiCTqfeeN1yLgqvQxeglPA/5Gn8=; b=elUAt+o9DHRMMv ips5THGbQDxU112N5NAIAyqN22eROGTNkn5m8cT0xM3fYvwuGQoYppreNnVQPsXXQUKWWWWYmwwD8 fFeZTUqCL07yzApjE4f5CvJGim0oH4ZzilwV5y3qsAXFP3FYiwXC63XzNvp1UJNZoHhVYZyeQjGYB C+0NtZ2dUpZhCyufWL5FNQbxQgxJtDjkdoC5Cl3ixXKllWUI6jDAEn6R1/17XOT/2+17Lmv0QP/HF FvulvhhfUIUBSGiinOR4VAIYAI29XXei5ekh+UHmaFJL22AtMIJKbFRjTURQYjeidEpf1XNJG0ZLW 92Q4sTk4B7LTm2iOCVVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0Ikx-000xOc-0i; Tue, 07 Nov 2023 09:52:23 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0Iku-000xMJ-0V; Tue, 07 Nov 2023 09:52:21 +0000 Received: from umang.jain (unknown [103.251.226.110]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A2B35E62; Tue, 7 Nov 2023 10:51:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699350718; bh=4nV8MroyvaUEvxXBtXmcKoHJdIgd3BGt1fRK0ZyPbq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ron37tNl8KNXrLr6k5ec+MfqlI8NWOm3zlqR5Wu0tplOLFY+AWTtWIXUeAg8AbzHr IR6mKJhhHJgrgRoqYO2tEa8NEqk6vOH5Qp9DUoodYhNLOdYI2y9gBT6hqXNrjHVh07 qv0bhiytCjBb62MTnJQs0o4zR9oSvmVTE+kYg0LE= From: Umang Jain To: linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Cc: Stefan Wahren , Greg Kroah-Hartman , Dan Carpenter , Kieran Bingham , Laurent Pinchart , Phil Elwell , Dave Stevenson , Umang Jain , "Ricardo B . Marliere" Subject: [PATCH 3/9] staging: vc04_services: bcm2835-camera: Remove redundant null check Date: Tue, 7 Nov 2023 04:51:50 -0500 Message-ID: <20231107095156.365492-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231107095156.365492-1-umang.jain@ideasonboard.com> References: <20231107095156.365492-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231107_015220_355598_5ED2EB58 X-CRM114-Status: GOOD ( 10.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove the buf pointer null check in buffer_cb() as it can never be NULL. buffer_cb() is always called with a valid mmal_buf pointer (which is NULL checked) from which, struct vb2_mmal_buf buf pointer is derived, using container_of macro. Signed-off-by: Umang Jain Reviewed-by: Ricardo B. Marliere --- .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index e6e89784d84b..4b2b8f3bf903 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -333,11 +333,8 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, mmal_buf->pts); if (status) { - /* error in transfer */ - if (buf) { - /* there was a buffer with the error so return it */ - vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); - } + /* There was a buffer with the error so return it. */ + vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); return; }