All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: Grant Likely <grant.likely@secretlab.ca>,
	Josip Rodin <joy@entuzijast.net>
Cc: David Miller <davem@davemloft.net>,
	devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH] of: fix race when matching drivers
Date: Wed, 18 May 2011 17:03:36 +0000	[thread overview]
Message-ID: <match-use-var@mdm.bga.com> (raw)
In-Reply-To: <20110518162139.GA11027@ponder.secretlab.ca>

On Wed, 18 May 2011 about 10:21:39 -0600, Grant Likely wrote:
> On Wed, May 18, 2011 at 05:45:17PM +0200, Josip Rodin wrote:
> > On Wed, May 18, 2011 at 10:27:39AM -0500, Milton Miller wrote:
> > > --- work.git.orig/include/linux/of_device.h	2011-05-18 09:57:01.014386816 -0500
> > > +++ work.git/include/linux/of_device.h	2011-05-18 09:58:27.537431575 -0500
> > > @@ -21,8 +21,15 @@ extern void of_device_make_bus_id(struct
> > >  static inline int of_driver_match_device(struct device *dev,
> > >  					 const struct device_driver *drv)
> > >  {
> > > -	dev->of_match = of_match_device(drv->of_match_table, dev);
> > > -	return dev->of_match != NULL;
> > > +	const struct of_device_id *match;
> > > +
> > > +	match = of_match_device(drv->of_match_table, dev);
> > > +	if (match) {
> > > +		dev->of_match = of_match_device(drv->of_match_table, dev);
> > > +		return 1;
> > > +	}
> > > +
> > > +	return 0;
> > >  }
> > 
> > Err, is there some reason to avoid simply assigning the existing result:
> > dev->of_match = match; ?
> 
> Good point.  I've committed and am currently testing the modified version.
> 
> g.

Sorry about that.  I had intended to do that (hence creating the
variable), but obvioiusly I forgot when I hurried to compile test
and send out the patch.

thanks to Josip for finding and Grant for fixing.

milton

WARNING: multiple messages have this Message-ID (diff)
From: Milton Miller <miltonm@bga.com>
To: Grant Likely <grant.likely@secretlab.ca>,
	Josip Rodin <joy@entuzijast.net>
Cc: David Miller <davem@davemloft.net>,
	devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH] of: fix race when matching drivers
Date: Wed, 18 May 2011 12:03:36 -0500	[thread overview]
Message-ID: <match-use-var@mdm.bga.com> (raw)
In-Reply-To: <20110518162139.GA11027@ponder.secretlab.ca>

On Wed, 18 May 2011 about 10:21:39 -0600, Grant Likely wrote:
> On Wed, May 18, 2011 at 05:45:17PM +0200, Josip Rodin wrote:
> > On Wed, May 18, 2011 at 10:27:39AM -0500, Milton Miller wrote:
> > > --- work.git.orig/include/linux/of_device.h	2011-05-18 09:57:01.014386816 -0500
> > > +++ work.git/include/linux/of_device.h	2011-05-18 09:58:27.537431575 -0500
> > > @@ -21,8 +21,15 @@ extern void of_device_make_bus_id(struct
> > >  static inline int of_driver_match_device(struct device *dev,
> > >  					 const struct device_driver *drv)
> > >  {
> > > -	dev->of_match = of_match_device(drv->of_match_table, dev);
> > > -	return dev->of_match != NULL;
> > > +	const struct of_device_id *match;
> > > +
> > > +	match = of_match_device(drv->of_match_table, dev);
> > > +	if (match) {
> > > +		dev->of_match = of_match_device(drv->of_match_table, dev);
> > > +		return 1;
> > > +	}
> > > +
> > > +	return 0;
> > >  }
> > 
> > Err, is there some reason to avoid simply assigning the existing result:
> > dev->of_match = match; ?
> 
> Good point.  I've committed and am currently testing the modified version.
> 
> g.

Sorry about that.  I had intended to do that (hence creating the
variable), but obvioiusly I forgot when I hurried to compile test
and send out the patch.

thanks to Josip for finding and Grant for fixing.

milton

  reply	other threads:[~2011-05-18 17:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02 10:39 SBus devices sometimes detected, sometimes not Meelis Roos
2011-05-02 21:51 ` David Miller
2011-05-17 20:43 ` David Miller
2011-05-17 20:43   ` David Miller
2011-05-18  4:29   ` Grant Likely
2011-05-18  4:29     ` Grant Likely
2011-05-18 13:59     ` mroos
2011-05-18 13:59       ` mroos
2011-05-18 15:27 ` [PATCH] of: fix race when matching drivers Milton Miller
2011-05-18 15:27   ` Milton Miller
2011-05-18 15:27   ` Milton Miller
2011-05-18 15:41   ` Grant Likely
2011-05-18 15:41     ` Grant Likely
2011-05-18 15:41     ` Grant Likely
2011-05-18 15:47     ` Grant Likely
2011-05-18 15:47       ` Grant Likely
2011-05-18 15:47       ` Grant Likely
2011-05-18 15:45   ` Josip Rodin
2011-05-18 15:45     ` Josip Rodin
2011-05-18 16:21     ` Grant Likely
2011-05-18 16:21       ` Grant Likely
2011-05-18 17:03       ` Milton Miller [this message]
2011-05-18 17:03         ` Milton Miller

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=match-use-var@mdm.bga.com \
    --to=miltonm@bga.com \
    --cc=davem@davemloft.net \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=joy@entuzijast.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.