All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][alsa-lib] topology: fix sign-compare warning introduced to set_link_hw_config() and tplg_add_link_object()
@ 2016-11-29 15:41 Takashi Sakamoto
  2016-12-17  0:40 ` Takashi Sakamoto
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Sakamoto @ 2016-11-29 15:41 UTC (permalink / raw)
  To: tiwai, perex; +Cc: alsa-devel, mengdong.lin

Some functions recently introduced to this library include comparison
between variables with different types, then compiler generates
below warnings.

pcm.c: In function ‘set_link_hw_config’:
pcm.c:1179:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < cfg->tx_channels; i++)
                ^
pcm.c:1183:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < cfg->rx_channels; i++)
                ^
pcm.c: In function ‘tplg_add_link_object’:
pcm.c:1223:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < link->num_streams; i++)
                ^
pcm.c:1231:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < link->num_hw_configs; i++)

This commit suppresses them.

Fixes: 6b4d775b9752 ("topology: Parse HW configurations of physical DAI links defined by C API")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 src/topology/pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index 8f8a703..1de8655 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -1147,7 +1147,7 @@ int tplg_add_pcm_object(snd_tplg_t *tplg, snd_tplg_obj_template_t *t)
 static int set_link_hw_config(struct snd_soc_tplg_hw_config *cfg,
 			struct snd_tplg_hw_config_template *tpl)
 {
-	int i;
+	unsigned int i;
 
 	cfg->size = sizeof(*cfg);
 	cfg->id = tpl->id;
@@ -1190,7 +1190,7 @@ int tplg_add_link_object(snd_tplg_t *tplg, snd_tplg_obj_template_t *t)
 	struct snd_tplg_link_template *link_tpl = t->link;
 	struct snd_soc_tplg_link_config *link, *_link;
 	struct tplg_elem *elem;
-	int i;
+	unsigned int i;
 
 	if (t->type != SND_TPLG_TYPE_LINK && t->type != SND_TPLG_TYPE_BE
 	    && t->type != SND_TPLG_TYPE_CC)
-- 
2.9.3

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2017-01-02 14:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-29 15:41 [PATCH][alsa-lib] topology: fix sign-compare warning introduced to set_link_hw_config() and tplg_add_link_object() Takashi Sakamoto
2016-12-17  0:40 ` Takashi Sakamoto
2016-12-27 10:39   ` Mengdong Lin
2017-01-02 14:20     ` Takashi Iwai

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.