From patchwork Thu Dec 8 14:19:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068462 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 F360AC4332F for ; Thu, 8 Dec 2022 14:21:44 +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=lvv7wyaJRxemvQrHvCUNdNpGOCq7Vlm9qTXvk15SZ1g=; b=jZ0MQU94fVO9z6 6PpUxgIyA2/1IQEkIs7Fbts7cdTsGOEB0I9mAg4BZaU1atOTG5M5oXT4ueTH9KTsaWqlAK6FcIC95 +9PM+mimB5AbOiX3DAawjFuZxkqhj5U7YzQHes4CVRgkctrA7jcYeTlydm1dYli/scR931Jk/owch g1WhHn3Ih8ZNre0pZtHay0ZzN+CjfXseYIQlFx/hkna5KABArwuIMv/gjL/QnaQ5M4PepPQ1kmJfQ NQFVAOCPIWNA0bPAa/Wo8rEhkEFy0R0P1IIXokBTfM9RvBWrpoe4eQGP9jX0ZdD+/WZOVEDCqloMf ojCVHai17bkMLyyem3lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3HlK-001lpA-Lf; Thu, 08 Dec 2022 14:20:34 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3HlH-001lkV-S2 for linux-arm-kernel@lists.infradead.org; Thu, 08 Dec 2022 14:20:33 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id CC93DC000A; Thu, 8 Dec 2022 14:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670509229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4H86cqUfo0veX7ajDKOvCLkZuNLK31VBo7MemiXpJog=; b=SE28wRoJfx3NxPUQTHch2c8hS6doHhE3jLz1I4oUI/wSV07e3fjfI03JjoiARh+xttgJQ1 56SGF19BmGFfw/0NXpIFIz2UPlhPUGQnk1sEXiEbfODkQ1VZjhiIgmVcpGYs1OnfrSVAaZ ZoeS0lZ65JVcD2QEcKt1hDWzRsJm5c+jY2G9ACM9WuQXJ1ACqmI+81Rq4pZxFvrvDrZhCP BtRKbXvZAr5xQxSAPAJbhTzgXpTV4pUuWVTVshNmCkfvebTiUycyV5VpRIy6pudrqg/v91 EZORjFCoQz4GAVPpNbbwVHB4VloKy6mZgU3EUA10pUISz1vgeQyXi0stkUE9kA== From: Paul Kocialkowski To: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Cc: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thomas Petazzoni , Hans Verkuil , Sakari Ailus , Conor Dooley , Nathan Chancellor Subject: [PATCH v3 01/12] media: sun6i-csi: bridge: Fix return code handling in stream off path Date: Thu, 8 Dec 2022 15:19:55 +0100 Message-Id: <20221208142006.425809-2-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208142006.425809-1-paul.kocialkowski@bootlin.com> References: <20221208142006.425809-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221208_062032_217171_8E290655 X-CRM114-Status: GOOD ( 11.99 ) 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 Explicitly set ret to zero on disable path to avoid a related smatch warning. This makes initialization at declaration useless. Signed-off-by: Paul Kocialkowski Fixes: 0d2b746b1bef ("media: sun6i-csi: Add bridge v4l2 subdev with port management") --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c index 86d20c1c35ed..88df3a73ebfa 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c @@ -415,8 +415,7 @@ static int sun6i_csi_bridge_s_stream(struct v4l2_subdev *subdev, int on) struct sun6i_csi_bridge_source *source; struct v4l2_subdev *source_subdev; struct media_pad *remote_pad; - /* Initialize to 0 to use both in disable label (ret != 0) and off. */ - int ret = 0; + int ret; /* Source */ @@ -436,6 +435,7 @@ static int sun6i_csi_bridge_s_stream(struct v4l2_subdev *subdev, int on) if (!on) { v4l2_subdev_call(source_subdev, video, s_stream, 0); + ret = 0; goto disable; }