]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - libfrog/util.c
libfrog: fix workqueue_add error out
[thirdparty/xfsprogs-dev.git] / libfrog / util.c
CommitLineData
959ef981 1// SPDX-License-Identifier: GPL-2.0
24f4f998
DW
2/*
3 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
24f4f998
DW
5 */
6#include "platform_defs.h"
660b5d96 7#include "util.h"
24f4f998
DW
8
9/*
10 * libfrog is a collection of miscellaneous userspace utilities.
11 * It's a library of Funny Random Oddball Gunk <cough>.
12 */
13
14unsigned int
15log2_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}