]> git.baikalelectronics.ru Git - kernel.git/commit
timer: add fsleep for flexible sleeping
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 1 May 2020 21:27:21 +0000 (23:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 May 2020 00:03:34 +0000 (17:03 -0700)
commit14e6f45ab2c0f4307ecc8889cb6b301f8ea77f77
tree7ec9292a89a88376a78f4ad035dc9986d1dcad7e
parent970adf76b023278117cf8d3613da1d0b265920ea
timer: add fsleep for flexible sleeping

Sleeping for a certain amount of time requires use of different
functions, depending on the time period.
Documentation/timers/timers-howto.rst explains when to use which
function, and also checkpatch checks for some potentially
problematic cases.

So let's create a helper that automatically chooses the appropriate
sleep function -> fsleep(), for flexible sleeping

If the delay is a constant, then the compiler should be able to ensure
that the new helper doesn't create overhead. If the delay is not
constant, then the new helper can save some code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/timers/timers-howto.rst
include/linux/delay.h