alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: mengdong.lin@linux.intel.com
To: alsa-devel@alsa-project.org
Cc: Mengdong Lin <mengdong.lin@linux.intel.com>,
	tiwai@suse.de, mengdong.lin@intel.com, vinod.koul@intel.com,
	liam.r.girdwood@intel.com, subhransu.s.prusty@intel.com
Subject: [PATCH 2/4] topology: Change variable type to fix gcc warning
Date: Wed, 18 Nov 2015 02:23:07 -0500	[thread overview]
Message-ID: <52b9413a02fff6e7edb4541023fe53bb495bbf91.1447825540.git.mengdong.lin@linux.intel.com> (raw)
In-Reply-To: <cover.1447825540.git.mengdong.lin@linux.intel.com>

From: Mengdong Lin <mengdong.lin@linux.intel.com>

Fix warning: comparison between signed and unsigned integer expressions
[-Wsign-compare]

ABI objects use type _le32, which is converted to host unsigned integer.
So the iterator 'i' in a loop as below should also be unsigned.
for (i = 0; i < pcm->num_streams; i++)
                ^
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>

diff --git a/src/topology/ctl.c b/src/topology/ctl.c
index 7d8787f..6dc3b3d 100644
--- a/src/topology/ctl.c
+++ b/src/topology/ctl.c
@@ -676,7 +676,8 @@ int tplg_add_mixer(snd_tplg_t *tplg, struct snd_tplg_mixer_template *mixer,
 	struct snd_soc_tplg_private *priv = mixer->priv;
 	struct snd_soc_tplg_mixer_control *mc;
 	struct tplg_elem *elem;
-	int ret, i;
+	int ret;
+	unsigned int i;
 
 	tplg_dbg(" Control Mixer: %s\n", mixer->hdr.name);
 
@@ -743,7 +744,8 @@ int tplg_add_enum(snd_tplg_t *tplg, struct snd_tplg_enum_template *enum_ctl,
 {
 	struct snd_soc_tplg_enum_control *ec;
 	struct tplg_elem *elem;
-	int ret, i;
+	int ret;
+	unsigned int i;
 
 	tplg_dbg(" Control Enum: %s\n", enum_ctl->hdr.name);
 
diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index 9b7e402..4b7c058 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -522,7 +522,7 @@ int tplg_add_pcm_object(snd_tplg_t *tplg, snd_tplg_obj_template_t *t)
 	struct snd_tplg_pcm_template *pcm_tpl = t->pcm;
 	struct snd_soc_tplg_pcm *pcm;
 	struct tplg_elem *elem;
-	int i;
+	unsigned int i;
 
 	tplg_dbg("PCM: %s, DAI %s\n", pcm_tpl->pcm_name, pcm_tpl->dai_name);
 
@@ -564,7 +564,7 @@ int tplg_add_link_object(snd_tplg_t *tplg, snd_tplg_obj_template_t *t)
 	struct snd_tplg_link_template *link = t->link;
 	struct snd_soc_tplg_link_config *lk;
 	struct tplg_elem *elem;
-	int i;
+	unsigned int i;
 
 	if (t->type != SND_TPLG_TYPE_BE && t->type != SND_TPLG_TYPE_CC)
 		return -EINVAL;
-- 
2.5.0

  parent reply	other threads:[~2015-11-18  7:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18  7:21 [PATCH 0/4] topology: fix some gcc warnings mengdong.lin
2015-11-18  7:22 ` [PATCH 1/4] topology: Remove unused function write_data_block() mengdong.lin
2015-11-18 13:58   ` Takashi Iwai
2015-11-18  7:23 ` mengdong.lin [this message]
2015-11-18  7:15   ` [PATCH 2/4] topology: Change variable type to fix gcc warning Takashi Iwai
2015-11-18  7:28     ` Lin, Mengdong
2015-11-18  8:19       ` Takashi Iwai
2015-11-18 15:14         ` Lin, Mengdong
2015-11-18 15:26           ` Takashi Iwai
2015-11-18  7:23 ` [PATCH 3/4] topology: Remove unused variables mengdong.lin
2015-11-18 13:58   ` Takashi Iwai
2015-11-18  7:23 ` [PATCH 4/4] topology: Fix comparison of unsigned expression < 0 mengdong.lin
2015-11-18 13:59   ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52b9413a02fff6e7edb4541023fe53bb495bbf91.1447825540.git.mengdong.lin@linux.intel.com \
    --to=mengdong.lin@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=liam.r.girdwood@intel.com \
    --cc=mengdong.lin@intel.com \
    --cc=subhransu.s.prusty@intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).