Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH v2 0/3] media: static-analyzers: Fix 6.12-rc1 cocci warnings
@ 2024-09-27 10:02 Ricardo Ribalda
  2024-09-27 10:02 ` [PATCH v2 1/3] media: ti: cal: Use str_up_down() Ricardo Ribalda
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Ricardo Ribalda @ 2024-09-27 10:02 UTC (permalink / raw)
  To: Benoit Parrot, Mauro Carvalho Chehab, Sakari Ailus, Bingbu Cao,
	Tianshu Qiu, Greg Kroah-Hartman, Hans de Goede, Andy Shevchenko,
	Hans Verkuil
  Cc: linux-media, linux-kernel, linux-staging, Ricardo Ribalda

This patchset introduces fixes for all the new warnings introduced in
Linux 6.12-rc1

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
Changes in v2: Thanks Andy and Hans
- Replace max with if
- Fix style in subject
- Link to v1: https://lore.kernel.org/r/20240927-cocci-6-12-v1-0-a318d4e6a19d@chromium.org

---
Ricardo Ribalda (3):
      media: ti: cal: Use str_up_down()
      staging: media: ipu3: Use str_down_up()
      media: atomisp: Use max() macros

 drivers/media/platform/ti/cal/cal-camerarx.c    | 2 +-
 drivers/staging/media/atomisp/pci/sh_css_frac.h | 6 ++++--
 drivers/staging/media/ipu3/ipu3-css.c           | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)
---
base-commit: 075dbe9f6e3c21596c5245826a4ee1f1c1676eb8
change-id: 20240927-cocci-6-12-4c571bc8e9dd

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>


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

* [PATCH v2 1/3] media: ti: cal: Use str_up_down()
  2024-09-27 10:02 [PATCH v2 0/3] media: static-analyzers: Fix 6.12-rc1 cocci warnings Ricardo Ribalda
@ 2024-09-27 10:02 ` Ricardo Ribalda
  2024-09-27 10:10   ` Andy Shevchenko
                     ` (2 more replies)
  2024-09-27 10:02 ` [PATCH v2 2/3] staging: media: ipu3: Use str_down_up() Ricardo Ribalda
  2024-09-27 10:02 ` [PATCH v2 3/3] media: atomisp: Use max() macros Ricardo Ribalda
  2 siblings, 3 replies; 12+ messages in thread
From: Ricardo Ribalda @ 2024-09-27 10:02 UTC (permalink / raw)
  To: Benoit Parrot, Mauro Carvalho Chehab, Sakari Ailus, Bingbu Cao,
	Tianshu Qiu, Greg Kroah-Hartman, Hans de Goede, Andy Shevchenko,
	Hans Verkuil
  Cc: linux-media, linux-kernel, linux-staging, Ricardo Ribalda

The str_up_down() helper simplifies the code and fixes the following cocci
warning:

drivers/media/platform/ti/cal/cal-camerarx.c:194:3-9: opportunity for str_up_down(enable)

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/platform/ti/cal/cal-camerarx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/ti/cal/cal-camerarx.c b/drivers/media/platform/ti/cal/cal-camerarx.c
index 42dfe08b765f..ba8c4743f539 100644
--- a/drivers/media/platform/ti/cal/cal-camerarx.c
+++ b/drivers/media/platform/ti/cal/cal-camerarx.c
@@ -191,7 +191,7 @@ static void cal_camerarx_power(struct cal_camerarx *phy, bool enable)
 
 	if (i == 10)
 		phy_err(phy, "Failed to power %s complexio\n",
-			enable ? "up" : "down");
+			str_up_down(enable);
 }
 
 static void cal_camerarx_wait_reset(struct cal_camerarx *phy)

-- 
2.46.1.824.gd892dcdcdd-goog


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

* [PATCH v2 2/3] staging: media: ipu3: Use str_down_up()
  2024-09-27 10:02 [PATCH v2 0/3] media: static-analyzers: Fix 6.12-rc1 cocci warnings Ricardo Ribalda
  2024-09-27 10:02 ` [PATCH v2 1/3] media: ti: cal: Use str_up_down() Ricardo Ribalda
@ 2024-09-27 10:02 ` Ricardo Ribalda
  2024-09-27 10:02 ` [PATCH v2 3/3] media: atomisp: Use max() macros Ricardo Ribalda
  2 siblings, 0 replies; 12+ messages in thread
From: Ricardo Ribalda @ 2024-09-27 10:02 UTC (permalink / raw)
  To: Benoit Parrot, Mauro Carvalho Chehab, Sakari Ailus, Bingbu Cao,
	Tianshu Qiu, Greg Kroah-Hartman, Hans de Goede, Andy Shevchenko,
	Hans Verkuil
  Cc: linux-media, linux-kernel, linux-staging, Ricardo Ribalda

The str_down_up() helper simplifies the code and fixes the following cocci
warning:

drivers/staging/media/ipu3/ipu3-css.c:229:18-47: opportunity for str_down_up(state & IMGU_STATE_POWER_DOWN)

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/staging/media/ipu3/ipu3-css.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/ipu3/ipu3-css.c b/drivers/staging/media/ipu3/ipu3-css.c
index 1b0a59b78949..bb22375481a0 100644
--- a/drivers/staging/media/ipu3/ipu3-css.c
+++ b/drivers/staging/media/ipu3/ipu3-css.c
@@ -226,7 +226,7 @@ int imgu_css_set_powerup(struct device *dev, void __iomem *base,
 	state = readl(base + IMGU_REG_STATE);
 
 	dev_dbg(dev, "CSS pm_ctrl 0x%x state 0x%x (power %s)\n",
-		pm_ctrl, state, state & IMGU_STATE_POWER_DOWN ? "down" : "up");
+		pm_ctrl, state, str_down_up(state & IMGU_STATE_POWER_DOWN));
 
 	/* Power up CSS using wrapper */
 	if (state & IMGU_STATE_POWER_DOWN) {

-- 
2.46.1.824.gd892dcdcdd-goog


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

* [PATCH v2 3/3] media: atomisp: Use max() macros
  2024-09-27 10:02 [PATCH v2 0/3] media: static-analyzers: Fix 6.12-rc1 cocci warnings Ricardo Ribalda
  2024-09-27 10:02 ` [PATCH v2 1/3] media: ti: cal: Use str_up_down() Ricardo Ribalda
  2024-09-27 10:02 ` [PATCH v2 2/3] staging: media: ipu3: Use str_down_up() Ricardo Ribalda
@ 2024-09-27 10:02 ` Ricardo Ribalda
  2024-09-27 10:09   ` Andy Shevchenko
                     ` (2 more replies)
  2 siblings, 3 replies; 12+ messages in thread
From: Ricardo Ribalda @ 2024-09-27 10:02 UTC (permalink / raw)
  To: Benoit Parrot, Mauro Carvalho Chehab, Sakari Ailus, Bingbu Cao,
	Tianshu Qiu, Greg Kroah-Hartman, Hans de Goede, Andy Shevchenko,
	Hans Verkuil
  Cc: linux-media, linux-kernel, linux-staging, Ricardo Ribalda

The max() macro produce nicer code and also fixes the following cocci
errors:

drivers/staging/media/atomisp/pci/sh_css_frac.h:40:17-18: WARNING opportunity for max()
drivers/staging/media/atomisp/pci/sh_css_frac.h:50:17-18: WARNING opportunity for max()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/staging/media/atomisp/pci/sh_css_frac.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_frac.h b/drivers/staging/media/atomisp/pci/sh_css_frac.h
index 8ba65161f7a9..3191d2858f59 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_frac.h
+++ b/drivers/staging/media/atomisp/pci/sh_css_frac.h
@@ -37,7 +37,8 @@ static inline int sDIGIT_FITTING(int v, int a, int b)
 	int fit_shift = sFRACTION_BITS_FITTING(a) - b;
 
 	v >>= sSHIFT;
-	v >>= fit_shift > 0 ? fit_shift : 0;
+	if (fit_shift > 0)
+		v >>= fit_shift;
 
 	return clamp_t(int, v, sISP_VAL_MIN, sISP_VAL_MAX);
 }
@@ -47,7 +48,8 @@ static inline unsigned int uDIGIT_FITTING(unsigned int v, int a, int b)
 	int fit_shift = uFRACTION_BITS_FITTING(a) - b;
 
 	v >>= uSHIFT;
-	v >>= fit_shift > 0 ? fit_shift : 0;
+	if (fit_shift > 0)
+		v >>= fit_shift;
 
 	return clamp_t(unsigned int, v, uISP_VAL_MIN, uISP_VAL_MAX);
 }

-- 
2.46.1.824.gd892dcdcdd-goog


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

* Re: [PATCH v2 3/3] media: atomisp: Use max() macros
  2024-09-27 10:02 ` [PATCH v2 3/3] media: atomisp: Use max() macros Ricardo Ribalda
@ 2024-09-27 10:09   ` Andy Shevchenko
  2024-09-27 10:09   ` Hans Verkuil
  2024-09-27 10:10   ` Dan Carpenter
  2 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2024-09-27 10:09 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Benoit Parrot, Mauro Carvalho Chehab, Sakari Ailus, Bingbu Cao,
	Tianshu Qiu, Greg Kroah-Hartman, Hans de Goede, Andy Shevchenko,
	Hans Verkuil, linux-media, linux-kernel, linux-staging

On Fri, Sep 27, 2024 at 1:02 PM Ricardo Ribalda <ribalda@chromium.org> wrote:
>
> The max() macro produce nicer code

You forgot to update the commit message.

> and also fixes the following cocci
> errors:

> drivers/staging/media/atomisp/pci/sh_css_frac.h:40:17-18: WARNING opportunity for max()
> drivers/staging/media/atomisp/pci/sh_css_frac.h:50:17-18: WARNING opportunity for max()

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 3/3] media: atomisp: Use max() macros
  2024-09-27 10:02 ` [PATCH v2 3/3] media: atomisp: Use max() macros Ricardo Ribalda
  2024-09-27 10:09   ` Andy Shevchenko
@ 2024-09-27 10:09   ` Hans Verkuil
  2024-09-27 10:10   ` Dan Carpenter
  2 siblings, 0 replies; 12+ messages in thread
From: Hans Verkuil @ 2024-09-27 10:09 UTC (permalink / raw)
  To: Ricardo Ribalda, Benoit Parrot, Mauro Carvalho Chehab,
	Sakari Ailus, Bingbu Cao, Tianshu Qiu, Greg Kroah-Hartman,
	Hans de Goede, Andy Shevchenko
  Cc: linux-media, linux-kernel, linux-staging

On 27/09/2024 12:02, Ricardo Ribalda wrote:
> The max() macro produce nicer code and also fixes the following cocci
> errors:
> 
> drivers/staging/media/atomisp/pci/sh_css_frac.h:40:17-18: WARNING opportunity for max()
> drivers/staging/media/atomisp/pci/sh_css_frac.h:50:17-18: WARNING opportunity for max()

Subject and commit message is now out of sync with the code.

Hans

> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  drivers/staging/media/atomisp/pci/sh_css_frac.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/sh_css_frac.h b/drivers/staging/media/atomisp/pci/sh_css_frac.h
> index 8ba65161f7a9..3191d2858f59 100644
> --- a/drivers/staging/media/atomisp/pci/sh_css_frac.h
> +++ b/drivers/staging/media/atomisp/pci/sh_css_frac.h
> @@ -37,7 +37,8 @@ static inline int sDIGIT_FITTING(int v, int a, int b)
>  	int fit_shift = sFRACTION_BITS_FITTING(a) - b;
>  
>  	v >>= sSHIFT;
> -	v >>= fit_shift > 0 ? fit_shift : 0;
> +	if (fit_shift > 0)
> +		v >>= fit_shift;
>  
>  	return clamp_t(int, v, sISP_VAL_MIN, sISP_VAL_MAX);
>  }
> @@ -47,7 +48,8 @@ static inline unsigned int uDIGIT_FITTING(unsigned int v, int a, int b)
>  	int fit_shift = uFRACTION_BITS_FITTING(a) - b;
>  
>  	v >>= uSHIFT;
> -	v >>= fit_shift > 0 ? fit_shift : 0;
> +	if (fit_shift > 0)
> +		v >>= fit_shift;
>  
>  	return clamp_t(unsigned int, v, uISP_VAL_MIN, uISP_VAL_MAX);
>  }
> 


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

* Re: [PATCH v2 1/3] media: ti: cal: Use str_up_down()
  2024-09-27 10:02 ` [PATCH v2 1/3] media: ti: cal: Use str_up_down() Ricardo Ribalda
@ 2024-09-27 10:10   ` Andy Shevchenko
  2024-09-27 10:16     ` Ricardo Ribalda
  2024-09-28  2:53   ` kernel test robot
  2024-09-28  3:14   ` kernel test robot
  2 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2024-09-27 10:10 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Benoit Parrot, Mauro Carvalho Chehab, Sakari Ailus, Bingbu Cao,
	Tianshu Qiu, Greg Kroah-Hartman, Hans de Goede, Andy Shevchenko,
	Hans Verkuil, linux-media, linux-kernel, linux-staging

On Fri, Sep 27, 2024 at 1:02 PM Ricardo Ribalda <ribalda@chromium.org> wrote:
>
> The str_up_down() helper simplifies the code and fixes the following cocci
> warning:
>
> drivers/media/platform/ti/cal/cal-camerarx.c:194:3-9: opportunity for str_up_down(enable)

...

>         if (i == 10)
>                 phy_err(phy, "Failed to power %s complexio\n",
> -                       enable ? "up" : "down");
> +                       str_up_down(enable);

You never tested this, do not bother to send untested material, please!

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 3/3] media: atomisp: Use max() macros
  2024-09-27 10:02 ` [PATCH v2 3/3] media: atomisp: Use max() macros Ricardo Ribalda
  2024-09-27 10:09   ` Andy Shevchenko
  2024-09-27 10:09   ` Hans Verkuil
@ 2024-09-27 10:10   ` Dan Carpenter
  2 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2024-09-27 10:10 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Benoit Parrot, Mauro Carvalho Chehab, Sakari Ailus, Bingbu Cao,
	Tianshu Qiu, Greg Kroah-Hartman, Hans de Goede, Andy Shevchenko,
	Hans Verkuil, linux-media, linux-kernel, linux-staging

The commit message doesn't make sense.  Please, wait for a day before resending
patches.  There is no rush.

regards,
dan carpenter


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

* Re: [PATCH v2 1/3] media: ti: cal: Use str_up_down()
  2024-09-27 10:10   ` Andy Shevchenko
@ 2024-09-27 10:16     ` Ricardo Ribalda
  2024-09-27 10:43       ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Ricardo Ribalda @ 2024-09-27 10:16 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Benoit Parrot, Mauro Carvalho Chehab, Sakari Ailus, Bingbu Cao,
	Tianshu Qiu, Greg Kroah-Hartman, Hans de Goede, Andy Shevchenko,
	Hans Verkuil, linux-media, linux-kernel, linux-staging

Hi Andy

On Fri, 27 Sept 2024 at 12:10, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Fri, Sep 27, 2024 at 1:02 PM Ricardo Ribalda <ribalda@chromium.org> wrote:
> >
> > The str_up_down() helper simplifies the code and fixes the following cocci
> > warning:
> >
> > drivers/media/platform/ti/cal/cal-camerarx.c:194:3-9: opportunity for str_up_down(enable)
>
> ...
>
> >         if (i == 10)
> >                 phy_err(phy, "Failed to power %s complexio\n",
> > -                       enable ? "up" : "down");
> > +                       str_up_down(enable);
>
> You never tested this, do not bother to send untested material, please!

Do you mean tested in real hardware or compile test it?

I did test it:
https://gitlab.freedesktop.org/linux-media/users/ribalda/-/commits/test-newlinus

But obviously we are not building that file :S. Let me figure out why
did this happened

Sorry for the noise

>
> --
> With Best Regards,
> Andy Shevchenko



-- 
Ricardo Ribalda

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

* Re: [PATCH v2 1/3] media: ti: cal: Use str_up_down()
  2024-09-27 10:16     ` Ricardo Ribalda
@ 2024-09-27 10:43       ` Andy Shevchenko
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2024-09-27 10:43 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Benoit Parrot, Mauro Carvalho Chehab, Sakari Ailus, Bingbu Cao,
	Tianshu Qiu, Greg Kroah-Hartman, Hans de Goede, Andy Shevchenko,
	Hans Verkuil, linux-media, linux-kernel, linux-staging

On Fri, Sep 27, 2024 at 1:16 PM Ricardo Ribalda <ribalda@chromium.org> wrote:
> On Fri, 27 Sept 2024 at 12:10, Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Fri, Sep 27, 2024 at 1:02 PM Ricardo Ribalda <ribalda@chromium.org> wrote:

...

> > >         if (i == 10)
> > >                 phy_err(phy, "Failed to power %s complexio\n",
> > > -                       enable ? "up" : "down");
> > > +                       str_up_down(enable);
> >
> > You never tested this, do not bother to send untested material, please!
>
> Do you mean tested in real hardware or compile test it?

Obviously both as one can't be done without the other.

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 1/3] media: ti: cal: Use str_up_down()
  2024-09-27 10:02 ` [PATCH v2 1/3] media: ti: cal: Use str_up_down() Ricardo Ribalda
  2024-09-27 10:10   ` Andy Shevchenko
@ 2024-09-28  2:53   ` kernel test robot
  2024-09-28  3:14   ` kernel test robot
  2 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2024-09-28  2:53 UTC (permalink / raw)
  To: Ricardo Ribalda, Benoit Parrot, Mauro Carvalho Chehab,
	Sakari Ailus, Bingbu Cao, Tianshu Qiu, Greg Kroah-Hartman,
	Hans de Goede, Andy Shevchenko, Hans Verkuil
  Cc: oe-kbuild-all, linux-media, linux-kernel, linux-staging,
	Ricardo Ribalda

Hi Ricardo,

kernel test robot noticed the following build errors:

[auto build test ERROR on 075dbe9f6e3c21596c5245826a4ee1f1c1676eb8]

url:    https://github.com/intel-lab-lkp/linux/commits/Ricardo-Ribalda/media-ti-cal-Use-str_up_down/20240927-180438
base:   075dbe9f6e3c21596c5245826a4ee1f1c1676eb8
patch link:    https://lore.kernel.org/r/20240927-cocci-6-12-v2-1-1c6ad931959b%40chromium.org
patch subject: [PATCH v2 1/3] media: ti: cal: Use str_up_down()
config: arc-randconfig-002-20240928 (https://download.01.org/0day-ci/archive/20240928/202409281008.pouaXQCm-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240928/202409281008.pouaXQCm-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409281008.pouaXQCm-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/media/platform/ti/cal/cal-camerarx.c: In function 'cal_camerarx_power':
>> drivers/media/platform/ti/cal/cal-camerarx.c:897:2: error: unterminated argument list invoking macro "phy_err"
     897 | }
         |  ^
>> drivers/media/platform/ti/cal/cal-camerarx.c:193:17: error: 'phy_err' undeclared (first use in this function)
     193 |                 phy_err(phy, "Failed to power %s complexio\n",
         |                 ^~~~~~~
   drivers/media/platform/ti/cal/cal-camerarx.c:193:17: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/media/platform/ti/cal/cal-camerarx.c:193:24: error: expected ';' at end of input
     193 |                 phy_err(phy, "Failed to power %s complexio\n",
         |                        ^
         |                        ;
   ......
   drivers/media/platform/ti/cal/cal-camerarx.c:192:9: note: '-Wmisleading-indentation' is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
     192 |         if (i == 10)
         |         ^~
   drivers/media/platform/ti/cal/cal-camerarx.c:192:9: note: adding '-flarge-source-files' will allow for more column-tracking support, at the expense of compilation time and memory
>> drivers/media/platform/ti/cal/cal-camerarx.c:193:17: error: expected declaration or statement at end of input
     193 |                 phy_err(phy, "Failed to power %s complexio\n",
         |                 ^~~~~~~
   drivers/media/platform/ti/cal/cal-camerarx.c: At top level:
>> drivers/media/platform/ti/cal/cal-camerarx.c:168:13: warning: 'cal_camerarx_power' defined but not used [-Wunused-function]
     168 | static void cal_camerarx_power(struct cal_camerarx *phy, bool enable)
         |             ^~~~~~~~~~~~~~~~~~
>> drivers/media/platform/ti/cal/cal-camerarx.c:133:13: warning: 'cal_camerarx_config' defined but not used [-Wunused-function]
     133 | static void cal_camerarx_config(struct cal_camerarx *phy, s64 link_freq)
         |             ^~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/ti/cal/cal-camerarx.c:108:13: warning: 'cal_camerarx_enable' defined but not used [-Wunused-function]
     108 | static void cal_camerarx_enable(struct cal_camerarx *phy)
         |             ^~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/ti/cal/cal-camerarx.c:80:13: warning: 'cal_camerarx_lane_config' defined but not used [-Wunused-function]
      80 | static void cal_camerarx_lane_config(struct cal_camerarx *phy)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/ti/cal/cal-camerarx.c:48:12: warning: 'cal_camerarx_get_ext_link_freq' defined but not used [-Wunused-function]
      48 | static s64 cal_camerarx_get_ext_link_freq(struct cal_camerarx *phy)
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/phy_err +897 drivers/media/platform/ti/cal/cal-camerarx.c

af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  886  
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  887  void cal_camerarx_destroy(struct cal_camerarx *phy)
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  888  {
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  889  	if (!phy)
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  890  		return;
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  891  
5acc3e22c25359 drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-12-07  892  	v4l2_device_unregister_subdev(&phy->subdev);
e7bbe653fd9a76 drivers/media/platform/ti/cal/cal-camerarx.c Tomi Valkeinen   2023-06-19  893  	v4l2_subdev_cleanup(&phy->subdev);
5acc3e22c25359 drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-12-07  894  	media_entity_cleanup(&phy->subdev.entity);
27f86b9bff79e1 drivers/media/platform/ti-vpe/cal-camerarx.c Tomi Valkeinen   2021-06-14  895  	of_node_put(phy->source_ep_node);
27f86b9bff79e1 drivers/media/platform/ti-vpe/cal-camerarx.c Tomi Valkeinen   2021-06-14  896  	of_node_put(phy->source_node);
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06 @897  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH v2 1/3] media: ti: cal: Use str_up_down()
  2024-09-27 10:02 ` [PATCH v2 1/3] media: ti: cal: Use str_up_down() Ricardo Ribalda
  2024-09-27 10:10   ` Andy Shevchenko
  2024-09-28  2:53   ` kernel test robot
@ 2024-09-28  3:14   ` kernel test robot
  2 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2024-09-28  3:14 UTC (permalink / raw)
  To: Ricardo Ribalda, Benoit Parrot, Mauro Carvalho Chehab,
	Sakari Ailus, Bingbu Cao, Tianshu Qiu, Greg Kroah-Hartman,
	Hans de Goede, Andy Shevchenko, Hans Verkuil
  Cc: llvm, oe-kbuild-all, linux-media, linux-kernel, linux-staging,
	Ricardo Ribalda

Hi Ricardo,

kernel test robot noticed the following build errors:

[auto build test ERROR on 075dbe9f6e3c21596c5245826a4ee1f1c1676eb8]

url:    https://github.com/intel-lab-lkp/linux/commits/Ricardo-Ribalda/media-ti-cal-Use-str_up_down/20240927-180438
base:   075dbe9f6e3c21596c5245826a4ee1f1c1676eb8
patch link:    https://lore.kernel.org/r/20240927-cocci-6-12-v2-1-1c6ad931959b%40chromium.org
patch subject: [PATCH v2 1/3] media: ti: cal: Use str_up_down()
config: i386-buildonly-randconfig-003-20240928 (https://download.01.org/0day-ci/archive/20240928/202409281015.ZcDlYBGw-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240928/202409281015.ZcDlYBGw-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409281015.ZcDlYBGw-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> drivers/media/platform/ti/cal/cal-camerarx.c:193:3: error: unterminated function-like macro invocation
     193 |                 phy_err(phy, "Failed to power %s complexio\n",
         |                 ^
   drivers/media/platform/ti/cal/cal.h:278:9: note: macro 'phy_err' defined here
     278 | #define phy_err(phy, fmt, arg...)                                       \
         |         ^
>> drivers/media/platform/ti/cal/cal-camerarx.c:897:2: error: expected expression
     897 | }
         |  ^
>> drivers/media/platform/ti/cal/cal-camerarx.c:897:2: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
   drivers/media/platform/ti/cal/cal-camerarx.c:192:2: note: previous statement is here
     192 |         if (i == 10)
         |         ^
>> drivers/media/platform/ti/cal/cal-camerarx.c:897:2: error: expected '}'
     897 | }
         |  ^
   drivers/media/platform/ti/cal/cal-camerarx.c:169:1: note: to match this '{'
     169 | {
         | ^
   1 warning and 3 errors generated.


vim +193 drivers/media/platform/ti/cal/cal-camerarx.c

af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  167  
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  168  static void cal_camerarx_power(struct cal_camerarx *phy, bool enable)
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  169  {
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  170  	u32 target_state;
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  171  	unsigned int i;
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  172  
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  173  	target_state = enable ? CAL_CSI2_COMPLEXIO_CFG_PWR_CMD_STATE_ON :
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  174  		       CAL_CSI2_COMPLEXIO_CFG_PWR_CMD_STATE_OFF;
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  175  
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  176  	cal_write_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance),
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  177  			target_state, CAL_CSI2_COMPLEXIO_CFG_PWR_CMD_MASK);
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  178  
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  179  	for (i = 0; i < 10; i++) {
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  180  		u32 current_state;
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  181  
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  182  		current_state = cal_read_field(phy->cal,
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  183  					       CAL_CSI2_COMPLEXIO_CFG(phy->instance),
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  184  					       CAL_CSI2_COMPLEXIO_CFG_PWR_STATUS_MASK);
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  185  
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  186  		if (current_state == target_state)
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  187  			break;
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  188  
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  189  		usleep_range(1000, 1100);
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  190  	}
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  191  
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  192  	if (i == 10)
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06 @193  		phy_err(phy, "Failed to power %s complexio\n",
368e80f16a6aff drivers/media/platform/ti/cal/cal-camerarx.c Ricardo Ribalda  2024-09-27  194  			str_up_down(enable);
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  195  }
af30d4f36ef35d drivers/media/platform/ti-vpe/cal-camerarx.c Laurent Pinchart 2020-07-06  196  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2024-09-28  3:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 10:02 [PATCH v2 0/3] media: static-analyzers: Fix 6.12-rc1 cocci warnings Ricardo Ribalda
2024-09-27 10:02 ` [PATCH v2 1/3] media: ti: cal: Use str_up_down() Ricardo Ribalda
2024-09-27 10:10   ` Andy Shevchenko
2024-09-27 10:16     ` Ricardo Ribalda
2024-09-27 10:43       ` Andy Shevchenko
2024-09-28  2:53   ` kernel test robot
2024-09-28  3:14   ` kernel test robot
2024-09-27 10:02 ` [PATCH v2 2/3] staging: media: ipu3: Use str_down_up() Ricardo Ribalda
2024-09-27 10:02 ` [PATCH v2 3/3] media: atomisp: Use max() macros Ricardo Ribalda
2024-09-27 10:09   ` Andy Shevchenko
2024-09-27 10:09   ` Hans Verkuil
2024-09-27 10:10   ` Dan Carpenter

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