Skip to contentSkip to conversation

ASoC: hdmi-codec: fix non static symbol warnings

PATCH In review Wei Yongjun 3 participants 3 messages Feb 6, 2017 – Feb 28, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: hdmi-codec: fix non static symbol warnings

From: Wei Yongjun <[email protected]>

Fixes the following sparse warnings:

sound/soc/codecs/hdmi-codec.c:34:1: warning:
symbol 'hdmi_device_list' was not declared. Should it be static?
sound/soc/codecs/hdmi-codec.c:80:33: warning:
symbol 'hdmi_codec_stereo_chmaps' was not declared. Should it be static?
sound/soc/codecs/hdmi-codec.c:87:33: warning:
symbol 'hdmi_codec_8ch_chmaps' was not declared. Should it be static?
sound/soc/codecs/hdmi-codec.c:354:6: warning:
symbol 'hdmi_codec_eld_chmap' was not declared. Should it be static?

---
 sound/soc/codecs/hdmi-codec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/codecs/hdmi-codec.c +4 -4
index dc6715a..4982c91 100644
@@ -31,7 +31,7 @@ struct hdmi_device {
 	int cnt;
 };
 #define pos_to_hdmi_device(pos)	container_of((pos), struct hdmi_device, list)
-LIST_HEAD(hdmi_device_list);
+static LIST_HEAD(hdmi_device_list);
 
 #define DAI_NAME_SIZE 16
 
@@ -77,14 +77,14 @@ struct hdmi_codec_cea_spk_alloc {
 };
 
 /* Channel maps  stereo HDMI */
-const struct snd_pcm_chmap_elem hdmi_codec_stereo_chmaps[] = {
+static const struct snd_pcm_chmap_elem hdmi_codec_stereo_chmaps[] = {
 	{ .channels = 2,
 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
 	{ }
 };
 
 /* Channel maps for multi-channel playbacks, up to 8 n_ch */
-const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = {
+static const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = {
 	{ .channels = 2, /* CA_ID 0x00 */
 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
 	{ .channels = 4, /* CA_ID 0x01 */
@@ -351,7 +351,7 @@ static unsigned long hdmi_codec_spk_mask_from_alloc(int spk_alloc)
 	return spk_mask;
 }
 
-void hdmi_codec_eld_chmap(struct hdmi_codec_priv *hcp)
+static void hdmi_codec_eld_chmap(struct hdmi_codec_priv *hcp)
 {
 	u8 spk_alloc;
 	unsigned long spk_mask;
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 13 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Fixes the following sparse warnings:

sound/soc/codecs/hdmi-codec.c:34:1: warning:
symbol 'hdmi_device_list' was not declared. Should it be static?
sound/soc/codecs/hdmi-codec.c:80:33: warning:
symbol 'hdmi_codec_stereo_chmaps' was not declared. Should it be static?
sound/soc/codecs/hdmi-codec.c:87:33: warning:
symbol 'hdmi_codec_8ch_chmaps' was not declared. Should it be static?
sound/soc/codecs/hdmi-codec.c:354:6: warning:
symbol 'hdmi_codec_eld_chmap' was not declared. Should it be static?

Quoted 4 lines
---
 sound/soc/codecs/hdmi-codec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Unfortunately, this patch causes conflict to Mark's PR[0], due to a commit 8480ac567959 ("ASoC: hdmi-codec: remove HDMI device unregister")[1]. I think it better for you to post again with rebasing this on the PR, however it depends on Mark's maintenance policy (he could resolve the conflict by his hand and apply).

[0] http://mailman.alsa-project.org/pipermail/alsa-devel/2017-February/118079.html
[1] https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/?id=8480ac567959

Quoted 31 lines
sound/soc/codecs/hdmi-codec.c +3 -3
index dc6715a..4982c91 100644
@@ -31,7 +31,7 @@ struct hdmi_device {
 	int cnt;
 };
 #define pos_to_hdmi_device(pos)	container_of((pos), struct hdmi_device, list)
-LIST_HEAD(hdmi_device_list);
+static LIST_HEAD(hdmi_device_list);
 
 #define DAI_NAME_SIZE 16
 
@@ -77,14 +77,14 @@ struct hdmi_codec_cea_spk_alloc {
 };
 
 /* Channel maps  stereo HDMI */
-const struct snd_pcm_chmap_elem hdmi_codec_stereo_chmaps[] = {
+static const struct snd_pcm_chmap_elem hdmi_codec_stereo_chmaps[] = {
 	{ .channels = 2,
 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
 	{ }
 };
 
 /* Channel maps for multi-channel playbacks, up to 8 n_ch */
-const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = {
+static const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = {
 	{ .channels = 2, /* CA_ID 0x00 */
 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
 	{ .channels = 4, /* CA_ID 0x01 */

sound/soc/codecs/hdmi-codec.c static unsigned long hdmi_codec_spk_mask_from_alloc(int spk_alloc) · line 357

Quoted 8 lines
sound/soc/codecs/hdmi-codec.c +1 -1
@@ -351,7 +351,7 @@ static unsigned long hdmi_codec_spk_mask_from_alloc(int spk_alloc)
 	return spk_mask;
 }
 
-void hdmi_codec_eld_chmap(struct hdmi_codec_priv *hcp)
+static void hdmi_codec_eld_chmap(struct hdmi_codec_priv *hcp)
 {
 	u8 spk_alloc;
 	unsigned long spk_mask;

Thanks

Takashi Sakamoto

maintainer
#2 lore raw
Quoted 2 lines · Takashi Sakamoto
Quoted 1 line · Wei Yongjun

From: Wei Yongjun <[email protected]>

I don't seem to have this patch?

Quoted 5 lines

Unfortunately, this patch causes conflict to Mark's PR[0], due to a commit 8480ac567959 ("ASoC: hdmi-codec: remove HDMI device unregister")[1]. I think it better for you to post again with rebasing this on the PR, however it depends on Mark's maintenance policy (he could resolve the conflict by his hand and apply).

If it's in what went to Linus already I'd prefer a rebase as I'd have to dig out an old tree, I will make some effort to do merges if I can find a baseline to apply patches against though sometimes if things are complicated enough I'll ask people to do that for me.