All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused
@ 2022-03-03 19:17 Nathan Chancellor
  2022-03-04 11:46 ` Hans de Goede
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Nathan Chancellor @ 2022-03-03 19:17 UTC (permalink / raw)
  To: Wolfram Sang, Jarkko Nikula
  Cc: Andy Shevchenko, Mika Westerberg, Jan Dabros, Hans de Goede,
	linux-i2c, patches, Nathan Chancellor

When CONFIG_PM is set but CONFIG_PM_SLEEP is not, two compiler warnings
appear:

  drivers/i2c/busses/i2c-designware-platdrv.c:444:12: error: unused function 'dw_i2c_plat_suspend' [-Werror,-Wunused-function]
  static int dw_i2c_plat_suspend(struct device *dev)
             ^
  drivers/i2c/busses/i2c-designware-platdrv.c:465:12: error: unused function 'dw_i2c_plat_resume' [-Werror,-Wunused-function]
  static int dw_i2c_plat_resume(struct device *dev)
             ^
  2 errors generated.

These functions are only used in SET_LATE_SYSTEM_SLEEP_PM_OPS(), which
is defined as empty when CONFIG_PM_SLEEP is not defined. Mark the
functions as __maybe_unused to make it clear that these functions might
be unused in this configuration.

Fixes: c57813b8b288 ("i2c: designware: Lock the adapter while setting the suspended flag")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 116a297d1f6b..70ade5306e45 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -441,7 +441,7 @@ static int dw_i2c_plat_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int dw_i2c_plat_suspend(struct device *dev)
+static int __maybe_unused dw_i2c_plat_suspend(struct device *dev)
 {
 	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
 
@@ -462,7 +462,7 @@ static int dw_i2c_plat_runtime_resume(struct device *dev)
 	return 0;
 }
 
-static int dw_i2c_plat_resume(struct device *dev)
+static int __maybe_unused dw_i2c_plat_resume(struct device *dev)
 {
 	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
 

base-commit: 1d366c2f9df8279df2adbb60471f86fc40a1c39e
-- 
2.35.1


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

* Re: [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused
  2022-03-03 19:17 [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused Nathan Chancellor
@ 2022-03-04 11:46 ` Hans de Goede
  2022-03-07  8:13   ` Jarkko Nikula
  2022-03-04 12:39 ` Andy Shevchenko
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2022-03-04 11:46 UTC (permalink / raw)
  To: Nathan Chancellor, Wolfram Sang, Jarkko Nikula
  Cc: Andy Shevchenko, Mika Westerberg, Jan Dabros, linux-i2c, patches

Hi,

