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

2005-08-21 Thread Jon Smirl
On 7/28/05, Jon Smirl <[EMAIL PROTECTED]> wrote: > Even simpler version > > -- > Jon Smirl > [EMAIL PROTECTED] > > Remove leading and trailing whitespace when text sysfs attribute is set > signed-off-by: Jon Smirl <[EMAIL PROTECTED]> > > diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c > ---

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

2005-08-21 Thread Jon Smirl
On 7/28/05, Jon Smirl [EMAIL PROTECTED] wrote: Even simpler version -- Jon Smirl [EMAIL PROTECTED] Remove leading and trailing whitespace when text sysfs attribute is set signed-off-by: Jon Smirl [EMAIL PROTECTED] diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c ---

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

2005-08-07 Thread Pavel Machek
Hi! > > > It is not a work around. These are text attributes meant for human > > > use. Humans have a hard time cleaning up things they can't see. And > > > the failure mode for this is awful, your attribute won't set but > > > everything on the screen looks fine. > > > > Kernel is not a place

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

2005-08-07 Thread Jon Smirl
On 8/7/05, Pavel Machek <[EMAIL PROTECTED]> wrote: > Hi! > > > > > > Could you tell me why you don't just fail the operation if malformed > > > > > input is supplied? > > > > > > > > Leading/trailing white space should be allowed. For example echo > > > > appends '\n' unless you know to use -n.

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

2005-08-07 Thread Pavel Machek
Hi! > > > > Could you tell me why you don't just fail the operation if malformed > > > > input is supplied? > > > > > > Leading/trailing white space should be allowed. For example echo > > > appends '\n' unless you know to use -n. It is easier to fix the kernel > > > than to teach everyone to use

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

2005-08-07 Thread Pavel Machek
Hi! > > > If we are going back to needing helper scripts then I should just > > > remove the entire sysfs graphics interface and switch back to using > > > ioctls and a helper app. Of could no one can ever find the helper app > > > or remember how it works. I thought one of the main reasons

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

2005-08-07 Thread Pavel Machek
Hi! If we are going back to needing helper scripts then I should just remove the entire sysfs graphics interface and switch back to using ioctls and a helper app. Of could no one can ever find the helper app or remember how it works. I thought one of the main reasons behind the

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

2005-08-07 Thread Pavel Machek
Hi! Could you tell me why you don't just fail the operation if malformed input is supplied? Leading/trailing white space should be allowed. For example echo appends '\n' unless you know to use -n. It is easier to fix the kernel than to teach everyone to use -n. Please,

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

2005-08-07 Thread Jon Smirl
On 8/7/05, Pavel Machek [EMAIL PROTECTED] wrote: Hi! Could you tell me why you don't just fail the operation if malformed input is supplied? Leading/trailing white space should be allowed. For example echo appends '\n' unless you know to use -n. It is easier to fix the

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

2005-08-07 Thread Pavel Machek
Hi! It is not a work around. These are text attributes meant for human use. Humans have a hard time cleaning up things they can't see. And the failure mode for this is awful, your attribute won't set but everything on the screen looks fine. Kernel is not a place to be user

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

2005-08-06 Thread Oliver Neukum
> > Stupid users are not a reason for kernel bloat. > > You have a very wrapped sense of kernel bloat. This is nine lines of > code whose absence is guaranteed to generate a bunch of bug reports. They are supposed to be present, but not in the kernel. > Not having it is also causing various

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

2005-08-06 Thread Oliver Neukum
Stupid users are not a reason for kernel bloat. You have a very wrapped sense of kernel bloat. This is nine lines of code whose absence is guaranteed to generate a bunch of bug reports. They are supposed to be present, but not in the kernel. Not having it is also causing various

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

2005-08-05 Thread Jon Smirl
On 8/5/05, Greg KH <[EMAIL PROTECTED]> wrote: > On Fri, Jul 29, 2005 at 02:50:44PM -0400, Jon Smirl wrote: > > Greg, is this ok for your tree now or does it need more work? > > It's in my queue, will add it to the tree next week. Sorry for the > delay, was at OSCON this week... Glad to see

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

