diff mbox

[v2,2/2] ASoC: cs43130: Fix unused compiler warnings for PM runtime

Message ID 20170904135448.26314-2-tiwai@suse.de (mailing list archive)
State Accepted
Commit 7051334672e54fae67e02d5d3296fb62b3343be7
Headers show

Commit Message

Takashi Iwai Sept. 4, 2017, 1:54 p.m. UTC
Add __maybe_unused prefix for addressing the following warnings:
  sound/soc/codecs/cs43130.c:2615:12: warning: ‘cs43130_runtime_resume’ defined but not used [-Wunused-function]
  sound/soc/codecs/cs43130.c:2596:12: warning: ‘cs43130_runtime_suspend’ defined but not used [-Wunused-function]

Fixes: 8f1e5bf9b440 ("ASoC: cs43130: Add support for CS43130 codec")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
v1->v2: Put the prefix to correct functions

 sound/soc/codecs/cs43130.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Baluta Sept. 4, 2017, 2:31 p.m. UTC | #1
On Lu, 2017-09-04 at 15:54 +0200, Takashi Iwai wrote:
> Add __maybe_unused prefix for addressing the following warnings:

>   sound/soc/codecs/cs43130.c:2615:12: warning: ‘cs43130_runtime_resume’ defined but not used [-Wunused-function]

>   sound/soc/codecs/cs43130.c:2596:12: warning: ‘cs43130_runtime_suspend’ defined but not used [-Wunused-function]

> 


Isn't it better to guard it with CONFIG_PM?

thanks,
Daniel.
Takashi Iwai Sept. 4, 2017, 2:34 p.m. UTC | #2
On Mon, 04 Sep 2017 16:31:03 +0200,
Daniel Baluta wrote:
> 
> On Lu, 2017-09-04 at 15:54 +0200, Takashi Iwai wrote:
> > Add __maybe_unused prefix for addressing the following warnings:
> >   sound/soc/codecs/cs43130.c:2615:12: warning: ‘cs43130_runtime_resume’ defined but not used [-Wunused-function]
> >   sound/soc/codecs/cs43130.c:2596:12: warning: ‘cs43130_runtime_suspend’ defined but not used [-Wunused-function]
> > 
> 
> Isn't it better to guard it with CONFIG_PM?

It's a matter of taste, and people seem prefer this option nowadays,
so I follow that style.


Takashi
Mark Brown Sept. 4, 2017, 2:44 p.m. UTC | #3
On Mon, Sep 04, 2017 at 04:34:47PM +0200, Takashi Iwai wrote:
> Daniel Baluta wrote:

> > Isn't it better to guard it with CONFIG_PM?

> It's a matter of taste, and people seem prefer this option nowadays,
> so I follow that style.

The ifdefs are a complete pain every time someone decides they want to
do something amusing with the configuration for PM or if people want to
share things between the runtime and system suspend paths.
Daniel Baluta Sept. 4, 2017, 3:46 p.m. UTC | #4
On Lu, 2017-09-04 at 15:44 +0100, Mark Brown wrote:
> On Mon, Sep 04, 2017 at 04:34:47PM +0200, Takashi Iwai wrote:

> > 

> > Daniel Baluta wrote:

> > 

> > > 

> > > Isn't it better to guard it with CONFIG_PM?

> > 

> > It's a matter of taste, and people seem prefer this option nowadays,

> > so I follow that style.

> The ifdefs are a complete pain every time someone decides they want to

> do something amusing with the configuration for PM or if people want to

> share things between the runtime and system suspend paths.


Fine by me. It's just that most of the time I've seen CONFIG_PM approach :).
diff mbox

Patch

diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index 3fe3b8d644b7..92b7f0e102b0 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -2597,7 +2597,7 @@  static int cs43130_i2c_remove(struct i2c_client *client)
 	return 0;
 }
 
-static int cs43130_runtime_suspend(struct device *dev)
+static int __maybe_unused cs43130_runtime_suspend(struct device *dev)
 {
 	struct cs43130_private *cs43130 = dev_get_drvdata(dev);
 
@@ -2616,7 +2616,7 @@  static int cs43130_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int cs43130_runtime_resume(struct device *dev)
+static int __maybe_unused cs43130_runtime_resume(struct device *dev)
 {
 	struct cs43130_private *cs43130 = dev_get_drvdata(dev);
 	int ret;