mkfs_ext2: small tweak
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
05647b5551
commit
69f2e2cdeb
@ -75,10 +75,11 @@ static unsigned int_log2(unsigned arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// taken from mkfs_minix.c. libbb candidate?
|
// taken from mkfs_minix.c. libbb candidate?
|
||||||
static unsigned div_roundup(uint64_t size, uint32_t n)
|
// why "uint64_t size"? we never use it for anything >32 bits
|
||||||
|
static uint32_t div_roundup(uint64_t size, uint32_t n)
|
||||||
{
|
{
|
||||||
// Overflow-resistant
|
// Overflow-resistant
|
||||||
uint64_t res = size / n;
|
uint32_t res = size / n;
|
||||||
if (res * n != size)
|
if (res * n != size)
|
||||||
res++;
|
res++;
|
||||||
return res;
|
return res;
|
||||||
|
Loading…
Reference in New Issue
Block a user