All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Molton <ian@mnementh.co.uk>
To: Mark Brown <broonie@sirena.org.uk>
Cc: Takashi Iwai <tiwai@suse.de>,
	ALSA development <alsa-devel@alsa-project.org>
Subject: Re: [Pull request] Support for wm9705 codec and two machines that use it.
Date: Sat, 17 Jan 2009 18:47:11 +0000	[thread overview]
Message-ID: <497227AF.1080907@mnementh.co.uk> (raw)
In-Reply-To: <20090117175844.GE7210@sirena.org.uk>

Mark Brown wrote:
> On Fri, Jan 16, 2009 at 03:46:19PM +0000, Ian Molton wrote:
> 
>> Mark, the changes requested are implemented below. There are two
>> patchsets, one for wm9705 and one for the other codec issues I found.
> 
> This looks good, thanks - I've applied it.  A couple of the changes
> appear to be pure formatting changes:

Thanks,

Comments below on your comments:

>> --- a/sound/soc/codecs/ad1980.c
>> +++ b/sound/soc/codecs/ad1980.c
>> @@ -109,7 +109,7 @@ static unsigned int ac97_read(struct snd_soc_codec  
>> *codec,
>>  	default:
>>  		reg = reg >> 1;
>>
>> -		if (reg >= (ARRAY_SIZE(ad1980_reg)))
>> +		if (reg >= ARRAY_SIZE(ad1980_reg))
>>  			return -EINVAL;
>>
>>  		return cache[reg];
> 
> Formatting changes only in this driver?  Not sure I really like the
> extra brackets.

Exactly - nor did I, so  Iremoved them :-)

>> diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
>> index 6b27786..f93c095 100644
>> --- a/sound/soc/codecs/wm8990.c
>> +++ b/sound/soc/codecs/wm8990.c
>> @@ -116,7 +116,7 @@ static inline unsigned int  
>> wm8990_read_reg_cache(struct snd_soc_codec *codec,
>>  	unsigned int reg)
>>  {
>>  	u16 *cache = codec->reg_cache;
>> -	BUG_ON(reg > (ARRAY_SIZE(wm8990_reg)) - 1);
>> +	BUG_ON(reg >= ARRAY_SIZE(wm8990_reg));
>>  	return cache[reg];
>>  }
>>
> 
> These two bits of code are equivalent...

Yes but one is clearer and more commonly used. Testing for 'more than 
one less than the array size' is just a bit... meh :-)

(plus its inconsistent with all the other drivers as it was)

-Ian

      reply	other threads:[~2009-01-17 18:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15  1:13 [Pull request] Support for wm9705 codec and two machines that use it Ian Molton
2009-01-15  1:16 ` Ian Molton
2009-01-15  7:06 ` Takashi Iwai
2009-01-15 10:06   ` Ian Molton
2009-01-15 10:10     ` Russell King - ARM Linux
2009-01-15 10:47       ` Ian Molton
2009-01-15 17:20     ` Mark Brown
2009-01-15 22:16       ` Ian Molton
2009-01-15 22:22         ` Mark Brown
2009-01-15 23:58           ` Ian Molton
2009-01-16 11:21             ` Mark Brown
2009-01-16 11:03     ` Takashi Iwai
2009-01-16 11:34       ` Ian Molton
2009-01-16 11:54         ` Mark Brown
2009-01-16 13:39           ` Ian Molton
2009-01-16 14:31             ` Mark Brown
2009-01-16 15:00               ` Ian Molton
2009-01-16 16:00                 ` Mark Brown
2009-01-16 15:46               ` Ian Molton
2009-01-16 16:16                 ` Mark Brown
2009-01-17 17:58                 ` Mark Brown
2009-01-17 18:47                   ` Ian Molton [this message]

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=497227AF.1080907@mnementh.co.uk \
    --to=ian@mnementh.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@sirena.org.uk \
    --cc=tiwai@suse.de \
    /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 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.