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

Andy Shevchenko <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,dev.linux.lists.linux-staging,org.kernel.vger.linux-media
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
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 <[email protected]>
> ---
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.