Re: [PATCH 12/36] media: remove conditional return with no effect

From: Eugen Hristev

Date: Fri Aug 07 2026 - 03:53:14 EST


On 7/23/26 21:45, Sang-Heon Jeon wrote:
> Both branches of the check return the same value, so the check has
> no effect. Remove it and return the value directly.
>
> This is the result of running the Coccinelle script from
> scripts/coccinelle/misc/cond_return_no_effect.cocci.
>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@xxxxxxxxx>
> ---
> drivers/media/i2c/mt9p031.c | 6 +-----
> .../media/platform/microchip/microchip-sama7g5-isc.c | 7 +------
> drivers/media/platform/qcom/iris/iris_resources.c | 6 +-----
> drivers/media/platform/qcom/venus/pm_helpers.c | 7 +------
> drivers/media/platform/renesas/rcar-csi2.c | 6 +-----
> .../media/platform/samsung/s3c-camif/camif-core.c | 7 +------
> drivers/media/usb/dvb-usb-v2/mxl111sf.c | 12 ++----------
> drivers/media/usb/gspca/jl2005bcd.c | 7 +------
> 8 files changed, 9 insertions(+), 49 deletions(-)
>
> diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> index d21510caf45a..2b09e8315c8e 100644
> --- a/drivers/media/i2c/mt9p031.c
> +++ b/drivers/media/i2c/mt9p031.c
> @@ -452,11 +452,7 @@ static int mt9p031_set_params(struct mt9p031 *mt9p031)
> ret = mt9p031_write(client, MT9P031_HORIZONTAL_BLANK, hblank - 1);
> if (ret < 0)
> return ret;
> - ret = mt9p031_write(client, MT9P031_VERTICAL_BLANK, vblank - 1);
> - if (ret < 0)
> - return ret;
> -
> - return ret;
> + return mt9p031_write(client, MT9P031_VERTICAL_BLANK, vblank - 1);
> }
>
> static int mt9p031_s_stream(struct v4l2_subdev *subdev, int enable)
> diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> index b0302dfc3278..7383341ec51d 100644
> --- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> +++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> @@ -598,13 +598,8 @@ static int __maybe_unused xisc_runtime_suspend(struct device *dev)
> static int __maybe_unused xisc_runtime_resume(struct device *dev)
> {
> struct isc_device *isc = dev_get_drvdata(dev);
> - int ret;
> -
> - ret = clk_prepare_enable(isc->hclock);
> - if (ret)
> - return ret;
>
> - return ret;
> + return clk_prepare_enable(isc->hclock);
> }
>

For microchip isc,

Reviewed-by: Eugen Hristev <ehristev@xxxxxxxxxx>