From patchwork Thu Aug 7 07:21:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 24067 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D58A3BE086 for ; Thu, 7 Aug 2025 07:21:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 044466921E; Thu, 7 Aug 2025 09:21:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="GGWmn/nX"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 45B7C69154 for ; Thu, 7 Aug 2025 09:21:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=K+ij2UbUYG2HC2eUCyXpv2xiTAJlYfIfOmQCPHGyn6A=; b=GGWmn/nXuxYCU9QWbhNUZIpGpt XBLmUZlPTGPpc5u6lpZeRRyaXPHYGpFJBtyotgsat2ID+2DUFG92hzyGOBGMJDUO7VBPqwpVu4GZB TOqJ3UUbgXreQzfQ+q/7gM/ZdaOmldaPWv5fsd2gTj9omvT56rtEy/yOGXHdOGYU0Vu9KhU+xec+g chVEKOo/QCiZB+gN+O2OX2bpoM0n3vf+/6GVVmwGHMzm5FVtDLUO+C2Xc8OHkVCUq3onbwrQZLTNu Yuv12c/BDUCvTUE84d19VdQjOL+ts0Pl2WzwXm8QA+fZD1+WVarvPLXvEzi7yu4ojEk0OPb6lJfP6 bpIRoESg==; Received: from [49.36.71.143] (helo=uajain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1ujuw4-00AtLb-Pe; Thu, 07 Aug 2025 09:21:13 +0200 From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Nicolas Dufresne , Umang Jain Subject: [PATCH] gstreamer: Drop a redundant conditional check Date: Thu, 7 Aug 2025 12:51:23 +0530 Message-ID: <20250807072123.35523-1-uajain@igalia.com> X-Mailer: git-send-email 2.50.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" RequestWrap `wrap` is set only if completedRequests_ queue is not empty, and if the `wrap` remains unset, -ENOBUFS is returned by GstLibcameraSrcState::processRequest(). There is no need to set the `err` variable to -ENOBUFS, by checking the completedRequests_ queue again. Hence, drop this conditional check from the processRequest() hotpath. Signed-off-by: Umang Jain Reviewed-by: Nicolas Dufresne --- src/gstreamer/gstlibcamerasrc.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index 79a025a5..3adb34f9 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -346,9 +346,6 @@ int GstLibcameraSrcState::processRequest() wrap = std::move(completedRequests_.front()); completedRequests_.pop(); } - - if (completedRequests_.empty()) - err = -ENOBUFS; } if (!wrap)