devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
To: Frank Rowand
	<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [RFC/PATCH] dt: Add of_device_compatible_match()
Date: Fri, 08 Jul 2016 08:25:52 +1000	[thread overview]
Message-ID: <1467930352.27157.70.camel@kernel.crashing.org> (raw)
In-Reply-To: <577E868E.30702-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Thu, 2016-07-07 at 09:42 -0700, Frank Rowand wrote:
> 
> of_device_is_compatible() returns a higher value for a better match.
> 
> of_fdt_match() returns a lower value for a better match.

Ugh ... that smells of trainwreck...

> So checking for (tmp < score) will give you the opposite of what you want.

Yup. I'll fix it.

> And if you are replacing of_fdt_match() with of_device_compatible_match(),
> the caller will have the expectation that a smaller score is a better
> match.

The few callers I converted only really cared about exact matches.

Cheers,
Ben.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2016-07-07 22:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-26 22:47 [RFC/PATCH] dt: Add of_device_compatible_match() Benjamin Herrenschmidt
     [not found] ` <1466981246.20278.27.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2016-07-07  6:29   ` Michael Ellerman
     [not found]     ` <1467872962.20157.1.camel-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
2016-07-07  7:23       ` Arnd Bergmann
2016-07-07 16:45       ` Frank Rowand
2016-07-07 16:42   ` Frank Rowand
     [not found]     ` <577E868E.30702-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-07-07 22:25       ` Benjamin Herrenschmidt [this message]

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=1467930352.27157.70.camel@kernel.crashing.org \
    --to=benh-xvmvhmargas8u2djnn8i7kb+6bgklq7r@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).