All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Dan Carpenter <error27@gmail.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
	Joonyoung Shim <jy0922.shim@samsung.com>, alsa-
Subject: Re: [rfc patch] wm8994: range checking issue
Date: Wed, 24 Mar 2010 12:59:46 +0000	[thread overview]
Message-ID: <20100324125946.GA26453@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <20100324120107.GH21571@bicker>

On Wed, Mar 24, 2010 at 03:01:07PM +0300, Dan Carpenter wrote:
> Smatch complained about BUG_ON(reg > WM8994_MAX_REGISTER) because the
> actual number of elements in the array was WM8994_REG_CACHE_SIZE + 1.

> I changed the BUG_ON() to return -EINVAL.

Please don't introduce orthogonal changes like this in patches, it's bad
practice and increases the chances of your patch being nacked.

> I was confused why WM8994_REG_CACHE_SIZE was different from the actual
> size of ->reg_cache and I was concerned because some places used 
> ARRAY_SIZE() to find the end of the array and other places used 
> WM8994_REG_CACHE_SIZE.  In my patch, I made them the same.

This is caused by confusion with the MAX_CACHED_REGISTER definition in
the header.  Best to use that one consistently, I guess - I've got a
sneaking suspicion something has gone AWOL in the driver publication
process.

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Dan Carpenter <error27@gmail.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [rfc patch] wm8994: range checking issue
Date: Wed, 24 Mar 2010 12:59:46 +0000	[thread overview]
Message-ID: <20100324125946.GA26453@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <20100324120107.GH21571@bicker>

On Wed, Mar 24, 2010 at 03:01:07PM +0300, Dan Carpenter wrote:
> Smatch complained about BUG_ON(reg > WM8994_MAX_REGISTER) because the
> actual number of elements in the array was WM8994_REG_CACHE_SIZE + 1.

> I changed the BUG_ON() to return -EINVAL.

Please don't introduce orthogonal changes like this in patches, it's bad
practice and increases the chances of your patch being nacked.

> I was confused why WM8994_REG_CACHE_SIZE was different from the actual
> size of ->reg_cache and I was concerned because some places used 
> ARRAY_SIZE() to find the end of the array and other places used 
> WM8994_REG_CACHE_SIZE.  In my patch, I made them the same.

This is caused by confusion with the MAX_CACHED_REGISTER definition in
the header.  Best to use that one consistently, I guess - I've got a
sneaking suspicion something has gone AWOL in the driver publication
process.

  reply	other threads:[~2010-03-24 12:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-24 12:01 [rfc patch] wm8994: range checking issue Dan Carpenter
2010-03-24 12:01 ` Dan Carpenter
2010-03-24 12:59 ` Mark Brown [this message]
2010-03-24 12:59   ` Mark Brown
2010-03-24 14:06   ` Dan Carpenter
2010-03-24 14:06     ` Dan Carpenter
2010-03-24 14:31     ` Mark Brown
2010-03-24 14:31       ` Mark Brown
2010-03-25 10:58       ` Dan Carpenter
2010-03-25 10:58         ` Dan Carpenter

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=20100324125946.GA26453@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=error27@gmail.com \
    --cc=jy0922.shim@samsung.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=perex@perex.cz \
    --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.