]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
uapi: Provide DIV_ROUND_CLOSEST()
authorCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tue, 3 Mar 2026 19:24:17 +0000 (21:24 +0200)
committerDaniel Stone <daniels@collabora.com>
Wed, 18 Mar 2026 09:59:57 +0000 (09:59 +0000)
commitde9e2b3d88af36411301c049a1b049f3e4fe0757
treedf5effb1776ac5d1dad7b5c1dc0ddb15e5aab04f
parent25854131c04a5aa25a41cf527aab269aadb86699
uapi: Provide DIV_ROUND_CLOSEST()

Currently DIV_ROUND_CLOSEST() is only available for the kernel via
include/linux/math.h.

Expose it to userland as well by adding __KERNEL_DIV_ROUND_CLOSEST() as
a common definition in uapi.

Additionally, ensure it allows building ISO C applications by switching
from the 'typeof' GNU extension to the ISO-friendly __typeof__.

Reviewed-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Diederik de Haas <diederik@cknow-tech.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://patch.msgid.link/20260303-rk3588-bgcolor-v8-1-fee377037ad1@collabora.com
Signed-off-by: Daniel Stone <daniels@collabora.com>
include/linux/math.h
include/uapi/linux/const.h