Re: [PATCH] staging: media: atomisp: move constant to the right side of comparisons

From: Andy Shevchenko

Date: Thu Aug 06 2026 - 19:06:34 EST


On Thu, Jul 23, 2026 at 12:50:20PM -0300, Sergei Stepanenkov wrote:
> Fix all checkpatch warning occurences
> "WARNING: Comparisons should place the constant on the right side of
> the test" in folder drivers/staging/media/atomisp/pci
>
> Signed-off-by: Sergei Stepanenkov <sergei_stepanenkov@xxxxxxxxxxx>
> ---
> Hey, this is my first patch, I appreciate any feedback, thanks!

Right.
Please, read lore.kernel.org linux-media@ archives against this driver to
understand what to do with this patch.

Also, if you are in a group that is mentored, tell to the mentors to stop
looking into this driver by a newbie. This driver has much more urgent tasks
to do and it's not trivial, it also requires a real HW to be at hand to test.

...

> - if (0 != ia_css_pipe_get_info(asd->stream_env[stream_index]
> - .pipes[pipe_index], &info)) {
> + if (ia_css_pipe_get_info(asd->stream_env[stream_index]
> + .pipes[pipe_index], &info) != 0) {

The style is still wrong.


> dev_dbg(isp->dev, "ia_css_pipe_get_info FAILED");
> return -EINVAL;
> }

The above most likely already or should return a Linux error code in which case
the whole thing should be refactored,

ret = ia_css_pipe_get_info(asd->stream_env[stream_index].pipes[pipe_index], &info);
if (ret)
dev_dbg(isp->dev, "ia_css_pipe_get_info FAILED");
return ret;
}

--
With Best Regards,
Andy Shevchenko