Re: [PATCH 04/14] ASoC: Allow codecs to override register display

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 01, 2008 at 05:23:27PM +0200, Takashi Iwai wrote:
> Jon Smirl wrote:

> > -			count += codec->display_register(codec, buf + count,
> > -							 PAGE_SIZE - count, i);

...

> > +			count += codec->display_register(codec,
> > +							 buf + count, PAGE_SIZE - count, i);

> Please make it fit in 80 chars like the original code.

This also seems to be an indentation-only change but perhaps I'm missing
something here?

> > -	/* Truncate count; min() would cause a warning */
> > -	if (count >= PAGE_SIZE)
> > -		count = PAGE_SIZE - 1;
> > -

> Really safe to remove this?

No.  snprintf() returns how many bytes it wanted to write, not the
number of bytes it wrote, which means that if the end of the buffer is
hit then count will include the overspill and sysfs will complain.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux