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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux