From patchwork Thu Dec 8 11:47:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068321 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20007C63703 for ; Thu, 8 Dec 2022 11:48:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbiLHLsT (ORCPT ); Thu, 8 Dec 2022 06:48:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229886AbiLHLsJ (ORCPT ); Thu, 8 Dec 2022 06:48:09 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EA407BC22; Thu, 8 Dec 2022 03:48:04 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 9E5A6240007; Thu, 8 Dec 2022 11:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500083; 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=g8Fr5IFDx706AN895Lw8QOX+f28RaNPliLSLDFSc9/k=; b=a00ISrOkO4WtKc9pf6mbqrhA9oNkl/MdSK032EXIU09xlDA5iQla8rZ+eIK5vaJ2VPBwNY /FHhG8dL1xktAzEgM3wIOQw3SKCtaxOINV8ax+UK2HFbm9jDvhvbCJlzCZz2dysjqw82MQ +CHNpNH0LTbK8qye7D8kKcwAQ6tlOc1ppDk7Kxo2ZtZPom0uf/c9D2hYzBiWQuVf5TCzI8 +9lmS8s0r/kALXJXOuhhwymTb6bK9wCad0HmDOM5dJ89zgt3u1W+jmnj6FJTqfZsjaG6/D x+m/33v1b4h26XvfYr6X4AAV6iBz1xyxrKjXXBdenkj8NGMYLaPPG5qlGDYWSA== 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 Subject: [PATCH 1/9] media: sun6i-csi: bridge: Fix return code handling in stream off path Date: Thu, 8 Dec 2022 12:47:34 +0100 Message-Id: <20221208114742.399461-2-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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 --- 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; } From patchwork Thu Dec 8 11:47:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068322 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13FE6C4332F for ; Thu, 8 Dec 2022 11:48:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230042AbiLHLsW (ORCPT ); Thu, 8 Dec 2022 06:48:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbiLHLsO (ORCPT ); Thu, 8 Dec 2022 06:48:14 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 968CF26118; Thu, 8 Dec 2022 03:48:06 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 763A8240005; Thu, 8 Dec 2022 11:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500085; 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=I9WP6UuK09ZiFFwZrEctyWpBf9jdRvt9QAuYsYKrf9k=; b=ao4e4f7P+lJKy9qfYHzHIF7eAn1YDeHe1Wt9uSb6KhpWzuCq1/jRdfb3iZPDFpxMdzLmHx yfpvtKpaDZyfOWneurQREbwg5Ws1BqT4kIlOvTaGIH7H2YbSl4SX7otgyx9JwfUtfpq7aU ixeElXx6iV2GawAbAyjpO7G5UJtDPTJmh3gWG7gug/fbYZKD9nbl6qRvBv/GZ7kxGu5UNl vTl5RtQoSYITURDbmRHAq9BZpfZT0Jzy9zwc/cJihzhXaTzMcxn6z+zppoXULfK0r8sj42 oea3bxwsremp89F+p8ndsMEmphVs1QydErCL1ZX9HtJFjE35YFWvBGXQkH/RTA== 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 Subject: [PATCH 2/9] media: sun6i-csi: capture: Remove useless ret initialization Date: Thu, 8 Dec 2022 12:47:35 +0100 Message-Id: <20221208114742.399461-3-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org There is no particular need to assign ret when declaring it as it will be assigned before there is any chance to return it. Signed-off-by: Paul Kocialkowski --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c index 6d34f5c0768f..cf6aadbc130b 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c @@ -832,7 +832,7 @@ static int sun6i_csi_capture_open(struct file *file) { struct sun6i_csi_device *csi_dev = video_drvdata(file); struct sun6i_csi_capture *capture = &csi_dev->capture; - int ret = 0; + int ret; if (mutex_lock_interruptible(&capture->lock)) return -ERESTARTSYS; From patchwork Thu Dec 8 11:47:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068323 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FA33C3A5A7 for ; Thu, 8 Dec 2022 11:48:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229972AbiLHLs0 (ORCPT ); Thu, 8 Dec 2022 06:48:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbiLHLsP (ORCPT ); Thu, 8 Dec 2022 06:48:15 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2CF184DDC; Thu, 8 Dec 2022 03:48:08 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 4523B24000F; Thu, 8 Dec 2022 11:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500087; 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=G6S8oJ3aFtNCcZoU3kaxCoOFZa8bIBnBoUJ/ngEwAfA=; b=dUWD1ZGv9IFpByixdjm7gJRgcw5SjjHfkd6ABN3i8v5wYathBEODJDb0Tms3YqwJUPLlRF tGP8LlqVTbFp4iykF4Cx9VkPdKLr3eSzR9Jy/plnGlEN1ZF0W883+/HEdPPWa+PmNMlujP D1i/wBPeZpKni3KK+1mPH1vKaX3Y9BfBtWLx+Xy7rfRqdTqwSaj9Mg3KM+OdC8F3LSnxYZ XzAiJGPOsVdL3GvomGO2wmIHvu9FoQqXwraQrx84Ez12QB1bythbGFxMQJwTdWfAj0TrSV N9NEpX40Ilc0J55PCC1PoOxkkWurcxbc+GCCqLdKTRGpa+iv4naZdnbnOFOYcQ== 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 Subject: [PATCH 3/9] media: sun6i-csi: bridge: Error out on invalid port to fix warning Date: Thu, 8 Dec 2022 12:47:36 +0100 Message-Id: <20221208114742.399461-4-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The enabled variable is only set for a valid port and used later, which triggers an uninitialized use smatch warning. Explicitly error out in that case to fix the warning. Signed-off-by: Paul Kocialkowski --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 88df3a73ebfa..4517c0346eef 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c @@ -663,7 +663,7 @@ sun6i_csi_bridge_notifier_bound(struct v4l2_async_notifier *notifier, enabled = !bridge->source_parallel.expected; break; default: - break; + return -EINVAL; } source->subdev = remote_subdev; From patchwork Thu Dec 8 11:47:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068324 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94317C3A5A7 for ; Thu, 8 Dec 2022 11:48:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbiLHLsl (ORCPT ); Thu, 8 Dec 2022 06:48:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbiLHLsQ (ORCPT ); Thu, 8 Dec 2022 06:48:16 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 686E984DF4; Thu, 8 Dec 2022 03:48:10 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 653F5240003; Thu, 8 Dec 2022 11:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500088; 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=DcI0CE2vpt8M7xlyKhWsNrg5u9xwZtrv/Ts2Ew1lIMc=; b=j/CgJV8VPsYt7NneQB0+ZoLdhthaIF5W1Ou+PGIwRuksgooZvVI5DdWSosR97KskYOF4m0 cIDkQUEpD8K0xnbfTWtnWHpGhhK0tFGE/iWmP4+OgIyEWSqAutpiiTAS1mfvToAVVfDAv1 Wti8vVTku4ZHWymGk7hr9h5+ZnLgX/O/obyC3MP378wZtxEYw1RX4t0z2CF/qwnli9LvjN gLpOuSI5u1sr13cGHmlXYTiHGXVDpPnmJ8Us1snHPmcK6cx7VEiGH/wSzLuZ/GY+IYwOpc YoeUyXkrHIHRattvifx9KcQqtRatYxxsTKBca9mEwL1YHlsM9nml2LHiV/pIpQ== 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 Subject: [PATCH 4/9] media: sun6i-mipi-csi2: Fix return code handling in stream off path Date: Thu, 8 Dec 2022 12:47:37 +0100 Message-Id: <20221208114742.399461-5-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Explicitly set ret to zero instead of assigning it and overwriting it later, which is a bit confusing to understand. Signed-off-by: Paul Kocialkowski --- .../media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c index 484ac5f054d5..a220ce849b41 100644 --- a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c +++ b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c @@ -188,7 +188,8 @@ static int sun6i_mipi_csi2_s_stream(struct v4l2_subdev *subdev, int on) return -ENODEV; if (!on) { - ret = v4l2_subdev_call(source_subdev, video, s_stream, 0); + v4l2_subdev_call(source_subdev, video, s_stream, 0); + ret = 0; goto disable; } @@ -280,8 +281,6 @@ static int sun6i_mipi_csi2_s_stream(struct v4l2_subdev *subdev, int on) return 0; disable: - if (!on) - ret = 0; phy_power_off(dphy); sun6i_mipi_csi2_disable(csi2_dev); From patchwork Thu Dec 8 11:47:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068325 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C4A7C3A5A7 for ; Thu, 8 Dec 2022 11:49:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbiLHLtJ (ORCPT ); Thu, 8 Dec 2022 06:49:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbiLHLsR (ORCPT ); Thu, 8 Dec 2022 06:48:17 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1541E2610F; Thu, 8 Dec 2022 03:48:11 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 1A47524000C; Thu, 8 Dec 2022 11:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500090; 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=0FPh8ptOOh3/7vfnCNdEW59LErgazMVmLGY6D+7mMsQ=; b=Vz3FisI+TWdgUpXSmKJiPTe02vG17f0vmNae7kyIJC7joJLRHqanBB3W5fBrkIShBXtpw/ g89LyPAN2g/Umz6R9EOjH/kX0fv60Il6dZ+9MHsjReZQGs4yFvl17q0Q+sr9P+0mE+VgoY 8qr05bsEUmteOWYRNh4c4jO7CjMHEH17X/DQnYq73+qUJGw8bNk3GjVRy78gl8MMJvrJFd JsW0Xdqn6fePfro4RWZcqY43PfDKmnKJEC9owc18+yyT2xeGcir0CoxiqUhJ44DrSguJA+ KV8xScsZFumWIARKR6p3l17lH1rEQJUYU/wJtueUb6k6biq42pHZfQ7iKhsriA== 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 Subject: [PATCH 5/9] media: sun8i-a83t-mipi-csi2: Fix return code handling in stream off path Date: Thu, 8 Dec 2022 12:47:38 +0100 Message-Id: <20221208114742.399461-6-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Explicitly set ret to zero instead of assigning it and overwriting it later, which is a bit confusing to understand. Signed-off-by: Paul Kocialkowski --- .../sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c index d993c09a4820..cd2e92ae2293 100644 --- a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c +++ b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c @@ -220,7 +220,8 @@ static int sun8i_a83t_mipi_csi2_s_stream(struct v4l2_subdev *subdev, int on) return -ENODEV; if (!on) { - ret = v4l2_subdev_call(source_subdev, video, s_stream, 0); + v4l2_subdev_call(source_subdev, video, s_stream, 0); + ret = 0; goto disable; } @@ -312,8 +313,6 @@ static int sun8i_a83t_mipi_csi2_s_stream(struct v4l2_subdev *subdev, int on) return 0; disable: - if (!on) - ret = 0; phy_power_off(dphy); sun8i_a83t_mipi_csi2_disable(csi2_dev); From patchwork Thu Dec 8 11:47:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068326 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94C25C4332F for ; Thu, 8 Dec 2022 11:49:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbiLHLtX (ORCPT ); Thu, 8 Dec 2022 06:49:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiLHLsS (ORCPT ); Thu, 8 Dec 2022 06:48:18 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F417984DD2; Thu, 8 Dec 2022 03:48:13 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id DC0A324000B; Thu, 8 Dec 2022 11:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500092; 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=NirQ4Z0H8CCFNO8YF35iEuHBJ67K2AC07Y4K8xGkunI=; b=dlGNyauohT4CoLW3XYw+fCDaDPtU8a3v2UOKSI0wqcvevc6rxyFnt2g3zIQ+DYQa4e37tM srYnxcABuEk1VtpY9Kq5FSUBb5B36aUJ4XVrPLth6APh8HbO5TQBkXBUTLSer+UkrSk2of 0dAMaayNJi3YQuE8eT6rNq7m8xZtg7okPfB+HvTcllTwn6SK3v8SpOdLLTDs5bFw3Oja6c P5urxxIIt/IgIZAuWRaIKyOrFa/rBYW5WqKJFx7kMmkwCwc+eiBcfs0Omg+qD8LhwWqScI xBrRc4RVSykMkkBuzcfZU+2qvtzdU7k/qIfKGBS9aD6vfMoPou/clp4Cz+WVnA== 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 Subject: [PATCH 6/9] media: sun6i-isp: bridge: Fix return code handling in stream off path Date: Thu, 8 Dec 2022 12:47:39 +0100 Message-Id: <20221208114742.399461-7-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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 --- drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c index d69d2be0add2..a95709d2c573 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c @@ -173,8 +173,7 @@ static int sun6i_isp_proc_s_stream(struct v4l2_subdev *subdev, int on) struct sun6i_isp_proc_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 */ @@ -195,6 +194,7 @@ static int sun6i_isp_proc_s_stream(struct v4l2_subdev *subdev, int on) if (!on) { sun6i_isp_proc_irq_disable(isp_dev); v4l2_subdev_call(source_subdev, video, s_stream, 0); + ret = 0; goto disable; } From patchwork Thu Dec 8 11:47:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068327 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EAC7C3A5A7 for ; Thu, 8 Dec 2022 11:49:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229960AbiLHLtZ (ORCPT ); Thu, 8 Dec 2022 06:49:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbiLHLsT (ORCPT ); Thu, 8 Dec 2022 06:48:19 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 039DC6F0E3; Thu, 8 Dec 2022 03:48:15 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id D1A01240011; Thu, 8 Dec 2022 11:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500094; 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=AdvPC73c9zwfkFT3idm11mKPKt/UTJmdPBrpsnJ9sEg=; b=DtiFiffK3Z98ZaFmBXwerOQeFzge8eRkBWde/Pd1X3KqrPJKGWFDwDVKVtpGS/eiMk9/5E TorFM8o8IyCQ2MvECljMaTW6U1RFBqHCGt5BvVK9K9e+wf5gjJ229V2pcvZXTq5Od5r9kt ++SnRgVYIEetCpQ8n9mj0WIBH4LeCnWIFTtEaYBzk1crXGFjs5SO9a3xfIhVwS7SrcGgpi +GIXb573ZWdyHhxJAaaOkq4XYbEQaSFRBVxpEpG2ri7/vVRi/jvuGm16+v/dkNjPaLppf+ u/W+BheJsV1Jly/MvH57Vo5TpJCnNjX09LWFI5OckHEex8C/jIFh/54+N7l7tg== 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 Subject: [PATCH 7/9] media: sun6i-isp: bridge: Error out on invalid port to fix warning Date: Thu, 8 Dec 2022 12:47:40 +0100 Message-Id: <20221208114742.399461-8-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The enabled variable is only set for a valid port and used later, which triggers an uninitialized use smatch warning. Explicitly error out in that case to fix the warning. Signed-off-by: Paul Kocialkowski --- drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c index a95709d2c573..4f34c1bc8be9 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c @@ -416,7 +416,7 @@ static int sun6i_isp_proc_notifier_bound(struct v4l2_async_notifier *notifier, enabled = !proc->source_csi0.expected; break; default: - break; + return -EINVAL; } source->subdev = remote_subdev; From patchwork Thu Dec 8 11:47:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068328 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C2ADC4332F for ; Thu, 8 Dec 2022 11:49:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbiLHLt1 (ORCPT ); Thu, 8 Dec 2022 06:49:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbiLHLsW (ORCPT ); Thu, 8 Dec 2022 06:48:22 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A09BC813B9; Thu, 8 Dec 2022 03:48:18 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id EE608240007; Thu, 8 Dec 2022 11:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500097; 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=Nq7On3/y97eL5Yt3PQUNo7Mzs47XouX8Q1gOqpBPXDc=; b=ESnn3CLB9UXs+pb/6kjzhtYQHR/ob4VE/Q9MpLKgbAZNd5T8pMnicF/JIpWQAJQo7ISVAi lnhkngQ5QoD5Q8UtiNvrCjdWpy+tphZECKD6yEjaMPWLiGuMUoEQrph8DKwl3QjtM69fv6 SBrg/MNDBL8RUXJzSRJSmiX9Y/PnBzkZVg1KwklD0xit34uoHgRarI89qcgV4DkM/ikWuV YskLD6Hhz1yqKaVWuf5pcVZk9M7fQTXv0cRn/v2nMEuSSlLWySxa1OesxhC2xb6pmzUhtJ DbhQ4mYv3ctamd4WN9vqmn83yqiIcMGeEgdeAcM45zxK1MOnFXj5I8Xjt1vx0A== 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 Subject: [PATCH 8/9] media: sun6i-isp: capture: Fix uninitialized variable use Date: Thu, 8 Dec 2022 12:47:41 +0100 Message-Id: <20221208114742.399461-9-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org While the stride_chroma variable was previously initialized to zero, it's actually stride_chroma_div4 that is set to hardware registers. Initialize it to zero instead to avoid an uninitialized variable use and get rid of the associated smatch warning. Signed-off-by: Paul Kocialkowski --- drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c index 4b592820845a..1595a9607775 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c @@ -108,8 +108,8 @@ sun6i_isp_capture_buffer_configure(struct sun6i_isp_device *isp_dev, void sun6i_isp_capture_configure(struct sun6i_isp_device *isp_dev) { unsigned int width, height; - unsigned int stride_luma, stride_chroma = 0; - unsigned int stride_luma_div4, stride_chroma_div4; + unsigned int stride_luma, stride_chroma; + unsigned int stride_luma_div4, stride_chroma_div4 = 0; const struct sun6i_isp_capture_format *format; const struct v4l2_format_info *info; u32 pixelformat; From patchwork Thu Dec 8 11:47:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068329 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60F89C3A5A7 for ; Thu, 8 Dec 2022 11:49:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230078AbiLHLtj (ORCPT ); Thu, 8 Dec 2022 06:49:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230077AbiLHLsY (ORCPT ); Thu, 8 Dec 2022 06:48:24 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93128813B8; Thu, 8 Dec 2022 03:48:20 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 5ABB2240003; Thu, 8 Dec 2022 11:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500099; 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=o81YP8iaZF1sop9pwY0IwP4XTu0ePsqSN3S/jSq8oYA=; b=Gyumw+GixaiC3XEvP2m0jiuXtKSMmOoPQYdBHwKffcmJvOD0547GyaPAKmImac3mfSwIgT rew5O9Bu+fpPpLMCElY2ncv9sv0/4g0WIn/FWfnTxvDy5YboXrLrv7D2AXL3tIqBmRK1fl N2nOo+BfLthi2Y5BMhBh7lFwtNcUbtzZLF6zoEj6AoVhCgBwj36p75O/3+rWgKxP2YZJhx 8n6PZU0xNSRIvqIH1pBHw+IQgRBW7dLuLDLGnu75DYRyb9emhaznkyirz2pTyahAaV0KiN Ni0Ej24+fgpmFVQPUTvh3FV6H7SJCM4XSyvPVcLTTjxCdYKIsSpu0t6YTFLQuw== 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 Subject: [PATCH 9/9] media: sun6i-isp: params: Fix incorrect indentation Date: Thu, 8 Dec 2022 12:47:42 +0100 Message-Id: <20221208114742.399461-10-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Remove a heading whitespace that results in a smatch warning. Signed-off-by: Paul Kocialkowski --- drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c index 8039e311cb1c..7b41a13162b9 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c @@ -183,8 +183,8 @@ void sun6i_isp_params_configure(struct sun6i_isp_device *isp_dev) if (state->configured) goto complete; - sun6i_isp_params_configure_modules(isp_dev, - &sun6i_isp_params_config_default); + sun6i_isp_params_configure_modules(isp_dev, + &sun6i_isp_params_config_default); state->configured = true;