]> git.baikalelectronics.ru Git - kernel.git/commit
ptp: ocp: Use DIV64_U64_ROUND_UP for rounding.
authorJonathan Lemon <jonathan.lemon@gmail.com>
Fri, 6 May 2022 22:37:39 +0000 (15:37 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 May 2022 00:18:41 +0000 (17:18 -0700)
commitb61517eed7f514592d6ce65e430b14ed7d81c86a
treef2ddc804838f2febde41d71db14d68568e4f242d
parentd3f902a4bef968043600925ab461ff5304cd406f
ptp: ocp: Use DIV64_U64_ROUND_UP for rounding.

The initial code used roundup() to round the starting time to
a multiple of a period.  This generated an error on 32-bit
systems, so was replaced with DIV_ROUND_UP_ULL().

However, this truncates to 32-bits on a 64-bit system.  Replace
with DIV64_U64_ROUND_UP() instead.

Fixes: 03c5c3a8c3a7 ("ptp: ocp: Add signal generators and update sysfs nodes")
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Link: https://lore.kernel.org/r/20220506223739.1930-2-jonathan.lemon@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_ocp.c