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

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

 



On Mon, Aug 24, 2009 at 09:35:03AM +0200, Jarkko Nikula wrote:
> On Mon, 24 Aug 2009 09:49:41 +0300
> Eduardo Valentin <eduardo.valentin@xxxxxxxxx> 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.

Yes, sysfs_streq is not. There is no need for the insensitive, but
it can give user more options (ELEMENT or element)?

If using strcicmp, then strstrip would be required.

Just to reminder that strstrip does a wider job by cleaning any kind of
spaces. sysfs_streq deals only with 1 leading "\n".

> 
> I'll send a new version later this day.
> 
> 
> -- 
> Jarkko

-- 
Eduardo Valentin
_______________________________________________
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