DIV_ROUND_UP_POW2(9)
okay bestie, welcome to the DIV_ROUND_UP_POW2(9) page in the Kernel API Manual β itβs giving βdivide and round upβ and honestly it ate π
β¨
β¨ NAME β¨
DIV_ROUND_UP_POW2 β divide and round up π
π SYNOPSIS π
DIV_ROUND_UP_POW2 (n , d );
π¦ ARGUMENTS π¦
nβ numerator πΈdβ denominator (must be a power of 2). periodt, no cap π
π DESCRIPTION π
So like, DIV_ROUND_UP_POW2 divides n by d and rounds up to the next multiple of d β and yes, d must be a power of 2, that part is literally not optional bestie ππ
It avoids the integer overflows that may occur with __KERNEL_DIV_ROUND_UP π. Performance is roughly equivalent to __KERNEL_DIV_ROUND_UP, so itβs not sacrificing speed for the glow-up π₯
π«Ά SEE ALSO π«Ά
Kernel file ./include/linux/math.h, plus these icons: round_up(9), round_down(9), roundup(9), rounddown(9), abs(9), abs_diff(9), reciprocal_scale(9) β¨
source/version: ./include/linux Β· date: October 2026 β DIV_ROUND_UP_POW2(9) out πππ§
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms