svn commit: r362285 - head/sys/dev/pci

Ed Maste emaste at freebsd.org
Thu Jun 18 21:29:21 UTC 2020


On Thu, 18 Jun 2020 at 08:48, Jessica Clarke <jrtc27 at freebsd.org> wrote:
>
> On 18 Jun 2020, at 13:23, Ed Maste <emaste at freebsd.org> wrote:
> > On Wed, 17 Jun 2020 at 15:56, Andrew Turner <andrew at freebsd.org> wrote:
> >>
> >> Author: andrew
> >> Date: Wed Jun 17 19:56:17 2020
> >> New Revision: 362285
> >> URL: https://svnweb.freebsd.org/changeset/base/362285
> >>
> >> Log:
> >>  Clean up the pci host generic driver
> > ...
> >>
> >> +       /* Translate the address from a PCI address to a physical address */
> >> +       switch (type) {
> >> +       case SYS_RES_IOPORT:
> >> +       case SYS_RES_MEMORY:
> >> +               found = false;
> >> +               for (i = 0; i < MAX_RANGES_TUPLES; i++) {
> >> +                       pci_base = sc->ranges[i].pci_base;
> >> +                       phys_base = sc->ranges[i].phys_base;
> >> +                       size = sc->ranges[i].size;
> >> +
> >> +                       if (start < pci_base || start >= pci_base + size)
> >> +                               continue;
> >
> > Should the second condition be end instead? markj had this comment on
> > the old version in review D20884.
>
> The code previously had:
>
> > if ((rman_get_start(r) >= pci_base) && (rman_get_start(r) < (pci_base + size)))
> >       found = 1;
> >       break;
> > }
>
> The new code is just the inverted form of that.

Yes; Mark made the comment (that the 2nd rman_get_start should be
rman_get_end) about the previous version of the code but no change was
made. I believe that comment still applies.


More information about the svn-src-all mailing list