• Alex Elder's avatar
    net: ipa: rearrange functions for similarity · 48395fa8
    Alex Elder authored
    Both aggr_time_limit_encode() and hol_block_timer_encode() figure
    out how to encode a millisecond time value so it can be programmed
    into a register.  Rearranging them a bit can make their similarity
    more obvious, with both taking essentially the same form.
    
    To do this:
      - Return 0 immediately in aggr_time_limit_encode() if the
        microseconds value supplied is zero.
      - Reverse the test at top of aggr_time_limit_encode(), so we
        compute and return the Qtime value in the "true" block,
        and compute the result the old way otherwise.
      - Open-code (and eliminate) hol_block_timer_qtime_encode() at the
        top of hol_block_timer_encode() in the case we use Qtimer.
    Signed-off-by: default avatarAlex Elder <elder@linaro.org>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    48395fa8
ipa_endpoint.c 53.6 KB