[alsa-devel] [PATCH] ASoC: rsnd: fixup unsigned expression compared with zero: main_rate
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
This patch fixes this WARNING
sound/soc/sh/rcar/ssi.c:285:5-14: WARNING: Unsigned expression\ compared with zero: main_rate < 0
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com ---
Mark, Julia
I think this patch solves reported issue, but my compiler and smatch doesn't indicate it. Thus, I couldn't confirm it.
sound/soc/sh/rcar/core.c | 2 +- sound/soc/sh/rcar/rsnd.h | 2 +- sound/soc/sh/rcar/ssi.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 4892c0a..409bac3 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -763,7 +763,7 @@ static int rsnd_soc_hw_rule(struct rsnd_priv *priv, struct snd_interval *baseline, struct snd_interval *iv) { struct snd_interval p; - int rate; + unsigned int rate; int i;
snd_interval_any(&p); diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 9428d4e..99c5761 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -680,7 +680,7 @@ void rsnd_ssi_parse_hdmi_connection(struct rsnd_priv *priv, void rsnd_parse_connect_ssi(struct rsnd_dai *rdai, struct device_node *playback, struct device_node *capture); -int rsnd_ssi_clk_query(struct rsnd_priv *priv, +unsigned int rsnd_ssi_clk_query(struct rsnd_priv *priv, int param1, int param2, int *idx);
/* diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index c8956c3..46feddd 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -208,14 +208,14 @@ u32 rsnd_ssi_multi_slaves_runtime(struct rsnd_dai_stream *io) return 0; }
-int rsnd_ssi_clk_query(struct rsnd_priv *priv, +unsigned int rsnd_ssi_clk_query(struct rsnd_priv *priv, int param1, int param2, int *idx) { int ssi_clk_mul_table[] = { 1, 2, 4, 8, 16, 6, 12, }; int j, ret; - int main_rate; + unsigned int main_rate;
for (j = 0; j < ARRAY_SIZE(ssi_clk_mul_table); j++) {
@@ -245,7 +245,7 @@ int rsnd_ssi_clk_query(struct rsnd_priv *priv, return main_rate; }
- return -EINVAL; + return 0; }
static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod, @@ -282,7 +282,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod, }
main_rate = rsnd_ssi_clk_query(priv, rate, chan, &idx); - if (main_rate < 0) { + if (!main_rate) { dev_err(dev, "unsupported clock rate\n"); return -EIO; }
The patch
ASoC: rsnd: fixup unsigned expression compared with zero: main_rate
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 947f4eb58d2054b10a1d8146d0ab90b0e7fd3494 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Fri, 16 Jun 2017 00:02:59 +0000 Subject: [PATCH] ASoC: rsnd: fixup unsigned expression compared with zero: main_rate
This patch fixes this WARNING
sound/soc/sh/rcar/ssi.c:285:5-14: WARNING: Unsigned expression\ compared with zero: main_rate < 0
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/sh/rcar/core.c | 2 +- sound/soc/sh/rcar/rsnd.h | 2 +- sound/soc/sh/rcar/ssi.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 4892c0a4b613..409bac331d27 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -763,7 +763,7 @@ static int rsnd_soc_hw_rule(struct rsnd_priv *priv, struct snd_interval *baseline, struct snd_interval *iv) { struct snd_interval p; - int rate; + unsigned int rate; int i;
snd_interval_any(&p); diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 9428d4e288dd..99c57611df88 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -680,7 +680,7 @@ int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); void rsnd_parse_connect_ssi(struct rsnd_dai *rdai, struct device_node *playback, struct device_node *capture); -int rsnd_ssi_clk_query(struct rsnd_priv *priv, +unsigned int rsnd_ssi_clk_query(struct rsnd_priv *priv, int param1, int param2, int *idx);
/* diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index c8956c3484dd..46feddd78ee2 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -208,14 +208,14 @@ u32 rsnd_ssi_multi_slaves_runtime(struct rsnd_dai_stream *io) return 0; }
-int rsnd_ssi_clk_query(struct rsnd_priv *priv, +unsigned int rsnd_ssi_clk_query(struct rsnd_priv *priv, int param1, int param2, int *idx) { int ssi_clk_mul_table[] = { 1, 2, 4, 8, 16, 6, 12, }; int j, ret; - int main_rate; + unsigned int main_rate;
for (j = 0; j < ARRAY_SIZE(ssi_clk_mul_table); j++) {
@@ -245,7 +245,7 @@ int rsnd_ssi_clk_query(struct rsnd_priv *priv, return main_rate; }
- return -EINVAL; + return 0; }
static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod, @@ -282,7 +282,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod, }
main_rate = rsnd_ssi_clk_query(priv, rate, chan, &idx); - if (main_rate < 0) { + if (!main_rate) { dev_err(dev, "unsupported clock rate\n"); return -EIO; }
participants (2)
-
Kuninori Morimoto
-
Mark Brown