2005-08-05 Thread Greg KH
On Fri, Jul 29, 2005 at 02:50:44PM -0400, Jon Smirl wrote: > Greg, is this ok for your tree now or does it need more work? It's in my queue, will add it to the tree next week. Sorry for the delay, was at OSCON this week... thanks, greg k-h - To unsubscribe from this list: send the line

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

2005-08-05 Thread David Weinehall
On Tue, Jan 01, 2002 at 08:53:39AM +0100, Pavel Machek wrote: > Hi! > > > > > New, simplified version of the sysfs whitespace strip patch... > > > > > > Could you tell me why you don't just fail the operation if malformed > > > input is supplied? > > > > Leading/trailing white space should be

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

2005-08-05 Thread Jon Smirl
On 8/5/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > Am Freitag, 5. August 2005 20:47 schrieb Jon Smirl: > > On 8/5/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > > > Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl: > > > > On 8/5/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > > > > > Am

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

2005-08-05 Thread Oliver Neukum
Am Freitag, 5. August 2005 20:47 schrieb Jon Smirl: > On 8/5/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > > Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl: > > > On 8/5/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > > > > Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl: > > > > > On

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

2005-08-05 Thread Jon Smirl
On 8/5/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl: > > On 8/5/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > > > Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl: > > > > On 1/1/02, Pavel Machek <[EMAIL PROTECTED]> wrote: > > > > > Hi! > > >

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

2005-08-05 Thread Oliver Neukum
Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl: > On 8/5/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > > Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl: > > > On 1/1/02, Pavel Machek <[EMAIL PROTECTED]> wrote: > > > > Hi! > > > > > > > > > > > New, simplified version of the sysfs

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

2005-08-05 Thread Jon Smirl
On 8/5/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl: > > On 1/1/02, Pavel Machek <[EMAIL PROTECTED]> wrote: > > > Hi! > > > > > > > > > New, simplified version of the sysfs whitespace strip patch... > > > > > > > > > > Could you tell me why you

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

2005-08-05 Thread Oliver Neukum
Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl: > On 1/1/02, Pavel Machek <[EMAIL PROTECTED]> wrote: > > Hi! > > > > > > > New, simplified version of the sysfs whitespace strip patch... > > > > > > > > Could you tell me why you don't just fail the operation if malformed > > > > input is

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

2005-08-05 Thread Jon Smirl
On 1/1/02, Pavel Machek <[EMAIL PROTECTED]> wrote: > Hi! > > > > > New, simplified version of the sysfs whitespace strip patch... > > > > > > Could you tell me why you don't just fail the operation if malformed > > > input is supplied? > > > > Leading/trailing white space should be allowed. For

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

2005-08-05 Thread Pavel Machek
Hi! > > > New, simplified version of the sysfs whitespace strip patch... > > > > Could you tell me why you don't just fail the operation if malformed > > input is supplied? > > Leading/trailing white space should be allowed. For example echo > appends '\n' unless you know to use -n. It is

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

2005-08-05 Thread Pavel Machek
Hi! New, simplified version of the sysfs whitespace strip patch... Could you tell me why you don't just fail the operation if malformed input is supplied? Leading/trailing white space should be allowed. For example echo appends '\n' unless you know to use -n. It is easier to fix the

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

2005-08-05 Thread Jon Smirl
On 1/1/02, Pavel Machek [EMAIL PROTECTED] wrote: Hi! New, simplified version of the sysfs whitespace strip patch... Could you tell me why you don't just fail the operation if malformed input is supplied? Leading/trailing white space should be allowed. For example echo appends

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

2005-08-05 Thread Oliver Neukum
Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl: On 1/1/02, Pavel Machek [EMAIL PROTECTED] wrote: Hi! New, simplified version of the sysfs whitespace strip patch... Could you tell me why you don't just fail the operation if malformed input is supplied?

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

2005-08-05 Thread Jon Smirl
On 8/5/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl: On 1/1/02, Pavel Machek [EMAIL PROTECTED] wrote: Hi! New, simplified version of the sysfs whitespace strip patch... Could you tell me why you don't just fail the operation

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

2005-08-05 Thread Oliver Neukum
Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl: On 8/5/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl: On 1/1/02, Pavel Machek [EMAIL PROTECTED] wrote: Hi! New, simplified version of the sysfs whitespace strip patch...

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

2005-08-05 Thread Jon Smirl
On 8/5/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl: On 8/5/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl: On 1/1/02, Pavel Machek [EMAIL PROTECTED] wrote: Hi! New,

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

2005-08-05 Thread Oliver Neukum
Am Freitag, 5. August 2005 20:47 schrieb Jon Smirl: On 8/5/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl: On 8/5/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl: On 1/1/02, Pavel Machek

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

2005-08-05 Thread Jon Smirl
On 8/5/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Freitag, 5. August 2005 20:47 schrieb Jon Smirl: On 8/5/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl: On 8/5/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Freitag, 5. August 2005

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

2005-08-05 Thread David Weinehall
On Tue, Jan 01, 2002 at 08:53:39AM +0100, Pavel Machek wrote: Hi! New, simplified version of the sysfs whitespace strip patch... Could you tell me why you don't just fail the operation if malformed input is supplied? Leading/trailing white space should be allowed. For example

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

2005-08-05 Thread Greg KH
On Fri, Jul 29, 2005 at 02:50:44PM -0400, Jon Smirl wrote: Greg, is this ok for your tree now or does it need more work? It's in my queue, will add it to the tree next week. Sorry for the delay, was at OSCON this week... thanks, greg k-h - To unsubscribe from this list: send the line

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

2005-08-05 Thread Jon Smirl
On 8/5/05, Greg KH [EMAIL PROTECTED] wrote: On Fri, Jul 29, 2005 at 02:50:44PM -0400, Jon Smirl wrote: Greg, is this ok for your tree now or does it need more work? It's in my queue, will add it to the tree next week. Sorry for the delay, was at OSCON this week... Glad to see this. After

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

2005-07-29 Thread Jon Smirl
Greg, is this ok for your tree now or does it need more work? On 7/28/05, Jon Smirl <[EMAIL PROTECTED]> wrote: > Even simpler version > > -- > Jon Smirl > [EMAIL PROTECTED] > > Remove leading and trailing whitespace when text sysfs attribute is set > signed-off-by: Jon Smirl <[EMAIL

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

2005-07-29 Thread Jon Smirl
Greg, is this ok for your tree now or does it need more work? On 7/28/05, Jon Smirl [EMAIL PROTECTED] wrote: Even simpler version -- Jon Smirl [EMAIL PROTECTED] Remove leading and trailing whitespace when text sysfs attribute is set signed-off-by: Jon Smirl [EMAIL PROTECTED] diff

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

2005-07-28 Thread Oliver Neukum
Am Donnerstag, 28. Juli 2005 21:57 schrieb Jon Smirl: > New, simplified version of the sysfs whitespace strip patch... Could you tell me why you don't just fail the operation if malformed input is supplied? Regards Oliver - To unsubscribe from this list: send the line

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

2005-07-28 Thread Oliver Neukum
Am Donnerstag, 28. Juli 2005 23:12 schrieb Jon Smirl: > On 7/28/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > > Am Donnerstag, 28. Juli 2005 21:57 schrieb Jon Smirl: > > > New, simplified version of the sysfs whitespace strip patch... > > > > Could you tell me why you don't just fail the

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

2005-07-28 Thread Jon Smirl
On 7/28/05, Oliver Neukum <[EMAIL PROTECTED]> wrote: > Am Donnerstag, 28. Juli 2005 21:57 schrieb Jon Smirl: > > New, simplified version of the sysfs whitespace strip patch... > > Could you tell me why you don't just fail the operation if malformed > input is supplied? Leading/trailing white

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

2005-07-28 Thread Mitchell Blank Jr
Still one nitpick: Jon Smirl wrote: > + while (isspace(*x) && (x - buffer->page < count)) > + x++; I think you can just do: if (count > 0) while (isspace(*x)) x++; If the passed-in string was fully whitespace then the

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

2005-07-28 Thread Jon Smirl
Even simpler version -- Jon Smirl [EMAIL PROTECTED] Remove leading and trailing whitespace when text sysfs attribute is set signed-off-by: Jon Smirl <[EMAIL PROTECTED]> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -6,6 +6,7 @@ #include

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

2005-07-28 Thread Jon Smirl
New, simplified version of the sysfs whitespace strip patch... -- Jon Smirl [EMAIL PROTECTED] Remove leading and trailing whitespace when text sysfs attribute is set signed-off-by: Jon Smirl <[EMAIL PROTECTED]> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c --- a/fs/sysfs/file.c +++

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

2005-07-28 Thread Greg KH
On Thu, Jul 28, 2005 at 08:54:53AM -0400, Jon Smirl wrote: > On 7/28/05, Mitchell Blank Jr <[EMAIL PROTECTED]> wrote: > > Greg KH wrote: > > > > + /* locate trailng white space */ > > > > + z = y = x; > > > > + while (y - buffer->page < count) { > > > > + y++; > > > > + z

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

2005-07-28 Thread Mitchell Blank Jr
Jon Smirl wrote: > 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. As others have mentioned there shouldn't be a UTF8 problem with isspace(). However, even if you wanted to scan

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

2005-07-28 Thread Paulo Marques
Jon Smirl wrote: On 7/28/05, Mitchell Blank Jr <[EMAIL PROTECTED]> wrote: [...] 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--; Do we need to deal with UTF8 here?

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

2005-07-28 Thread Oliver Neukum
Am Donnerstag, 28. Juli 2005 14:54 schrieb Jon Smirl: > On 7/28/05, Mitchell Blank Jr <[EMAIL PROTECTED]> wrote: > > Greg KH wrote: > > > > + /* locate trailng white space */ > > > > + z = y = x; > > > > + while (y - buffer->page < count) { > > > > + y++; > > > > + z = y;

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

2005-07-28 Thread Jon Smirl
On 7/28/05, Mitchell Blank Jr <[EMAIL PROTECTED]> 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))

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

2005-07-28 Thread Jon Smirl
On 7/28/05, Greg KH <[EMAIL PROTECTED]> wrote: > On Thu, Jul 28, 2005 at 12:49:21AM -0400, Jon Smirl wrote: > > @@ -207,6 +208,28 @@ flush_write_buffer(struct dentry * dentr > > struct attribute * attr = to_attr(dentry); > > struct kobject * kobj = to_kobj(dentry->d_parent); > >

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

2005-07-28 Thread Mitchell Blank Jr
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++; > > + } > > + } > > +

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

