lkml.org 
[lkml]   [2005]   [Jul]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 28 Jul 2005 00:04:55 -0700
FromMitchell Blank Jr <>
SubjectRe: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
Greg KH wrote:
> > +	/* locate trailng white space */
> > +	z = y = x;
> > +	while (y - buffer->page < count) {
> > +		y++;
> > +		z = y;
> > +		while (isspace(*y) && (y - buffer->page < count)) {
> > +			y++;
> > +		}
> > +	}
> > +	count = z - x;
> 
> Hm, I _think_ this works, but I need someone else to verify this...
> Anyone else?

It looks sane-ish to me, but also more complicated than need be.  Why can't
you just do something like:

	while (count > 0 && isspace(x[count - 1]))
		count--;
-Mitch
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-28 09:32    [from the cache]
©2003-2008