[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100324140621.GI21571@bicker>
Date: Wed, 24 Mar 2010 17:06:21 +0300
From: Dan Carpenter <error27@...il.com>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@...mlogic.co.uk>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
Joonyoung Shim <jy0922.shim@...sung.com>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [rfc patch] wm8994: range checking issue
On Wed, Mar 24, 2010 at 12:59:46PM +0000, Mark Brown wrote:
> 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.
Hm... That sounds more involved than I anticipated. I don't have the
hardware and don't feel comfortable making complicated changes if I
can't test them.
Can someone else take care of this.
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists