2022-12-08 12:33:17

by Paul Kocialkowski

[permalink] [raw]
Subject: [PATCH 0/9] Allwinner A31/A83T CSI/ISP/MIPI CSI-2 media fixes

This series resolves reported smatch warnings against the recently-introduced
Allwinner A31/A83T CSI, ISP and MIPI CSI-2 drivers.

Smatch was ran again on the updated tree and no longer shows any error or
warning.

Paul

Paul Kocialkowski (9):
media: sun6i-csi: bridge: Fix return code handling in stream off path
media: sun6i-csi: capture: Remove useless ret initialization
media: sun6i-csi: bridge: Error out on invalid port to fix warning
media: sun6i-mipi-csi2: Fix return code handling in stream off path
media: sun8i-a83t-mipi-csi2: Fix return code handling in stream off
path
media: sun6i-isp: bridge: Fix return code handling in stream off path
media: sun6i-isp: bridge: Error out on invalid port to fix warning
media: sun6i-isp: capture: Fix uninitialized variable use
media: sun6i-isp: params: Fix incorrect indentation

drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c | 6 +++---
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c | 2 +-
.../media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 5 ++---
.../sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c | 5 ++---
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c | 4 ++--
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c | 4 ++--
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c | 6 +++---
7 files changed, 15 insertions(+), 17 deletions(-)

--
2.38.1


2022-12-08 12:34:50

by Paul Kocialkowski

[permalink] [raw]
Subject: [PATCH 9/9] media: sun6i-isp: params: Fix incorrect indentation

Remove a heading whitespace that results in a smatch warning.

Signed-off-by: Paul Kocialkowski <[email protected]>
---
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;

--
2.38.1

2022-12-08 12:38:20

by Paul Kocialkowski

[permalink] [raw]
Subject: [PATCH 5/9] media: sun8i-a83t-mipi-csi2: Fix return code handling in stream off path

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 <[email protected]>
---
.../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);

--
2.38.1

2022-12-08 13:46:35

by Paul Kocialkowski

[permalink] [raw]
Subject: [PATCH 6/9] media: sun6i-isp: bridge: Fix return code handling in stream off path

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 <[email protected]>
---
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;
}

--
2.38.1