* [patch] ASoC: adau1701: signedness bug in adau1701_write()
@ 2011-06-20 7:11 Dan Carpenter
2011-06-20 10:03 ` Lars-Peter Clausen
2011-06-20 17:49 ` Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2011-06-20 7:11 UTC (permalink / raw)
Cc: open list:SOUND - SOC LAYER..., Lars-Peter Clausen, Takashi Iwai,
Mark Brown, kernel-janitors, Liam Girdwood
"ret" is supposed to be signed here. The current code will only
return -EIO on error, instead of a more appropriate error code such
as -EAGAIN etc.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index 6c01bb6..2758d5f 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -140,9 +140,10 @@ static unsigned int adau1701_register_size(struct snd_soc_codec *codec,
static int adau1701_write(struct snd_soc_codec *codec, unsigned int reg,
unsigned int value)
{
- unsigned int i, ret;
+ unsigned int i;
unsigned int size;
uint8_t buf[4];
+ int ret;
size = adau1701_register_size(codec, reg);
if (size = 0)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch] ASoC: adau1701: signedness bug in adau1701_write()
2011-06-20 7:11 [patch] ASoC: adau1701: signedness bug in adau1701_write() Dan Carpenter
@ 2011-06-20 10:03 ` Lars-Peter Clausen
2011-06-20 14:03 ` Liam Girdwood
2011-06-20 17:49 ` Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Lars-Peter Clausen @ 2011-06-20 10:03 UTC (permalink / raw)
To: Dan Carpenter
Cc: open list:SOUND - SOC LAYER..., Takashi Iwai, Mark Brown,
kernel-janitors, Liam Girdwood
On 06/20/2011 09:11 AM, Dan Carpenter wrote:
> "ret" is supposed to be signed here. The current code will only
> return -EIO on error, instead of a more appropriate error code such
> as -EAGAIN etc.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Thanks
>
> diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
> index 6c01bb6..2758d5f 100644
> --- a/sound/soc/codecs/adau1701.c
> +++ b/sound/soc/codecs/adau1701.c
> @@ -140,9 +140,10 @@ static unsigned int adau1701_register_size(struct snd_soc_codec *codec,
> static int adau1701_write(struct snd_soc_codec *codec, unsigned int reg,
> unsigned int value)
> {
> - unsigned int i, ret;
> + unsigned int i;
> unsigned int size;
> uint8_t buf[4];
> + int ret;
>
> size = adau1701_register_size(codec, reg);
> if (size = 0)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] ASoC: adau1701: signedness bug in adau1701_write()
2011-06-20 10:03 ` Lars-Peter Clausen
@ 2011-06-20 14:03 ` Liam Girdwood
0 siblings, 0 replies; 4+ messages in thread
From: Liam Girdwood @ 2011-06-20 14:03 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: open list:SOUND - SOC LAYER..., Dan Carpenter, Takashi Iwai,
Mark Brown, kernel-janitors@vger.kernel.org
On 20/06/11 11:03, Lars-Peter Clausen wrote:
> On 06/20/2011 09:11 AM, Dan Carpenter wrote:
>> "ret" is supposed to be signed here. The current code will only
>> return -EIO on error, instead of a more appropriate error code such
>> as -EAGAIN etc.
>>
>> Signed-off-by: Dan Carpenter <error27@gmail.com>
> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
>
Acked-by: Liam Girdwood <lrg@ti.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] ASoC: adau1701: signedness bug in adau1701_write()
2011-06-20 7:11 [patch] ASoC: adau1701: signedness bug in adau1701_write() Dan Carpenter
2011-06-20 10:03 ` Lars-Peter Clausen
@ 2011-06-20 17:49 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2011-06-20 17:49 UTC (permalink / raw)
To: Dan Carpenter
Cc: open list:SOUND - SOC LAYER..., Lars-Peter Clausen, Takashi Iwai,
kernel-janitors, Liam Girdwood
On Mon, Jun 20, 2011 at 10:11:25AM +0300, Dan Carpenter wrote:
> "ret" is supposed to be signed here. The current code will only
> return -EIO on error, instead of a more appropriate error code such
> as -EAGAIN etc.
That changelog is not accurate, if nothing else the code will return
-EINVAL if it can't figure out a length for a register. However, the
change itself is good so applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-06-20 17:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-20 7:11 [patch] ASoC: adau1701: signedness bug in adau1701_write() Dan Carpenter
2011-06-20 10:03 ` Lars-Peter Clausen
2011-06-20 14:03 ` Liam Girdwood
2011-06-20 17:49 ` Mark Brown
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).