aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-07-16 16:35:41 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-07-16 16:35:41 -0700
commit626d58ed66e1f555f4cb112349652c8455263ac9 (patch)
tree5b666a3fb155075dcabb6966519b0a55ad60a0df
parent174d92a09a250c64451d8340219a89593172b056 (diff)
downloadhdt-pierre-626d58ed66e1f555f4cb112349652c8455263ac9.tar.gz
hdt-pierre-626d58ed66e1f555f4cb112349652c8455263ac9.tar.xz
hdt-pierre-626d58ed66e1f555f4cb112349652c8455263ac9.zip
diskio: remove locally coded ilog2()
Use the centrally coded ilog2() function. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--core/fs/diskio.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/core/fs/diskio.c b/core/fs/diskio.c
index 55a9df4d..b6722e76 100644
--- a/core/fs/diskio.c
+++ b/core/fs/diskio.c
@@ -6,6 +6,7 @@
#include <core.h>
#include <fs.h>
#include <disk.h>
+#include <ilog2.h>
#define RETRY_COUNT 6
@@ -291,19 +292,6 @@ static inline bool is_power_of_2(uint32_t x)
return !(x & (x-1));
}
-static int ilog2(uint32_t num)
-{
- int i = 0;
-
- if (!is_power_of_2(num)) {
- printf("ERROR: the num must be power of 2 when conveting to log2\n");
- return 0;
- }
- while (num >>= 1)
- i++;
- return i;
-}
-
void getoneblk(struct disk *disk, char *buf, block_t block, int block_size)
{
int sec_per_block = block_size / disk->sector_size;