[alsa-devel] [PATCH 1/3] OMAP: McBSP: Use textual values in DMA operating mode sysfs files

Jarkko Nikula jhnikula at gmail.com
Mon Aug 24 09:35:03 CEST 2009


On Mon, 24 Aug 2009 09:49:41 +0300
Eduardo Valentin <eduardo.valentin at nokia.com> wrote:

> > +			len += sprintf(buf + len, "[%s] ", *s);
> > +		else
> > +			len += sprintf(buf + len, "%s ", *s);
> > +	}
> > +	len += sprintf(len+buf, "\n");
> 
> Just a tiny thing, add spaces before and after + operator:
> +	len += sprintf(len + buf, "\n");
> 
> > +	p = memchr(buf, '\n', size);
> > +	len = p ? p - buf : size;
> 
> I guess here we have two better options, please use one of these:
> * strstrip
> * sysfs_streq
> 
Thanks Eduardo. I'll fix the first the one and use the sysfs_streq as
it's much cleaner to use.

> >  
> > -	spin_lock_irq(&mcbsp->lock);
> > +	for (s = &dma_op_modes[i]; i < ARRAY_SIZE(dma_op_modes); s++, i++)
> > +		if (*s && len == strlen(*s) && !strncmp(buf, *s, len))
> 
> how about using strnicmp ??
> 
Are there need for case insensitive check? The sysfs_streq is not.

I'll send a new version later this day.


-- 
Jarkko


More information about the Alsa-devel mailing list