public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: dtor_core@ameritech.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
Date: Mon, 25 Jul 2005 17:30:18 -0700	[thread overview]
Message-ID: <20050726003018.GA24089@kroah.com> (raw)
In-Reply-To: <9e473391050725172833617aca@mail.gmail.com>

On Mon, Jul 25, 2005 at 08:28:10PM -0400, Jon Smirl wrote:
> On 7/25/05, Greg KH <greg@kroah.com> wrote:
> > On Mon, Jul 25, 2005 at 12:30:43PM -0400, Jon Smirl wrote:
> > > On 7/25/05, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> > > > On 7/25/05, Jon Smirl <jonsmirl@gmail.com> wrote:
> > > > > On 7/25/05, Dmitry Torokhov <dtor_core@ameritech.net> 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 I'm sure there is a
> > > > > > > cleaner solution.
> > > > > > >
> > > > > >
> > > > > > "echo -n" should take care of this problem I think.
> > > > >
> > > > > That will work around it but I think we should fix it.  Changing to
> > > > > strncmp() fixes most cases.
> > > > >
> > > > > -       if (strcmp(name, dev->bus_id) == 0)
> > > > > +       if (strncmp(name, dev->bus_id, strlen(dev->bus_id)) == 0)
> > > > >
> > > >
> > > > This will produce "interesting results" if you have both "blah-1" and
> > > > "blah-10" devices on the bus.
> > 
> > Yes, not a good thing for USB devices specifically.
> > 
> > > Then the better solution is to fix the generic attribute set code to
> > > strip leading and trailing white space.
> > 
> > No, that might break other things as we have not been doing this from
> > day one.  I'd rather just change these two places, if it's that big of a
> > deal.  It was documented (in a lwn.net article) and the changelog entry,
> > that you should use "echo -n".
> 
> 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 sysfs attribute
> implementations. Given that the param is const I may have to allocate
> new buffers and copy. I also wonder how many other people have made
> the same mistake.

Nah, just zero out that \n character :)

> Are you sure it would break other things? These are supposed to be
> text attributes, not binary ones.

I agree, I don't know what would break.  Care to make a patch so we
could find out?

thanks,

greg k-h

  reply	other threads:[~2005-07-26  0:32 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-25  4:09 [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Jon Smirl
2005-07-25  4:58 ` Dmitry Torokhov
2005-07-25 14:28   ` Jon Smirl
2005-07-25 14:48     ` Dmitry Torokhov
2005-07-25 16:30       ` Jon Smirl
2005-07-26  0:00         ` Greg KH
2005-07-26  0:28           ` Jon Smirl
2005-07-26  0:30             ` Greg KH [this message]
2005-07-26  0:56               ` Jon Smirl
2005-07-26  1:54                 ` Greg KH
2005-07-26  3:15                   ` Jon Smirl
2005-07-26  3:29                     ` Dmitry Torokhov
2005-07-28  2:05                     ` Jon Smirl
2005-07-28  3:46                       ` Greg KH
2005-07-28  3:59                         ` Jon Smirl
2005-07-28  4:05                           ` Greg KH
2005-07-28  4:49                             ` Jon Smirl
2005-07-28  5:49                               ` Greg KH
2005-07-28  7:04                                 ` Mitchell Blank Jr
2005-07-28 12:54                                   ` Jon Smirl
2005-07-28 13:09                                     ` Oliver Neukum
2005-07-28 13:16                                     ` Paulo Marques
2005-07-28 18:09                                     ` Mitchell Blank Jr
2005-07-28 19:03                                     ` Greg KH
2005-07-28 19:57                                       ` Jon Smirl
2005-07-28 20:22                                         ` Mitchell Blank Jr
2005-07-28 20:27                                           ` Jon Smirl
2005-07-29 18:50                                             ` Jon Smirl
2005-08-06  0:42                                               ` Greg KH
2005-08-06  3:48                                                 ` Jon Smirl
2005-08-21 22:21                                             ` Jon Smirl
2005-07-28 21:10                                         ` Oliver Neukum
2005-07-28 21:12                                           ` Jon Smirl
2002-01-01  7:53                                             ` Pavel Machek
2005-08-05 13:32                                               ` Jon Smirl
2005-08-05 18:01                                                 ` Oliver Neukum
2005-08-05 18:14                                                   ` Jon Smirl
2005-08-05 18:20                                                     ` Oliver Neukum
2005-08-05 18:47                                                       ` Jon Smirl
2005-08-05 20:07                                                         ` Oliver Neukum
2005-08-05 20:33                                                           ` Jon Smirl
2005-08-06  9:39                                                             ` Oliver Neukum
2005-08-07 18:50                                                             ` Pavel Machek
2005-08-07 18:47                                                 ` Pavel Machek
2005-08-07 20:17                                                   ` Jon Smirl
2005-08-07 21:06                                                     ` Pavel Machek
2005-08-05 22:31                                               ` David Weinehall
2005-07-28 21:17                                             ` Oliver Neukum
2005-07-28 12:52                                 ` Jon Smirl
  -- strict thread matches above, loose matches on Subject: below --
2005-06-30  6:04 [PATCH] driver core: add bus_find_device & driver_find_device functions Greg KH
2005-06-30  6:04 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
2005-06-30  6:25   ` Dmitry Torokhov
2005-06-30  6:29     ` Greg KH
2005-06-24  5:12 [RFC] bind and unbind drivers from userspace through sysfs Greg KH
2005-06-24  5:14 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
2005-06-24 15:57   ` Patrick Mochel
2005-06-25  3:27     ` Greg KH
2005-06-25  4:16       ` Dmitry Torokhov
2005-06-25  9:39         ` Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050726003018.GA24089@kroah.com \
    --to=greg@kroah.com \
    --cc=dtor_core@ameritech.net \
    --cc=jonsmirl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox