On Thu, Mar 31, 2016 at 12:32 AM, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx> wrote: > On Wed, Mar 23, 2016 at 07:40:21PM -0500, Rob Herring wrote: >> PCI device unit addresses are in the form DD or DD,F where DD is the >> device 0-0x1f and F is the function 0-7. Add checks that the unit >> address matches this form. > > Hmm.. we ought to be able to do a bit better than this, again by > constructing the expected unit address from reg. If I do that, I can't check the dev and function values are within range. > While we're at it, > it probably makes sense to have that dependent on a check which makes > sure the first entry in a pci device's 'reg' is the config address. You mean just check the first cell masked with 0x1f000000 is 0, right? Really, I'm not so worried about checking PCI devices. DT's with PCI devices described are rare. All I really want to check first are leading 0s, leading 0x and uppercase hex. That's 90% of what I find in reviews and am tired of commenting on. I do think bus specific checks are useful, but don't think we need to fill them all in right now. Rob -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html