i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused
Subsystems (3)
PATCH 1/1 i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused
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.
--- drivers/i2c/busses/i2c-designware-platdrv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-designware-platdrv.c +2 -2
@@ -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
Signature · 1 line
2.35.1
Hi,
Quoted 11 lines · Nathan Chancellor
When
CONFIG_PMis set butCONFIG_PM_SLEEPis 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 intdw_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.
Quoted 7 lines
These functions are only used in
SET_LATE_SYSTEM_SLEEP_PM_OPS(), which is defined as empty whenCONFIG_PM_SLEEPis not defined. Mark the functions as__maybe_unusedto 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 <[email protected]>
Thanks, patch looks good to me:
Regards,
Hans
Quoted 28 lines
--- drivers/i2c/busses/i2c-designware-platdrv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/busses/i2c-designware-platdrv.c +2
-2@@ -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
Jarkko Nikula
Acked-byQuoted 19 lines · Hans de Goede
Hi,
Quoted 16 lines · Nathan Chancellor
When
CONFIG_PMis set butCONFIG_PM_SLEEPis 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 intdw_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 whenCONFIG_PM_SLEEPis not defined. Mark the functions as__maybe_unusedto make it clear that these functions might be unused in this configuration.
Quoted 7 lines
Quoted 2 lines
Fixes c57813b8b288 ("i2c: designware: Lock the adapter while setting the suspended flag")Signed-off-by Nathan Chancellor <[email protected]>Thanks, patch looks good to me:
Reviewed-by Hans de Goede <[email protected]>
Quoted 9 lines · Nathan Chancellor
When
CONFIG_PMis set butCONFIG_PM_SLEEPis 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 intdw_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) ^
Quoted 6 lines
2 errors generated.
These functions are only used in
SET_LATE_SYSTEM_SLEEP_PM_OPS(), which is defined as empty whenCONFIG_PM_SLEEPis not defined. Mark the functions as__maybe_unusedto make it clear that these functions might be unused in this configuration.
Thanks!
Quoted 33 lines
Fixes c57813b8b288 ("i2c: designware: Lock the adapter while setting the suspended flag")Signed-off-by Nathan Chancellor <[email protected]>--- drivers/i2c/busses/i2c-designware-platdrv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/busses/i2c-designware-platdrv.c +2
-2@@ -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:
1d366c2f9df8279df2adbb60471f86fc40a1c39eSignature · 1 line
2.35.1
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 11 lines · Nathan Chancellor
When
CONFIG_PMis set butCONFIG_PM_SLEEPis 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 intdw_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.
Quoted 7 lines
These functions are only used in
SET_LATE_SYSTEM_SLEEP_PM_OPS(), which is defined as empty whenCONFIG_PM_SLEEPis not defined. Mark the functions as__maybe_unusedto 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 <[email protected]>
As I just ran into this myself...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
Wolfram Sang
AppliedQuoted 11 lines · Nathan Chancellor
When
CONFIG_PMis set butCONFIG_PM_SLEEPis 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 intdw_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.
Quoted 7 lines
These functions are only used in
SET_LATE_SYSTEM_SLEEP_PM_OPS(), which is defined as empty whenCONFIG_PM_SLEEPis not defined. Mark the functions as__maybe_unusedto 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 <[email protected]>
Applied to for-next, thanks!