From mboxrd@z Thu Jan 1 00:00:00 1970 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 3A8F9CCD187 for ; Wed, 8 Oct 2025 17:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Q9V7tjrluVKh2scTpva1aVTgs2uCq7HRZVawG5loPtw=; b=ijKUKWg33bFfQgfuElo7+3KRb9 oC4G3E7XLtWkfEmLWjYsnxBRSQ1x4dbRkW1cWA0AjdvugYEdXwZyERSS7GAAqBCVbvIuc3ULNKF+B JDluxzJQqEDoUc2Parh6W8hSqWGLwNfQ5MKXKvHJRM56xs5J4pGPMBp/76hQkn4D23Xaz1Rs8rDj/ NSqZtw5uN/qUcoGdecRZJx7oq1Cla1dtnJyJepryQLvIgbctsR7x6so4Ie1Ovlqe9dqxeRL8UoJln KfsL3f4v3M7tPH+TdgAfwH7L4eygh5yWEnOaMaG4ZtBQf6G7fYRWh+9giM9u83lpyjg9LIXvCdd34 elVuxFjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v6YJx-00000004PQv-0xYn; Wed, 08 Oct 2025 17:51:25 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v6YJt-00000004PKl-2lf6 for linux-arm-kernel@lists.infradead.org; Wed, 08 Oct 2025 17:51:22 +0000 Received: from pendragon.ideasonboard.com (82-203-166-19.bb.dnainternet.fi [82.203.166.19]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 1287B191B; Wed, 8 Oct 2025 19:49:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1759945786; bh=Ht2XCQ3JJhPM15yVqt3rAnPQXMzBAby1D9DyhGE1PAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UtpyS0suarnz/+JOG+kaffX1BQU1X5JG/EYk+3TukCYmrclmCBm+Hm6t47iXpi3IW T/pJM9BB6gNuE70ga5d5GzjxNZ68fbYbIHmTiRDQkuHO5tyQXcTS0U2ErwwSAMKPJt vJ2F1tfirgRcuRQqpPkuCDepEHsOzguv5/jqFzYU= From: Laurent Pinchart To: linux-media@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Nicolas Dufresne , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Subject: [PATCH 12/25] media: imx-pxp: Drop unneeded v4l2_m2m_get_vq() NULL check Date: Wed, 8 Oct 2025 20:50:39 +0300 Message-ID: <20251008175052.19925-13-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.1 In-Reply-To: <20251008175052.19925-1-laurent.pinchart@ideasonboard.com> References: <20251008175052.19925-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251008_105121_854936_A637722A X-CRM114-Status: GOOD ( 10.83 ) 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 The v4l2_m2m_get_vq() function never returns NULL. In the set format handler, the check may have been intended to catch invalid format types, but that's not needed as the V4L2 core picks the appropriate VIDIOC_S_FMT ioctl handler based on the format type, so the type can't be incorrect. In the get format handler, the return value is not used for any purpose other than the NULL check, which was therefore probably intended to catch invalid format types. That's not needed for the same reason as in the set format handler. Drop the unneeded return value checks and, as the function has no side effect, the unneeded function call as well. Signed-off-by: Laurent Pinchart --- drivers/media/platform/nxp/imx-pxp.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c index 7f8ffbac582f..5386650ce194 100644 --- a/drivers/media/platform/nxp/imx-pxp.c +++ b/drivers/media/platform/nxp/imx-pxp.c @@ -1180,13 +1180,8 @@ static int pxp_enum_fmt_vid_out(struct file *file, void *priv, static int pxp_g_fmt(struct pxp_ctx *ctx, struct v4l2_format *f) { - struct vb2_queue *vq; struct pxp_q_data *q_data; - vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); - if (!vq) - return -EINVAL; - q_data = get_q_data(ctx, f->type); f->fmt.pix.width = q_data->width; @@ -1329,8 +1324,6 @@ static int pxp_s_fmt(struct pxp_ctx *ctx, struct v4l2_format *f) struct vb2_queue *vq; vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); - if (!vq) - return -EINVAL; q_data = get_q_data(ctx, f->type); if (!q_data) -- Regards, Laurent Pinchart