[alsa-devel] [PATCH 04/14] ASoC: Allow codecs to override register display
broonie at opensource.wolfsonmicro.com
Fri Aug 1 17:35:40 CEST 2008
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
> > - /* 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.
More information about the Alsa-devel