]> 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)
commite13854fdb4ee0f8077c2206b37dc46ffed2c0b3d
tree4e0d9fec53474f079b616dbe4088ed22afd70898
parent931e351c214fdefbb73f6f12a78b9b2925c860b6
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