Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: media: atomisp: move constant to the right side of comparisons
@ 2026-07-23 15:50 Sergei Stepanenkov
  2026-08-06 23:06 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Stepanenkov @ 2026-07-23 15:50 UTC (permalink / raw)
  To: linux-kernel, linux-media, linux-staging, andy, hansg, mchehab,
	sakari.ailus, gregkh
  Cc: ~lkcamp/patches, koike, Sergei Stepanenkov

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@disroot.org>
---
Hey, this is my first patch, I appreciate any feedback, thanks!
---
 drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 ++--
 drivers/staging/media/atomisp/pci/sh_css.c               | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index 0ee52637ea30..1e9f7d96f18c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -2301,8 +2301,8 @@ int atomisp_get_css_frame_info(struct atomisp_sub_device *asd,
 			       ATOMISP_INPUT_STREAM_VIDEO :
 			       ATOMISP_INPUT_STREAM_GENERAL;
 
-	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) {
 		dev_dbg(isp->dev, "ia_css_pipe_get_info FAILED");
 		return -EINVAL;
 	}
diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c
index 00082276f1db..3399e6793628 100644
--- a/drivers/staging/media/atomisp/pci/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/sh_css.c
@@ -7708,7 +7708,7 @@ ia_css_pipe_override_frame_format(struct ia_css_pipe *pipe,
 		IA_CSS_LEAVE_ERR_PRIVATE(err);
 		return err;
 	}
-	if (0 != pin_index && 1 != pin_index) {
+	if (pin_index != 0 && pin_index != 1) {
 		IA_CSS_ERROR("pin index is not valid");
 		err = -EINVAL;
 		IA_CSS_LEAVE_ERR_PRIVATE(err);
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: media: atomisp: move constant to the right side of comparisons
  2026-07-23 15:50 [PATCH] staging: media: atomisp: move constant to the right side of comparisons Sergei Stepanenkov
@ 2026-08-06 23:06 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-08-06 23:06 UTC (permalink / raw)
  To: Sergei Stepanenkov
  Cc: linux-kernel, linux-media, linux-staging, andy, hansg, mchehab,
	sakari.ailus, gregkh, ~lkcamp/patches, koike

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@disroot.org>
> ---
> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-06 23:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 15:50 [PATCH] staging: media: atomisp: move constant to the right side of comparisons Sergei Stepanenkov
2026-08-06 23:06 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox