linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec: Make cros_ec_unregister() return void
@ 2021-10-19 20:38 Uwe Kleine-König
  2021-10-19 21:31 ` Guenter Roeck
  2021-10-20 13:28 ` [PATCH] platform/chrome: cros_ec: Make cros_ec_unregister() " kernel test robot
  0 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2021-10-19 20:38 UTC (permalink / raw)
  To: Benson Leung, Enric Balletbo i Serra; +Cc: Guenter Roeck, linux-kernel, kernel

Up to now cros_ec_unregister() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.

Also the return value of i2c, platform and spi remove callbacks is
ignored anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/platform/chrome/cros_ec.c     | 2 +-
 drivers/platform/chrome/cros_ec.h     | 2 +-
 drivers/platform/chrome/cros_ec_i2c.c | 4 +++-
 drivers/platform/chrome/cros_ec_lpc.c | 4 +++-
 drivers/platform/chrome/cros_ec_spi.c | 4 +++-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index fc5aa1525d13..eeb94b3563e2 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -302,7 +302,7 @@ EXPORT_SYMBOL(cros_ec_register);
  *
  * Return: 0 on success or negative error code.
  */
-int cros_ec_unregister(struct cros_ec_device *ec_dev)
+void cros_ec_unregister(struct cros_ec_device *ec_dev)
 {
 	if (ec_dev->pd)
 		platform_device_unregister(ec_dev->pd);
diff --git a/drivers/platform/chrome/cros_ec.h b/drivers/platform/chrome/cros_ec.h
index 78363dcfdf23..bbca0096868a 100644
--- a/drivers/platform/chrome/cros_ec.h
+++ b/drivers/platform/chrome/cros_ec.h
@@ -11,7 +11,7 @@
 #include <linux/interrupt.h>
 
 int cros_ec_register(struct cros_ec_device *ec_dev);
-int cros_ec_unregister(struct cros_ec_device *ec_dev);
+void cros_ec_unregister(struct cros_ec_device *ec_dev);
 
 int cros_ec_suspend(struct cros_ec_device *ec_dev);
 int cros_ec_resume(struct cros_ec_device *ec_dev);
diff --git a/drivers/platform/chrome/cros_ec_i2c.c b/drivers/platform/chrome/cros_ec_i2c.c
index 30c8938c27d5..22feb0fd4ce7 100644
--- a/drivers/platform/chrome/cros_ec_i2c.c
+++ b/drivers/platform/chrome/cros_ec_i2c.c
@@ -313,7 +313,9 @@ static int cros_ec_i2c_remove(struct i2c_client *client)
 {
 	struct cros_ec_device *ec_dev = i2c_get_clientdata(client);
 
-	return cros_ec_unregister(ec_dev);
+	cros_ec_unregister(ec_dev);
+
+	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 1f7861944044..8527a1bac765 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -439,7 +439,9 @@ static int cros_ec_lpc_remove(struct platform_device *pdev)
 		acpi_remove_notify_handler(adev->handle, ACPI_ALL_NOTIFY,
 					   cros_ec_lpc_acpi_notify);
 
-	return cros_ec_unregister(ec_dev);
+	cros_ec_unregister(ec_dev);
+
+	return 0;
 }
 
 static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] = {
diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
index 14c4046fa04d..713c58687721 100644
--- a/drivers/platform/chrome/cros_ec_spi.c
+++ b/drivers/platform/chrome/cros_ec_spi.c
@@ -790,7 +790,9 @@ static int cros_ec_spi_remove(struct spi_device *spi)
 {
 	struct cros_ec_device *ec_dev = spi_get_drvdata(spi);
 
-	return cros_ec_unregister(ec_dev);
+	cros_ec_unregister(ec_dev);
+
+	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.30.2


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

* Re: [PATCH] platform/chrome: cros_ec: Make cros_ec_unregister() return void
  2021-10-19 20:38 [PATCH] platform/chrome: cros_ec: Make cros_ec_unregister() return void Uwe Kleine-König
@ 2021-10-19 21:31 ` Guenter Roeck
  2021-10-20  7:17   ` [PATCH v2] platform/chrome: cros_ec: Make cros_ec_unregister() return " Uwe Kleine-König
  2021-10-20 13:28 ` [PATCH] platform/chrome: cros_ec: Make cros_ec_unregister() " kernel test robot
  1 sibling, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2021-10-19 21:31 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Benson Leung, Enric Balletbo i Serra, Guenter Roeck,
	linux-kernel, kernel

On Tue, Oct 19, 2021 at 1:39 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> Up to now cros_ec_unregister() returns zero unconditionally. Make it
> return void instead which makes it easier to see in the callers that
> there is no error to handle.
>
> Also the return value of i2c, platform and spi remove callbacks is
> ignored anyway.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/platform/chrome/cros_ec.c     | 2 +-
>  drivers/platform/chrome/cros_ec.h     | 2 +-
>  drivers/platform/chrome/cros_ec_i2c.c | 4 +++-
>  drivers/platform/chrome/cros_ec_lpc.c | 4 +++-
>  drivers/platform/chrome/cros_ec_spi.c | 4 +++-
>  5 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
> index fc5aa1525d13..eeb94b3563e2 100644
> --- a/drivers/platform/chrome/cros_ec.c
> +++ b/drivers/platform/chrome/cros_ec.c
> @@ -302,7 +302,7 @@ EXPORT_SYMBOL(cros_ec_register);
>   *
>   * Return: 0 on success or negative error code.
>   */
> -int cros_ec_unregister(struct cros_ec_device *ec_dev)
> +void cros_ec_unregister(struct cros_ec_device *ec_dev)
>  {
>         if (ec_dev->pd)
>                 platform_device_unregister(ec_dev->pd);

Isn't there a "return 0;" hiding about here which would now result in
a compile error ?

Guenter

> diff --git a/drivers/platform/chrome/cros_ec.h b/drivers/platform/chrome/cros_ec.h
> index 78363dcfdf23..bbca0096868a 100644
> --- a/drivers/platform/chrome/cros_ec.h
> +++ b/drivers/platform/chrome/cros_ec.h
> @@ -11,7 +11,7 @@
>  #include <linux/interrupt.h>
>
>  int cros_ec_register(struct cros_ec_device *ec_dev);
> -int cros_ec_unregister(struct cros_ec_device *ec_dev);
> +void cros_ec_unregister(struct cros_ec_device *ec_dev);
>
>  int cros_ec_suspend(struct cros_ec_device *ec_dev);
>  int cros_ec_resume(struct cros_ec_device *ec_dev);
> diff --git a/drivers/platform/chrome/cros_ec_i2c.c b/drivers/platform/chrome/cros_ec_i2c.c
> index 30c8938c27d5..22feb0fd4ce7 100644
> --- a/drivers/platform/chrome/cros_ec_i2c.c
> +++ b/drivers/platform/chrome/cros_ec_i2c.c
> @@ -313,7 +313,9 @@ static int cros_ec_i2c_remove(struct i2c_client *client)
>  {
>         struct cros_ec_device *ec_dev = i2c_get_clientdata(client);
>
> -       return cros_ec_unregister(ec_dev);
> +       cros_ec_unregister(ec_dev);
> +
> +       return 0;
>  }
>
>  #ifdef CONFIG_PM_SLEEP
> diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
> index 1f7861944044..8527a1bac765 100644
> --- a/drivers/platform/chrome/cros_ec_lpc.c
> +++ b/drivers/platform/chrome/cros_ec_lpc.c
> @@ -439,7 +439,9 @@ static int cros_ec_lpc_remove(struct platform_device *pdev)
>                 acpi_remove_notify_handler(adev->handle, ACPI_ALL_NOTIFY,
>                                            cros_ec_lpc_acpi_notify);
>
> -       return cros_ec_unregister(ec_dev);
> +       cros_ec_unregister(ec_dev);
> +
> +       return 0;
>  }
>
>  static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] = {
> diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
> index 14c4046fa04d..713c58687721 100644
> --- a/drivers/platform/chrome/cros_ec_spi.c
> +++ b/drivers/platform/chrome/cros_ec_spi.c
> @@ -790,7 +790,9 @@ static int cros_ec_spi_remove(struct spi_device *spi)
>  {
>         struct cros_ec_device *ec_dev = spi_get_drvdata(spi);
>
> -       return cros_ec_unregister(ec_dev);
> +       cros_ec_unregister(ec_dev);
> +
> +       return 0;
>  }
>
>  #ifdef CONFIG_PM_SLEEP
> --
> 2.30.2
>

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

* [PATCH v2] platform/chrome: cros_ec: Make cros_ec_unregister() return return void
  2021-10-19 21:31 ` Guenter Roeck
@ 2021-10-20  7:17   ` Uwe Kleine-König
  2021-10-20 12:54     ` Guenter Roeck
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2021-10-20  7:17 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Enric Balletbo i Serra, Guenter Roeck, Benson Leung,
	linux-kernel, kernel

[-- Attachment #1: Type: text/plain, Size: 4062 bytes --]

Up to now cros_ec_unregister() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.

Also the return value of i2c, platform and spi remove callbacks is
ignored anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
On Tue, Oct 19, 2021 at 02:31:46PM -0700, Guenter Roeck wrote:
> On Tue, Oct 19, 2021 at 1:39 PM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> > -int cros_ec_unregister(struct cros_ec_device *ec_dev)
> > +void cros_ec_unregister(struct cros_ec_device *ec_dev)
> >  {
> >         if (ec_dev->pd)
> >                 platform_device_unregister(ec_dev->pd);
> 
> Isn't there a "return 0;" hiding about here which would now result in
> a compile error ?

Argh, you're right. I forgot to squash this in after my build test :-\
Here's a v2.

Thanks
Uwe

 drivers/platform/chrome/cros_ec.c     | 4 +---
 drivers/platform/chrome/cros_ec.h     | 2 +-
 drivers/platform/chrome/cros_ec_i2c.c | 4 +++-
 drivers/platform/chrome/cros_ec_lpc.c | 4 +++-
 drivers/platform/chrome/cros_ec_spi.c | 4 +++-
 5 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index fc5aa1525d13..d49a4efe46c8 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -302,13 +302,11 @@ EXPORT_SYMBOL(cros_ec_register);
  *
  * Return: 0 on success or negative error code.
  */
-int cros_ec_unregister(struct cros_ec_device *ec_dev)
+void cros_ec_unregister(struct cros_ec_device *ec_dev)
 {
 	if (ec_dev->pd)
 		platform_device_unregister(ec_dev->pd);
 	platform_device_unregister(ec_dev->ec);
-
-	return 0;
 }
 EXPORT_SYMBOL(cros_ec_unregister);
 
diff --git a/drivers/platform/chrome/cros_ec.h b/drivers/platform/chrome/cros_ec.h
index 78363dcfdf23..bbca0096868a 100644
--- a/drivers/platform/chrome/cros_ec.h
+++ b/drivers/platform/chrome/cros_ec.h
@@ -11,7 +11,7 @@
 #include <linux/interrupt.h>
 
 int cros_ec_register(struct cros_ec_device *ec_dev);
-int cros_ec_unregister(struct cros_ec_device *ec_dev);
+void cros_ec_unregister(struct cros_ec_device *ec_dev);
 
 int cros_ec_suspend(struct cros_ec_device *ec_dev);
 int cros_ec_resume(struct cros_ec_device *ec_dev);
diff --git a/drivers/platform/chrome/cros_ec_i2c.c b/drivers/platform/chrome/cros_ec_i2c.c
index 30c8938c27d5..22feb0fd4ce7 100644
--- a/drivers/platform/chrome/cros_ec_i2c.c
+++ b/drivers/platform/chrome/cros_ec_i2c.c
@@ -313,7 +313,9 @@ static int cros_ec_i2c_remove(struct i2c_client *client)
 {
 	struct cros_ec_device *ec_dev = i2c_get_clientdata(client);
 
-	return cros_ec_unregister(ec_dev);
+	cros_ec_unregister(ec_dev);
+
+	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 1f7861944044..8527a1bac765 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -439,7 +439,9 @@ static int cros_ec_lpc_remove(struct platform_device *pdev)
 		acpi_remove_notify_handler(adev->handle, ACPI_ALL_NOTIFY,
 					   cros_ec_lpc_acpi_notify);
 
-	return cros_ec_unregister(ec_dev);
+	cros_ec_unregister(ec_dev);
+
+	return 0;
 }
 
 static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] = {
diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
index 14c4046fa04d..713c58687721 100644
--- a/drivers/platform/chrome/cros_ec_spi.c
+++ b/drivers/platform/chrome/cros_ec_spi.c
@@ -790,7 +790,9 @@ static int cros_ec_spi_remove(struct spi_device *spi)
 {
 	struct cros_ec_device *ec_dev = spi_get_drvdata(spi);
 
-	return cros_ec_unregister(ec_dev);
+	cros_ec_unregister(ec_dev);
+
+	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.30.2

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2] platform/chrome: cros_ec: Make cros_ec_unregister() return return void
  2021-10-20  7:17   ` [PATCH v2] platform/chrome: cros_ec: Make cros_ec_unregister() return " Uwe Kleine-König
@ 2021-10-20 12:54     ` Guenter Roeck
  2022-01-04 23:19       ` Uwe Kleine-König
  0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2021-10-20 12:54 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Enric Balletbo i Serra, Guenter Roeck, Benson Leung,
	linux-kernel, kernel

On Wed, Oct 20, 2021 at 12:17 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> Up to now cros_ec_unregister() returns zero unconditionally. Make it
> return void instead which makes it easier to see in the callers that
> there is no error to handle.
>
> Also the return value of i2c, platform and spi remove callbacks is
> ignored anyway.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Guenter Roeck <groeck@chromium.org>

> ---
> On Tue, Oct 19, 2021 at 02:31:46PM -0700, Guenter Roeck wrote:
> > On Tue, Oct 19, 2021 at 1:39 PM Uwe Kleine-König
> > <u.kleine-koenig@pengutronix.de> wrote:
> > > -int cros_ec_unregister(struct cros_ec_device *ec_dev)
> > > +void cros_ec_unregister(struct cros_ec_device *ec_dev)
> > >  {
> > >         if (ec_dev->pd)
> > >                 platform_device_unregister(ec_dev->pd);
> >
> > Isn't there a "return 0;" hiding about here which would now result in
> > a compile error ?
>
> Argh, you're right. I forgot to squash this in after my build test :-\
> Here's a v2.
>
> Thanks
> Uwe
>
>  drivers/platform/chrome/cros_ec.c     | 4 +---
>  drivers/platform/chrome/cros_ec.h     | 2 +-
>  drivers/platform/chrome/cros_ec_i2c.c | 4 +++-
>  drivers/platform/chrome/cros_ec_lpc.c | 4 +++-
>  drivers/platform/chrome/cros_ec_spi.c | 4 +++-
>  5 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
> index fc5aa1525d13..d49a4efe46c8 100644
> --- a/drivers/platform/chrome/cros_ec.c
> +++ b/drivers/platform/chrome/cros_ec.c
> @@ -302,13 +302,11 @@ EXPORT_SYMBOL(cros_ec_register);
>   *
>   * Return: 0 on success or negative error code.
>   */
> -int cros_ec_unregister(struct cros_ec_device *ec_dev)
> +void cros_ec_unregister(struct cros_ec_device *ec_dev)
>  {
>         if (ec_dev->pd)
>                 platform_device_unregister(ec_dev->pd);
>         platform_device_unregister(ec_dev->ec);
> -
> -       return 0;
>  }
>  EXPORT_SYMBOL(cros_ec_unregister);
>
> diff --git a/drivers/platform/chrome/cros_ec.h b/drivers/platform/chrome/cros_ec.h
> index 78363dcfdf23..bbca0096868a 100644
> --- a/drivers/platform/chrome/cros_ec.h
> +++ b/drivers/platform/chrome/cros_ec.h
> @@ -11,7 +11,7 @@
>  #include <linux/interrupt.h>
>
>  int cros_ec_register(struct cros_ec_device *ec_dev);
> -int cros_ec_unregister(struct cros_ec_device *ec_dev);
> +void cros_ec_unregister(struct cros_ec_device *ec_dev);
>
>  int cros_ec_suspend(struct cros_ec_device *ec_dev);
>  int cros_ec_resume(struct cros_ec_device *ec_dev);
> diff --git a/drivers/platform/chrome/cros_ec_i2c.c b/drivers/platform/chrome/cros_ec_i2c.c
> index 30c8938c27d5..22feb0fd4ce7 100644
> --- a/drivers/platform/chrome/cros_ec_i2c.c
> +++ b/drivers/platform/chrome/cros_ec_i2c.c
> @@ -313,7 +313,9 @@ static int cros_ec_i2c_remove(struct i2c_client *client)
>  {
>         struct cros_ec_device *ec_dev = i2c_get_clientdata(client);
>
> -       return cros_ec_unregister(ec_dev);
> +       cros_ec_unregister(ec_dev);
> +
> +       return 0;
>  }
>
>  #ifdef CONFIG_PM_SLEEP
> diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
> index 1f7861944044..8527a1bac765 100644
> --- a/drivers/platform/chrome/cros_ec_lpc.c
> +++ b/drivers/platform/chrome/cros_ec_lpc.c
> @@ -439,7 +439,9 @@ static int cros_ec_lpc_remove(struct platform_device *pdev)
>                 acpi_remove_notify_handler(adev->handle, ACPI_ALL_NOTIFY,
>                                            cros_ec_lpc_acpi_notify);
>
> -       return cros_ec_unregister(ec_dev);
> +       cros_ec_unregister(ec_dev);
> +
> +       return 0;
>  }
>
>  static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] = {
> diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
> index 14c4046fa04d..713c58687721 100644
> --- a/drivers/platform/chrome/cros_ec_spi.c
> +++ b/drivers/platform/chrome/cros_ec_spi.c
> @@ -790,7 +790,9 @@ static int cros_ec_spi_remove(struct spi_device *spi)
>  {
>         struct cros_ec_device *ec_dev = spi_get_drvdata(spi);
>
> -       return cros_ec_unregister(ec_dev);
> +       cros_ec_unregister(ec_dev);
> +
> +       return 0;
>  }
>
>  #ifdef CONFIG_PM_SLEEP
> --
> 2.30.2
>
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ |

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

* Re: [PATCH] platform/chrome: cros_ec: Make cros_ec_unregister() return void
  2021-10-19 20:38 [PATCH] platform/chrome: cros_ec: Make cros_ec_unregister() return void Uwe Kleine-König
  2021-10-19 21:31 ` Guenter Roeck
@ 2021-10-20 13:28 ` kernel test robot
  1 sibling, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-10-20 13:28 UTC (permalink / raw)
  To: Uwe Kleine-König, Benson Leung, Enric Balletbo i Serra
  Cc: llvm, kbuild-all, Guenter Roeck, linux-kernel, kernel

[-- Attachment #1: Type: text/plain, Size: 4172 bytes --]

Hi "Uwe,

I love your patch! Yet something to improve:

[auto build test ERROR on chrome-platform/for-next]
[also build test ERROR on v5.15-rc6 next-20211020]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Uwe-Kleine-K-nig/platform-chrome-cros_ec-Make-cros_ec_unregister-return-void/20211020-044024
base:   https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next
config: arm64-randconfig-r001-20211019 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 92a0389b0425a9535a99a0ce13ba0eeda2bce7ad)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/d2c1956b7b20b3b031619b800d1a3fffe98562fa
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Uwe-Kleine-K-nig/platform-chrome-cros_ec-Make-cros_ec_unregister-return-void/20211020-044024
        git checkout d2c1956b7b20b3b031619b800d1a3fffe98562fa
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/platform/chrome/cros_ec.c:311:2: error: void function 'cros_ec_unregister' should not return a value [-Wreturn-type]
           return 0;
           ^      ~
   1 error generated.


vim +/cros_ec_unregister +311 drivers/platform/chrome/cros_ec.c

4ab6174e8cdb00 drivers/mfd/cros_ec.c             Simon Glass            2013-02-25  296  
c9b465683a5542 drivers/platform/chrome/cros_ec.c Gwendal Grignou        2019-11-19  297  /**
c9b465683a5542 drivers/platform/chrome/cros_ec.c Gwendal Grignou        2019-11-19  298   * cros_ec_unregister() - Remove a ChromeOS EC.
c9b465683a5542 drivers/platform/chrome/cros_ec.c Gwendal Grignou        2019-11-19  299   * @ec_dev: Device to unregister.
c9b465683a5542 drivers/platform/chrome/cros_ec.c Gwendal Grignou        2019-11-19  300   *
c9b465683a5542 drivers/platform/chrome/cros_ec.c Gwendal Grignou        2019-11-19  301   * Call this to deregister a ChromeOS EC, then clean up any private data.
c9b465683a5542 drivers/platform/chrome/cros_ec.c Gwendal Grignou        2019-11-19  302   *
c9b465683a5542 drivers/platform/chrome/cros_ec.c Gwendal Grignou        2019-11-19  303   * Return: 0 on success or negative error code.
c9b465683a5542 drivers/platform/chrome/cros_ec.c Gwendal Grignou        2019-11-19  304   */
d2c1956b7b20b3 drivers/platform/chrome/cros_ec.c Uwe Kleine-König       2021-10-19  305  void cros_ec_unregister(struct cros_ec_device *ec_dev)
7aa703bb882438 drivers/mfd/cros_ec.c             Enric Balletbo i Serra 2019-09-02  306  {
7aa703bb882438 drivers/mfd/cros_ec.c             Enric Balletbo i Serra 2019-09-02  307  	if (ec_dev->pd)
7aa703bb882438 drivers/mfd/cros_ec.c             Enric Balletbo i Serra 2019-09-02  308  		platform_device_unregister(ec_dev->pd);
7aa703bb882438 drivers/mfd/cros_ec.c             Enric Balletbo i Serra 2019-09-02  309  	platform_device_unregister(ec_dev->ec);
7aa703bb882438 drivers/mfd/cros_ec.c             Enric Balletbo i Serra 2019-09-02  310  
7aa703bb882438 drivers/mfd/cros_ec.c             Enric Balletbo i Serra 2019-09-02 @311  	return 0;
7aa703bb882438 drivers/mfd/cros_ec.c             Enric Balletbo i Serra 2019-09-02  312  }
7aa703bb882438 drivers/mfd/cros_ec.c             Enric Balletbo i Serra 2019-09-02  313  EXPORT_SYMBOL(cros_ec_unregister);
7aa703bb882438 drivers/mfd/cros_ec.c             Enric Balletbo i Serra 2019-09-02  314  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 39586 bytes --]

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

* Re: [PATCH v2] platform/chrome: cros_ec: Make cros_ec_unregister() return return void
  2021-10-20 12:54     ` Guenter Roeck
@ 2022-01-04 23:19       ` Uwe Kleine-König
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2022-01-04 23:19 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Enric Balletbo i Serra, Guenter Roeck, Benson Leung,
	linux-kernel, kernel

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

Hello,

On Wed, Oct 20, 2021 at 05:54:24AM -0700, Guenter Roeck wrote:
> On Wed, Oct 20, 2021 at 12:17 AM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> >
> > Up to now cros_ec_unregister() returns zero unconditionally. Make it
> > return void instead which makes it easier to see in the callers that
> > there is no error to handle.
> >
> > Also the return value of i2c, platform and spi remove callbacks is
> > ignored anyway.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Reviewed-by: Guenter Roeck <groeck@chromium.org>

This patch is one of the very few ones that are still required to change
spi_driver::remove to return void.

It doesn't appear in next up to now. Who feels responsible to merge it?
If it's still possible to go in during the next merge window this would
be great. I guess we'll have to prepare an unmutable branch to change
struct spi_driver and the patch can also be included there.

Whatever works best for the involved maintainers ... I just have to know
your preferences.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2022-01-04 23:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 20:38 [PATCH] platform/chrome: cros_ec: Make cros_ec_unregister() return void Uwe Kleine-König
2021-10-19 21:31 ` Guenter Roeck
2021-10-20  7:17   ` [PATCH v2] platform/chrome: cros_ec: Make cros_ec_unregister() return " Uwe Kleine-König
2021-10-20 12:54     ` Guenter Roeck
2022-01-04 23:19       ` Uwe Kleine-König
2021-10-20 13:28 ` [PATCH] platform/chrome: cros_ec: Make cros_ec_unregister() " kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).