Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1340339 > unrolled thread

[PATCH 2/2] ASoC: max9867: fix type of variable containing error codes

Started byAndrzej Hajda <a.hajda@samsung.com>
First post2016-02-23 07:50 +0100
Last post2016-02-23 08:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 2/2] ASoC: max9867: fix type of variable containing error codes Andrzej Hajda <a.hajda@samsung.com> - 2016-02-23 07:50 +0100
    Re: [PATCH 2/2] ASoC: max9867: fix type of variable containing error codes Axel Lin <axel.lin@ingics.com> - 2016-02-23 08:00 +0100

#1340339 — [PATCH 2/2] ASoC: max9867: fix type of variable containing error codes

FromAndrzej Hajda <a.hajda@samsung.com>
Date2016-02-23 07:50 +0100
Subject[PATCH 2/2] ASoC: max9867: fix type of variable containing error codes
Message-ID<r5eXg-1sV-7@gated-at.bofh.it>
value variable can contain error values and is compared with zero.
Its type must be signed.

The problem has been detected using coccinelle script
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 sound/soc/codecs/max9867.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c
index ab7a94d..4fb6fc7 100755
--- a/sound/soc/codecs/max9867.c
+++ b/sound/soc/codecs/max9867.c
@@ -180,7 +180,8 @@ static int max9867_dai_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_codec *codec = dai->codec;
 	struct max9867_priv *max9867 = snd_soc_codec_get_drvdata(codec);
-	unsigned int ni_h, ni_l, value;
+	unsigned int ni_h, ni_l;
+	int value;
 
 	value = get_ni_value(max9867->sysclk, params_rate(params));
 	if (value < 0)
-- 
1.9.1

[toc] | [next] | [standalone]


#1340341

FromAxel Lin <axel.lin@ingics.com>
Date2016-02-23 08:00 +0100
Message-ID<r5f6W-1wM-5@gated-at.bofh.it>
In reply to#1340339
2016-02-23 14:45 GMT+08:00 Andrzej Hajda <a.hajda@samsung.com>:
> value variable can contain error values and is compared with zero.
> Its type must be signed.
Reviewed-by: Axel Lin <axel.lin@ingics.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web