From patchwork Thu Nov 2 21:06:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13444205 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 E8E35C4167D for ; Thu, 2 Nov 2023 21:07:12 +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=ac4PnercJLGIUNmI+IUGaCrWHzTLLpFqWXGbcl6ZmrM=; b=cz0G3vV2t60EAw B7XjQ2pplNd69r0dftJoGUv9tUWcnVDlQ8+lCl0SQeMJ88Rd75o3aSR2wPPcGilZqqPhlN41FyhKN n6ppldXPLJxqRYbDu2dpefAT6Kkqq2lPFFcOuY40Z1+DgWN2liDlMhB/OiiV4UG1YF8fGKHydyk2G 6iGUGxTNtIfh6u5CXQp5yNCBdsjEjcGWeyCD6FTu4wEbERrAkDsOkDbcnBG1iSREnsqg8TAk8lJai Dc+QMcar5rx0SqlWO01zD4VWpcZcajaU+Tvvj57pmxH1mDZNuLApwq2Q+G9PGf4Yu2W20IK+ubzsG DT5bSJzOULOyhE4A6wcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qyetZ-00AI0p-0W; Thu, 02 Nov 2023 21:06:29 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qyetT-00AHxC-0N; Thu, 02 Nov 2023 21:06:27 +0000 Received: from umang.jain (unknown [103.86.18.252]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 724401BA7; Thu, 2 Nov 2023 22:06:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698959164; bh=a8iH5jRb/j16EMTGAIMJg3wp3R1ruC0yTIPb19rETiM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lXAgfxKjs6P8SqBk+OKGcFnl2ihyJw3GuOdg8DAHA1GsX2CqzcN6adqSbNCbwOW/f mRmeDLCJnvk2zxnDhk24yEV1v2ufJ06cmY/rUQ5eS+pTIdiPfrT3BGmeevuwqqhIzS W2O1hO82BLwhFgCgiWHcV27bMuJLJZjbKGV/CygM= From: Umang Jain To: linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Stefan Wahren , Greg Kroah-Hartman , Kieran Bingham , Dan Carpenter , Phil Elwell , Dave Stevenson , "Ricardo B . Marliere" , Umang Jain Subject: [PATCH 3/3] staging: vc04_services: bcm2835-camera: Remove redundant null check Date: Thu, 2 Nov 2023 17:06:03 -0400 Message-ID: <20231102210603.1201311-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102210603.1201311-1-umang.jain@ideasonboard.com> References: <20231102210603.1201311-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-20231102_140623_299099_7BF28856 X-CRM114-Status: GOOD ( 11.01 ) 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 --- .../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; }