]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: taprio: Refactor taprio_get_start_time()
authorAndre Guedes <andre.guedes@intel.com>
Tue, 23 Apr 2019 19:44:21 +0000 (12:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Apr 2019 02:52:32 +0000 (19:52 -0700)
commit6a5d2a7f2086c5ba362282d95800d0f640fac612
tree4e0d9fec53474f079b616dbe4088ed22afd70898
parent0d854311f8c16b3e3f5047555a8e4657e32a55fb
net: sched: taprio: Refactor taprio_get_start_time()

This patch does a code refactoring to taprio_get_start_time() function
to improve readability and report error properly.

If 'base' time is later than 'now', the start time is equal to 'base'
and taprio_get_start_time() is done. That's the natural case so we move
that code to the beginning of the function. Also, if 'cycle' calculation
is zero, something went really wrong with taprio and we should log that
internal error properly.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_taprio.c