2005-07-28 Thread Greg KH
On Thu, Jul 28, 2005 at 12:49:21AM -0400, Jon Smirl wrote: > @@ -207,6 +208,28 @@ flush_write_buffer(struct dentry * dentr > struct attribute * attr = to_attr(dentry); > struct kobject * kobj = to_kobj(dentry->d_parent); > struct sysfs_ops * ops = buffer->ops; > + char *x,

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

2005-07-28 Thread Greg KH
On Thu, Jul 28, 2005 at 12:49:21AM -0400, Jon Smirl wrote: @@ -207,6 +208,28 @@ flush_write_buffer(struct dentry * dentr struct attribute * attr = to_attr(dentry); struct kobject * kobj = to_kobj(dentry-d_parent); struct sysfs_ops * ops = buffer-ops; + char *x, *y, *z;

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

2005-07-28 Thread Mitchell Blank Jr
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

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

2005-07-28 Thread Jon Smirl
On 7/28/05, Greg KH [EMAIL PROTECTED] wrote: On Thu, Jul 28, 2005 at 12:49:21AM -0400, Jon Smirl wrote: @@ -207,6 +208,28 @@ flush_write_buffer(struct dentry * dentr struct attribute * attr = to_attr(dentry); struct kobject * kobj = to_kobj(dentry-d_parent); struct

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

2005-07-28 Thread Jon Smirl
On 7/28/05, Mitchell Blank Jr [EMAIL PROTECTED] 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)) { +

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

2005-07-28 Thread Oliver Neukum
Am Donnerstag, 28. Juli 2005 14:54 schrieb Jon Smirl: On 7/28/05, Mitchell Blank Jr [EMAIL PROTECTED] wrote: Greg KH wrote: + /* locate trailng white space */ + z = y = x; + while (y - buffer-page count) { + y++; + z = y; + while

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

2005-07-28 Thread Paulo Marques
Jon Smirl wrote: On 7/28/05, Mitchell Blank Jr [EMAIL PROTECTED] wrote: [...] 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--; Do we need to deal with UTF8 here? I

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

2005-07-28 Thread Mitchell Blank Jr
Jon Smirl wrote: 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. As others have mentioned there shouldn't be a UTF8 problem with isspace(). However, even if you wanted to scan going

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

2005-07-28 Thread Greg KH
On Thu, Jul 28, 2005 at 08:54:53AM -0400, Jon Smirl wrote: On 7/28/05, Mitchell Blank Jr [EMAIL PROTECTED] wrote: Greg KH wrote: + /* locate trailng white space */ + z = y = x; + while (y - buffer-page count) { + y++; + z = y; + while

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

2005-07-28 Thread Jon Smirl
New, simplified version of the sysfs whitespace strip patch... -- Jon Smirl [EMAIL PROTECTED] Remove leading and trailing whitespace when text sysfs attribute is set signed-off-by: Jon Smirl [EMAIL PROTECTED] diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c --- a/fs/sysfs/file.c +++

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

2005-07-28 Thread Jon Smirl
Even simpler version -- Jon Smirl [EMAIL PROTECTED] Remove leading and trailing whitespace when text sysfs attribute is set signed-off-by: Jon Smirl [EMAIL PROTECTED] diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -6,6 +6,7 @@ #include

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

2005-07-28 Thread Mitchell Blank Jr
Still one nitpick: Jon Smirl wrote: + while (isspace(*x) (x - buffer-page count)) + x++; I think you can just do: if (count 0) while (isspace(*x)) x++; If the passed-in string was fully whitespace then the trailing-whitespace

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

2005-07-28 Thread Jon Smirl
On 7/28/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Donnerstag, 28. Juli 2005 21:57 schrieb Jon Smirl: New, simplified version of the sysfs whitespace strip patch... Could you tell me why you don't just fail the operation if malformed input is supplied? Leading/trailing white space

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

2005-07-28 Thread Oliver Neukum
Am Donnerstag, 28. Juli 2005 23:12 schrieb Jon Smirl: On 7/28/05, Oliver Neukum [EMAIL PROTECTED] wrote: Am Donnerstag, 28. Juli 2005 21:57 schrieb Jon Smirl: New, simplified version of the sysfs whitespace strip patch... Could you tell me why you don't just fail the operation if

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

2005-07-28 Thread Oliver Neukum
Am Donnerstag, 28. Juli 2005 21:57 schrieb Jon Smirl: New, simplified version of the sysfs whitespace strip patch... Could you tell me why you don't just fail the operation if malformed input is supplied? Regards Oliver - To unsubscribe from this list: send the line

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

2005-07-27 Thread Jon Smirl
Change log and signed off -- Jon Smirl [EMAIL PROTECTED] Remove leading and trailing whitespace when text sysfs attributes are assigned a value. Signed-off-by: Jon Smirl <[EMAIL PROTECTED]> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -6,6

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

2005-07-27 Thread Greg KH
On Wed, Jul 27, 2005 at 11:59:11PM -0400, Jon Smirl wrote: > New patch with fixed whitespace. But no changelog info or signed-off-by line :( Care to try it again? thanks, greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL

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

2005-07-27 Thread Jon Smirl
New patch with fixed whitespace. -- Jon Smirl [EMAIL PROTECTED] diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -207,6 +208,28 @@ flush_write_buffer(struct dentry *

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

2005-07-27 Thread Greg KH
On Wed, Jul 27, 2005 at 10:05:34PM -0400, Jon Smirl wrote: > Any comments on this? I'll fix up the whitespace issues if everyone > agrees that the code works. I'll add the patch to my tree and -mm if you clean up the whitespace issues :) thanks, greg k-h - To unsubscribe from this list: send

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

2005-07-27 Thread Jon Smirl
Any comments on this? I'll fix up the whitespace issues if everyone agrees that the code works. This patch will break all of the fbdev attributes since I was making wrong assumptions. I have another patch ready to fix them after this one goes in. On 7/25/05, Jon Smirl <[EMAIL PROTECTED]> wrote:

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

2005-07-27 Thread Jon Smirl
Any comments on this? I'll fix up the whitespace issues if everyone agrees that the code works. This patch will break all of the fbdev attributes since I was making wrong assumptions. I have another patch ready to fix them after this one goes in. On 7/25/05, Jon Smirl [EMAIL PROTECTED] wrote:

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

2005-07-27 Thread Greg KH
On Wed, Jul 27, 2005 at 10:05:34PM -0400, Jon Smirl wrote: Any comments on this? I'll fix up the whitespace issues if everyone agrees that the code works. I'll add the patch to my tree and -mm if you clean up the whitespace issues :) thanks, greg k-h - To unsubscribe from this list: send the

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

2005-07-27 Thread Jon Smirl
New patch with fixed whitespace. -- Jon Smirl [EMAIL PROTECTED] diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -6,6 +6,7 @@ #include linux/fsnotify.h #include linux/kobject.h #include linux/namei.h +#include linux/ctype.h #include

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

2005-07-27 Thread Greg KH
On Wed, Jul 27, 2005 at 11:59:11PM -0400, Jon Smirl wrote: New patch with fixed whitespace. But no changelog info or signed-off-by line :( Care to try it again? thanks, greg k-h - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL

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

2005-07-27 Thread Jon Smirl
Change log and signed off -- Jon Smirl [EMAIL PROTECTED] Remove leading and trailing whitespace when text sysfs attributes are assigned a value. Signed-off-by: Jon Smirl [EMAIL PROTECTED] diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -6,6 +6,7

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

2005-07-25 Thread Dmitry Torokhov
On Monday 25 July 2005 22:15, Jon Smirl wrote: > + while( isspace(*x) && (x - buffer->page < count)) > + x++; > + > + /* locate trailng white space */ > + z = y = x; > + while (y - buffer->page < count) { > + y++; > + z = y; > +

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

2005-07-25 Thread Jon Smirl
On 7/25/05, Greg KH <[EMAIL PROTECTED]> wrote: > > I'll put one together to trim leading/trailing white space from the > > buffer before it is passed into the attribute functions. Now that I > > think about this I believe the attributes should have always had the > > leading/trailing white space

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

2005-07-25 Thread Greg KH
On Mon, Jul 25, 2005 at 08:56:17PM -0400, Jon Smirl wrote: > On 7/25/05, Greg KH <[EMAIL PROTECTED]> wrote: > > On Mon, Jul 25, 2005 at 08:28:10PM -0400, Jon Smirl wrote: > > > I didn't realize that echo was adding the CR, I thought that it always > > > appeared on the end of a sysfs attribute

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

2005-07-25 Thread Jon Smirl
On 7/25/05, Greg KH <[EMAIL PROTECTED]> wrote: > On Mon, Jul 25, 2005 at 08:28:10PM -0400, Jon Smirl wrote: > > I didn't realize that echo was adding the CR, I thought that it always > > appeared on the end of a sysfs attribute set. So now I have to go add > > white space stripping to a dozen

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

2005-07-25 Thread Greg KH
On Mon, Jul 25, 2005 at 08:28:10PM -0400, Jon Smirl wrote: > On 7/25/05, Greg KH <[EMAIL PROTECTED]> wrote: > > On Mon, Jul 25, 2005 at 12:30:43PM -0400, Jon Smirl wrote: > > > On 7/25/05, Dmitry Torokhov <[EMAIL PROTECTED]> wrote: > > > > On 7/25/05, Jon Smirl <[EMAIL PROTECTED]> wrote: > > > > >

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

2005-07-25 Thread Jon Smirl
On 7/25/05, Greg KH <[EMAIL PROTECTED]> wrote: > On Mon, Jul 25, 2005 at 12:30:43PM -0400, Jon Smirl wrote: > > On 7/25/05, Dmitry Torokhov <[EMAIL PROTECTED]> wrote: > > > On 7/25/05, Jon Smirl <[EMAIL PROTECTED]> wrote: > > > > On 7/25/05, Dmitry Torokhov <[EMAIL PROTECTED]> wrote: > > > > > On

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

2005-07-25 Thread Greg KH
On Mon, Jul 25, 2005 at 12:30:43PM -0400, Jon Smirl wrote: > On 7/25/05, Dmitry Torokhov <[EMAIL PROTECTED]> wrote: > > On 7/25/05, Jon Smirl <[EMAIL PROTECTED]> wrote: > > > On 7/25/05, Dmitry Torokhov <[EMAIL PROTECTED]> wrote: > > > > On Sunday 24 July 2005 23:09, Jon Smirl wrote: > > > > > I

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

2005-07-25 Thread Jon Smirl
On 7/25/05, Dmitry Torokhov <[EMAIL PROTECTED]> wrote: > On 7/25/05, Jon Smirl <[EMAIL PROTECTED]> wrote: > > On 7/25/05, Dmitry Torokhov <[EMAIL PROTECTED]> wrote: > > > On Sunday 24 July 2005 23:09, Jon Smirl wrote: > > > > I just pulled from GIT to test bind/unbind. I couldn't get it to work; >

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

2005-07-25 Thread Dmitry Torokhov
On 7/25/05, Jon Smirl <[EMAIL PROTECTED]> wrote: > On 7/25/05, Dmitry Torokhov <[EMAIL PROTECTED]> wrote: > > On Sunday 24 July 2005 23:09, Jon Smirl wrote: > > > I just pulled from GIT to test bind/unbind. I couldn't get it to work; > > > it isn't taking into account the CR on the end of the

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

2005-07-25 Thread Jon Smirl
On 7/25/05, Dmitry Torokhov <[EMAIL PROTECTED]> wrote: > On Sunday 24 July 2005 23:09, Jon Smirl wrote: > > I just pulled from GIT to test bind/unbind. I couldn't get it to work; > > it isn't taking into account the CR on the end of the input value of > > the sysfs attribute. This patch will fix

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

2005-07-25 Thread Jon Smirl
On 7/25/05, Dmitry Torokhov [EMAIL PROTECTED] wrote: On Sunday 24 July 2005 23:09, Jon Smirl wrote: I just pulled from GIT to test bind/unbind. I couldn't get it to work; it isn't taking into account the CR on the end of the input value of the sysfs attribute. This patch will fix it but

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

2005-07-25 Thread Dmitry Torokhov
On 7/25/05, Jon Smirl [EMAIL PROTECTED] wrote: On 7/25/05, Dmitry Torokhov [EMAIL PROTECTED] wrote: On Sunday 24 July 2005 23:09, Jon Smirl wrote: I just pulled from GIT to test bind/unbind. I couldn't get it to work; it isn't taking into account the CR on the end of the input value of

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

2005-07-25 Thread Jon Smirl
On 7/25/05, Dmitry Torokhov [EMAIL PROTECTED] wrote: On 7/25/05, Jon Smirl [EMAIL PROTECTED] wrote: On 7/25/05, Dmitry Torokhov [EMAIL PROTECTED] wrote: On Sunday 24 July 2005 23:09, Jon Smirl wrote: I just pulled from GIT to test bind/unbind. I couldn't get it to work; it isn't

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

2005-07-25 Thread Greg KH
On Mon, Jul 25, 2005 at 12:30:43PM -0400, Jon Smirl wrote: On 7/25/05, Dmitry Torokhov [EMAIL PROTECTED] wrote: On 7/25/05, Jon Smirl [EMAIL PROTECTED] wrote: On 7/25/05, Dmitry Torokhov [EMAIL PROTECTED] wrote: On Sunday 24 July 2005 23:09, Jon Smirl wrote: I just pulled from GIT

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

2005-07-25 Thread Jon Smirl
On 7/25/05, Greg KH [EMAIL PROTECTED] wrote: On Mon, Jul 25, 2005 at 12:30:43PM -0400, Jon Smirl wrote: On 7/25/05, Dmitry Torokhov [EMAIL PROTECTED] wrote: On 7/25/05, Jon Smirl [EMAIL PROTECTED] wrote: On 7/25/05, Dmitry Torokhov [EMAIL PROTECTED] wrote: On Sunday 24 July 2005

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

2005-07-25 Thread Greg KH
On Mon, Jul 25, 2005 at 08:28:10PM -0400, Jon Smirl wrote: On 7/25/05, Greg KH [EMAIL PROTECTED] wrote: On Mon, Jul 25, 2005 at 12:30:43PM -0400, Jon Smirl wrote: On 7/25/05, Dmitry Torokhov [EMAIL PROTECTED] wrote: On 7/25/05, Jon Smirl [EMAIL PROTECTED] wrote: On 7/25/05, Dmitry

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

2005-07-25 Thread Jon Smirl
On 7/25/05, Greg KH [EMAIL PROTECTED] wrote: On Mon, Jul 25, 2005 at 08:28:10PM -0400, Jon Smirl wrote: I didn't realize that echo was adding the CR, I thought that it always appeared on the end of a sysfs attribute set. So now I have to go add white space stripping to a dozen fbdev/drm

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

2005-07-25 Thread Greg KH
On Mon, Jul 25, 2005 at 08:56:17PM -0400, Jon Smirl wrote: On 7/25/05, Greg KH [EMAIL PROTECTED] wrote: On Mon, Jul 25, 2005 at 08:28:10PM -0400, Jon Smirl wrote: I didn't realize that echo was adding the CR, I thought that it always appeared on the end of a sysfs attribute set. So now I

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

2005-07-25 Thread Jon Smirl
On 7/25/05, Greg KH [EMAIL PROTECTED] wrote: I'll put one together to trim leading/trailing white space from the buffer before it is passed into the attribute functions. Now that I think about this I believe the attributes should have always had the leading/trailing white space removed. If

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

2005-07-25 Thread Dmitry Torokhov
On Monday 25 July 2005 22:15, Jon Smirl wrote: + while( isspace(*x) (x - buffer-page count)) + x++; + + /* locate trailng white space */ + z = y = x; + while (y - buffer-page count) { + y++; + z = y; + while( isspace(*y)

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

2005-07-24 Thread Dmitry Torokhov
On Sunday 24 July 2005 23:09, Jon Smirl wrote: > I just pulled from GIT to test bind/unbind. I couldn't get it to work; > it isn't taking into account the CR on the end of the input value of > the sysfs attribute. This patch will fix it but I'm sure there is a > cleaner solution. > "echo -n"

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

2005-07-24 Thread Jon Smirl
I just pulled from GIT to test bind/unbind. I couldn't get it to work; it isn't taking into account the CR on the end of the input value of the sysfs attribute. This patch will fix it but I'm sure there is a cleaner solution. -- Jon Smirl [EMAIL PROTECTED] diff --git a/drivers/base/bus.c

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

2005-07-24 Thread Jon Smirl
I just pulled from GIT to test bind/unbind. I couldn't get it to work; it isn't taking into account the CR on the end of the input value of the sysfs attribute. This patch will fix it but I'm sure there is a cleaner solution. -- Jon Smirl [EMAIL PROTECTED] diff --git a/drivers/base/bus.c

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

2005-07-24 Thread Dmitry Torokhov
On Sunday 24 July 2005 23:09, Jon Smirl wrote: I just pulled from GIT to test bind/unbind. I couldn't get it to work; it isn't taking into account the CR on the end of the input value of the sysfs attribute. This patch will fix it but I'm sure there is a cleaner solution. echo -n should