lkml.org 
[lkml]   [2019]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 03/14] PCI/P2PDMA: Add constants for not-supported result upstream_bridge_distance()
    On Wed, Aug 07, 2019 at 09:58:06AM -0600, Logan Gunthorpe wrote:
    > We only calculate it at the same time as we calculate the distance. This
    > is necessary because, to calculate the type, we have to walk the tree
    > and check the ACS bits. If we separated it, we'd have to walk the tree
    > twice in a very similar way just to determine both the distance and the
    > mapping type.

    Calculating it together makes perfect sense. What I find odd is the
    overloading of a single return value. Why not return the map type as
    the return value, and the distance as a by reference argument to keep
    them properly separated?

    \
     
     \ /
      Last update: 2019-08-08 09:31    [W:3.383 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site