Also remove yaffs_hweight and use the hweight in u-boot. Signed-off-by: Charles Manning <cdhmanning@gmail.com>master
parent
7cdcaef0b2
commit
74f45b739b
@ -1 +0,0 @@ |
||||
/* Dummy header for u-boot */ |
@ -1 +0,0 @@ |
||||
/* Dummy header for u-boot */ |
@ -1,4 +0,0 @@ |
||||
#include <linux/stddef.h> |
||||
#include <linux/string.h> |
||||
#include <linux/stat.h> |
||||
#include <common.h> |
@ -1,52 +0,0 @@ |
||||
/*
|
||||
* YAFFS: Yet Another Flash File System. A NAND-flash specific file system. |
||||
* |
||||
* Copyright (C) 2002-2011 Aleph One Ltd. |
||||
* for Toby Churchill Ltd and Brightstar Engineering |
||||
* |
||||
* Created by Charles Manning <charles@aleph1.co.uk> |
||||
* |
||||
* This program is free software; you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License version 2 as |
||||
* published by the Free Software Foundation. |
||||
*/ |
||||
|
||||
/* These functions have been renamed to hweightxx to match the
|
||||
* equivaqlent functions in the Linux kernel. |
||||
*/ |
||||
|
||||
#include "yaffs_hweight.h" |
||||
|
||||
static const char yaffs_count_bits_table[256] = { |
||||
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, |
||||
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, |
||||
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, |
||||
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, |
||||
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, |
||||
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, |
||||
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, |
||||
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, |
||||
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, |
||||
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, |
||||
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, |
||||
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, |
||||
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, |
||||
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, |
||||
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, |
||||
4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 |
||||
}; |
||||
|
||||
int yaffs_hweight8(u8 x) |
||||
{ |
||||
int ret_val; |
||||
ret_val = yaffs_count_bits_table[x]; |
||||
return ret_val; |
||||
} |
||||
|
||||
int yaffs_hweight32(u32 x) |
||||
{ |
||||
return yaffs_hweight8(x & 0xff) + |
||||
yaffs_hweight8((x >> 8) & 0xff) + |
||||
yaffs_hweight8((x >> 16) & 0xff) + |
||||
yaffs_hweight8((x >> 24) & 0xff); |
||||
} |
@ -1,24 +0,0 @@ |
||||
/*
|
||||
* YAFFS: Yet another Flash File System . A NAND-flash specific file system. |
||||
* |
||||
* Copyright (C) 2002-2011 Aleph One Ltd. |
||||
* for Toby Churchill Ltd and Brightstar Engineering |
||||
* |
||||
* Created by Charles Manning <charles@aleph1.co.uk> |
||||
* |
||||
* This program is free software; you can redistribute it and/or modify |
||||
* it under the terms of the GNU Lesser General Public License version 2.1 as |
||||
* published by the Free Software Foundation. |
||||
* |
||||
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. |
||||
*/ |
||||
|
||||
#ifndef __YAFFS_HWEIGHT_H__ |
||||
#define __YAFFS_HWEIGHT_H__ |
||||
|
||||
#include "yportenv.h" |
||||
|
||||
int yaffs_hweight8(u8 x); |
||||
int yaffs_hweight32(u32 x); |
||||
|
||||
#endif |
Loading…
Reference in new issue