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)
commit8599099f0c58cec677a47c968e777eee8d64fb80
tree4e0d9fec53474f079b616dbe4088ed22afd70898
parent59ab87f6eb920fd0ee3058ae4c0956f52036b893
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