• Eric Farman's avatar
    vfio/ccw: refactor the idaw counter · b21f9cb1
    Eric Farman authored
    The rules of an IDAW are fairly simple: Each one can move no
    more than a defined amount of data, must not cross the
    boundary defined by that length, and must be aligned to that
    length as well. The first IDAW in a list is special, in that
    it does not need to adhere to that alignment, but the other
    rules still apply. Thus, by reading the first IDAW in a list,
    the number of IDAWs that will comprise a data transfer of a
    particular size can be calculated.
    
    Let's factor out the reading of that first IDAW with the
    logic that calculates the length of the list, to simplify
    the rest of the routine that handles the individual IDAWs.
    Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
    Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    b21f9cb1
vfio_ccw_cp.c 22.2 KB