ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
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 <yong.deng@magewell.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Conor Dooley <conor@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>
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	[thread overview]
Message-ID: <20221208142006.425809-2-paul.kocialkowski@bootlin.com> (raw)
In-Reply-To: <20221208142006.425809-1-paul.kocialkowski@bootlin.com>

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 <paul.kocialkowski@bootlin.com>
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;
 	}
 
-- 
2.38.1


  reply	other threads:[~2022-12-08 14:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08 14:19 [PATCH v3 00/12] Allwinner A31/A83T CSI/ISP/MIPI CSI-2 media fixes Paul Kocialkowski
2022-12-08 14:19 ` Paul Kocialkowski [this message]
2022-12-08 14:19 ` [PATCH v3 02/12] media: sun6i-csi: bridge: Error out on invalid port to fix warning Paul Kocialkowski
2022-12-08 14:19 ` [PATCH v3 03/12] media: sunxi-csi: bridge: Declare subdev ops as static Paul Kocialkowski
2022-12-08 14:19 ` [PATCH v3 04/12] media: sun6i-csi: capture: Remove useless ret initialization Paul Kocialkowski
2022-12-08 14:19 ` [PATCH v3 05/12] media: sun6i-mipi-csi2: Clarify return code handling in stream off path Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 06/12] media: sun8i-a83t-mipi-csi2: " Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 07/12] media: sun6i-isp: proc: Fix " Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 08/12] media: sun6i-isp: proc: Error out on invalid port to fix warning Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 09/12] media: sun6i-isp: proc: Declare subdev ops as static Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 10/12] media: sun6i-isp: capture: Fix uninitialized variable use Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 11/12] media: sun6i-isp: params: Fix incorrect indentation Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 12/12] media: sun6i-isp: params: Unregister pending buffer on cleanup Paul Kocialkowski
2022-12-17  4:12 ` [PATCH v3 00/12] Allwinner A31/A83T CSI/ISP/MIPI CSI-2 media fixes Palmer Dabbelt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221208142006.425809-2-paul.kocialkowski@bootlin.com \
    --to=paul.kocialkowski@bootlin.com \
    --cc=conor@kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=nathan@kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=samuel@sholland.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wens@csie.org \
    --cc=yong.deng@magewell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox