Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace

Oliver Neukum
2005-07-28T13:09:40Z

Am Donnerstag, 28. Juli 2005 14:54 schrieb Jon Smirl:
> On 7/28/05, Mitchell Blank Jr <mitch@sfgoth.com> wrote:
> > 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
> >
>
> Do we need to deal with UTF8 here? I did the forward loop because you
> can't parse UTF8 backwards. If UTF8 is possible I need to change the
> pointer inc function.

This considerations show that having parsing code in kernel space is
a questionable idea. Are you absolutely sure that you cannot do with less?

Regards
Oliver