]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - libfrog/util.c
libfrog: fix bitmap error communication problems
[thirdparty/xfsprogs-dev.git] / libfrog / util.c
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
5 */
6 #include "platform_defs.h"
7 #include "util.h"
8
9 /*
10 * libfrog is a collection of miscellaneous userspace utilities.
11 * It's a library of Funny Random Oddball Gunk <cough>.
12 */
13
14 unsigned int
15 log2_roundup(unsigned int i)
16 {
17 unsigned int rval;
18
19 for (rval = 0; rval < NBBY * sizeof(i); rval++) {
20 if ((1 << rval) >= i)
21 break;
22 }
23 return rval;
24 }