On 3/3/22 20:17, Nathan Chancellor wrote:
> When CONFIG_PM is set but CONFIG_PM_SLEEP is not, two compiler warnings
> appear:
> 
>   drivers/i2c/busses/i2c-designware-platdrv.c:444:12: error: unused function 'dw_i2c_plat_suspend' [-Werror,-Wunused-function]
>   static int dw_i2c_plat_suspend(struct device *dev)
>              ^
>   drivers/i2c/busses/i2c-designware-platdrv.c:465:12: error: unused function 'dw_i2c_plat_resume' [-Werror,-Wunused-function]
>   static int dw_i2c_plat_resume(struct device *dev)
>              ^
>   2 errors generated.
> 
> These functions are only used in SET_LATE_SYSTEM_SLEEP_PM_OPS(), which
> is defined as empty when CONFIG_PM_SLEEP is not defined. Mark the
> functions as __maybe_unused to make it clear that these functions might
> be unused in this configuration.
> 
> Fixes: c57813b8b288 ("i2c: designware: Lock the adapter while setting the suspended flag")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> ---
>  drivers/i2c/busses/i2c-designware-platdrv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 116a297d1f6b..70ade5306e45 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -441,7 +441,7 @@ static int dw_i2c_plat_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int dw_i2c_plat_suspend(struct device *dev)
> +static int __maybe_unused dw_i2c_plat_suspend(struct device *dev)
>  {
>  	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
>  
> @@ -462,7 +462,7 @@ static int dw_i2c_plat_runtime_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static int dw_i2c_plat_resume(struct device *dev)
> +static int __maybe_unused dw_i2c_plat_resume(struct device *dev)
>  {
>  	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
>  
> 
> base-commit: 1d366c2f9df8279df2adbb60471f86fc40a1c39e


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

* Re: [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused
  2022-03-03 19:17 [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused Nathan Chancellor
  2022-03-04 11:46 ` Hans de Goede
@ 2022-03-04 12:39 ` Andy Shevchenko
  2022-03-08 14:17 ` Geert Uytterhoeven
  2022-03-11 20:39 ` Wolfram Sang
  3 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2022-03-04 12:39 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Wolfram Sang, Jarkko Nikula, Mika Westerberg, Jan Dabros,
	Hans de Goede, linux-i2c, patches

On Thu, Mar 03, 2022 at 12:17:13PM -0700, Nathan Chancellor wrote:
> When CONFIG_PM is set but CONFIG_PM_SLEEP is not, two compiler warnings
> appear:
> 
>   drivers/i2c/busses/i2c-designware-platdrv.c:444:12: error: unused function 'dw_i2c_plat_suspend' [-Werror,-Wunused-function]
>   static int dw_i2c_plat_suspend(struct device *dev)
>              ^
>   drivers/i2c/busses/i2c-designware-platdrv.c:465:12: error: unused function 'dw_i2c_plat_resume' [-Werror,-Wunused-function]
>   static int dw_i2c_plat_resume(struct device *dev)
>              ^
>   2 errors generated.
> 
> These functions are only used in SET_LATE_SYSTEM_SLEEP_PM_OPS(), which
> is defined as empty when CONFIG_PM_SLEEP is not defined. Mark the
> functions as __maybe_unused to make it clear that these functions might
> be unused in this configuration.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks!


> Fixes: c57813b8b288 ("i2c: designware: Lock the adapter while setting the suspended flag")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  drivers/i2c/busses/i2c-designware-platdrv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 116a297d1f6b..70ade5306e45 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -441,7 +441,7 @@ static int dw_i2c_plat_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int dw_i2c_plat_suspend(struct device *dev)
> +static int __maybe_unused dw_i2c_plat_suspend(struct device *dev)
>  {
>  	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
>  
> @@ -462,7 +462,7 @@ static int dw_i2c_plat_runtime_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static int dw_i2c_plat_resume(struct device *dev)
> +static int __maybe_unused dw_i2c_plat_resume(struct device *dev)
>  {
>  	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
>  
> 
> base-commit: 1d366c2f9df8279df2adbb60471f86fc40a1c39e
> -- 
> 2.35.1
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused
  2022-03-04 11:46 ` Hans de Goede
@ 2022-03-07  8:13   ` Jarkko Nikula
  0 siblings, 0 replies; 6+ messages in thread
From: Jarkko Nikula @ 2022-03-07  8:13 UTC (permalink / raw)
  To: Hans de Goede, Nathan Chancellor, Wolfram Sang
  Cc: Andy Shevchenko, Mika Westerberg, Jan Dabros, linux-i2c, patches

On 3/4/22 13:46, Hans de Goede wrote:
> Hi,
> 
> On 3/3/22 20:17, Nathan Chancellor wrote:
>> When CONFIG_PM is set but CONFIG_PM_SLEEP is not, two compiler warnings
>> appear:
>>
>>    drivers/i2c/busses/i2c-designware-platdrv.c:444:12: error: unused function 'dw_i2c_plat_suspend' [-Werror,-Wunused-function]
>>    static int dw_i2c_plat_suspend(struct device *dev)
>>               ^
>>    drivers/i2c/busses/i2c-designware-platdrv.c:465:12: error: unused function 'dw_i2c_plat_resume' [-Werror,-Wunused-function]
>>    static int dw_i2c_plat_resume(struct device *dev)
>>               ^
>>    2 errors generated.
>>
>> These functions are only used in SET_LATE_SYSTEM_SLEEP_PM_OPS(), which
>> is defined as empty when CONFIG_PM_SLEEP is not defined. Mark the
>> functions as __maybe_unused to make it clear that these functions might
>> be unused in this configuration.
>>
>> Fixes: c57813b8b288 ("i2c: designware: Lock the adapter while setting the suspended flag")
>> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> 
> Thanks, patch looks good to me:
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

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

* Re: [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused
  2022-03-03 19:17 [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused Nathan Chancellor
  2022-03-04 11:46 ` Hans de Goede
  2022-03-04 12:39 ` Andy Shevchenko
@ 2022-03-08 14:17 ` Geert Uytterhoeven
  2022-03-11 20:39 ` Wolfram Sang
  3 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-03-08 14:17 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Wolfram Sang, Jarkko Nikula, Andy Shevchenko, Mika Westerberg,
	Jan Dabros, Hans de Goede, linux-i2c, patches

On Thu, 3 Mar 2022, Nathan Chancellor wrote:
> When CONFIG_PM is set but CONFIG_PM_SLEEP is not, two compiler warnings
> appear:
>
>  drivers/i2c/busses/i2c-designware-platdrv.c:444:12: error: unused function 'dw_i2c_plat_suspend' [-Werror,-Wunused-function]
>  static int dw_i2c_plat_suspend(struct device *dev)
>             ^
>  drivers/i2c/busses/i2c-designware-platdrv.c:465:12: error: unused function 'dw_i2c_plat_resume' [-Werror,-Wunused-function]
>  static int dw_i2c_plat_resume(struct device *dev)
>             ^
>  2 errors generated.
>
> These functions are only used in SET_LATE_SYSTEM_SLEEP_PM_OPS(), which
> is defined as empty when CONFIG_PM_SLEEP is not defined. Mark the
> functions as __maybe_unused to make it clear that these functions might
> be unused in this configuration.
>
> Fixes: c57813b8b288 ("i2c: designware: Lock the adapter while setting the suspended flag")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

As I just ran into this myself...

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

 						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
 							    -- Linus Torvalds

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

* Re: [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused
  2022-03-03 19:17 [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused Nathan Chancellor
                   ` (2 preceding siblings ...)
  2022-03-08 14:17 ` Geert Uytterhoeven
@ 2022-03-11 20:39 ` Wolfram Sang
  3 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2022-03-11 20:39 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Jarkko Nikula, Andy Shevchenko, Mika Westerberg, Jan Dabros,
	Hans de Goede, linux-i2c, patches

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

On Thu, Mar 03, 2022 at 12:17:13PM -0700, Nathan Chancellor wrote:
> When CONFIG_PM is set but CONFIG_PM_SLEEP is not, two compiler warnings
> appear:
> 
>   drivers/i2c/busses/i2c-designware-platdrv.c:444:12: error: unused function 'dw_i2c_plat_suspend' [-Werror,-Wunused-function]
>   static int dw_i2c_plat_suspend(struct device *dev)
>              ^
>   drivers/i2c/busses/i2c-designware-platdrv.c:465:12: error: unused function 'dw_i2c_plat_resume' [-Werror,-Wunused-function]
>   static int dw_i2c_plat_resume(struct device *dev)
>              ^
>   2 errors generated.
> 
> These functions are only used in SET_LATE_SYSTEM_SLEEP_PM_OPS(), which
> is defined as empty when CONFIG_PM_SLEEP is not defined. Mark the
> functions as __maybe_unused to make it clear that these functions might
> be unused in this configuration.
> 
> Fixes: c57813b8b288 ("i2c: designware: Lock the adapter while setting the suspended flag")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Applied to for-next, thanks!


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

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

end of thread, other threads:[~2022-03-11 20:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 19:17 [PATCH -next] i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused Nathan Chancellor
2022-03-04 11:46 ` Hans de Goede
2022-03-07  8:13   ` Jarkko Nikula
2022-03-04 12:39 ` Andy Shevchenko
2022-03-08 14:17 ` Geert Uytterhoeven
2022-03-11 20:39 ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.