2020-02-03 03:12:36

by Hongbo Yao

[permalink] [raw]
Subject: [PATCH -next] ASoc: rt1015: make symbol rt1015_aif_dai_ops and rt1015_dai static

Fix sparse warning:
sound/soc/codecs/rt1015.c: warning: symbol 'rt1015_aif_dai_ops'
was not declared. Should it be static?
sound/soc/codecs/rt1015.c: warning: symbol 'rt1015_dai' was not
declared. Should it be static?

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Hongbo Yao <[email protected]>
---
sound/soc/codecs/rt1015.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c
index 6d490e2dbc25..de8f75d7cf5a 100644
--- a/sound/soc/codecs/rt1015.c
+++ b/sound/soc/codecs/rt1015.c
@@ -841,12 +841,12 @@ static void rt1015_remove(struct snd_soc_component *component)
#define RT1015_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)

-struct snd_soc_dai_ops rt1015_aif_dai_ops = {
+static struct snd_soc_dai_ops rt1015_aif_dai_ops = {
.hw_params = rt1015_hw_params,
.set_fmt = rt1015_set_dai_fmt,
};

-struct snd_soc_dai_driver rt1015_dai[] = {
+static struct snd_soc_dai_driver rt1015_dai[] = {
{
.name = "rt1015-aif",
.id = 0,
--
2.20.1


2020-02-04 11:03:02

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH -next] ASoc: rt1015: make symbol rt1015_aif_dai_ops and rt1015_dai static

On Mon, Feb 03, 2020 at 10:18:41AM +0800, Hongbo Yao wrote:
> Fix sparse warning:
> sound/soc/codecs/rt1015.c: warning: symbol 'rt1015_aif_dai_ops'
> was not declared. Should it be static?
> sound/soc/codecs/rt1015.c: warning: symbol 'rt1015_dai' was not
> declared. Should it be static?

This introduces other warnings so clearly isn't the best fix:

CC sound/soc/codecs/rt1015.o
sound/soc/codecs/rt1015.c:844:31: warning: ‘rt1015_aif_dai_ops’ defined but not used [-Wunused-variable]
static struct snd_soc_dai_ops rt1015_aif_dai_ops = {
^~~~~~~~~~~~~~~~~~


Attachments:
(No filename) (616.00 B)
signature.asc (499.00 B)
Download all attachments