diff mbox

ASoC: max98925: reading beyond the end of the array

Message ID 20150721085527.GA22070@mwanda (mailing list archive)
State Accepted
Commit 6eb1c2a63d0415bd66c9c866b7d405662f50d5e4
Headers show

Commit Message

Dan Carpenter July 21, 2015, 8:55 a.m. UTC
Debug prints are seldom useful and this one has an annoying thing where
it reads one space beyond the end of the array on error.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Mark Brown July 21, 2015, 10:43 a.m. UTC | #1
On Tue, Jul 21, 2015 at 11:55:27AM +0300, Dan Carpenter wrote:
> Debug prints are seldom useful and this one has an annoying thing where
> it reads one space beyond the end of the array on error.

It's a pretty big stretch to say that debug prints are rarely useful...
Dan Carpenter July 21, 2015, 10:57 a.m. UTC | #2
On Tue, Jul 21, 2015 at 11:43:50AM +0100, Mark Brown wrote:
> On Tue, Jul 21, 2015 at 11:55:27AM +0300, Dan Carpenter wrote:
> > Debug prints are seldom useful and this one has an annoying thing where
> > it reads one space beyond the end of the array on error.
> 
> It's a pretty big stretch to say that debug prints are rarely useful...

I asked Anish if it was worth fixing and he said to delete it.

regards,
dan carpenter
Mark Brown July 21, 2015, 11:04 a.m. UTC | #3
On Tue, Jul 21, 2015 at 01:57:43PM +0300, Dan Carpenter wrote:
> On Tue, Jul 21, 2015 at 11:43:50AM +0100, Mark Brown wrote:
> > On Tue, Jul 21, 2015 at 11:55:27AM +0300, Dan Carpenter wrote:
> > > Debug prints are seldom useful and this one has an annoying thing where
> > > it reads one space beyond the end of the array on error.

> > It's a pretty big stretch to say that debug prints are rarely useful...

> I asked Anish if it was worth fixing and he said to delete it.

Sure, but you're making a general comment about debug prints being
seldom useful rather than just talking about this one.
diff mbox

Patch

diff --git a/sound/soc/codecs/max98925.c b/sound/soc/codecs/max98925.c
index e1753c8..ebb648a 100644
--- a/sound/soc/codecs/max98925.c
+++ b/sound/soc/codecs/max98925.c
@@ -271,8 +271,6 @@  static inline int max98925_rate_value(struct snd_soc_codec *codec,
 			break;
 		}
 	}
-	dev_dbg(codec->dev, "%s: sample rate is %d, returning %d\n",
-				__func__, rate_table[i].rate, *value);
 	return ret;
 }