From aec36449488290c12d93ecb19133fe62363aff6a Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 19 Dec 2013 14:26:51 +0300 Subject: [PATCH] kernel, db: add hweight() functions to the database These return unsigned int type but hweight8() can only return a number between 0 and 8. Signed-off-by: Dan Carpenter --- smatch_data/db/fixup_kernel.sh | 5 +++++ smatch_data/kernel.no_inline_functions | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/smatch_data/db/fixup_kernel.sh b/smatch_data/db/fixup_kernel.sh index f2e4966b..3f6f5266 100755 --- a/smatch_data/db/fixup_kernel.sh +++ b/smatch_data/db/fixup_kernel.sh @@ -57,6 +57,11 @@ update return_states set return = '0-u32max[<=p2]' where function = '__copy_from /* 64 CPUs aught to be enough for anyone */ update return_states set return = '1-64' where function = 'cpumask_weight'; +update return_states set return = '0-8' where function = '__arch_hweight8'; +update return_states set return = '0-16' where function = '__arch_hweight16'; +update return_states set return = '0-32' where function = '__arch_hweight32'; +update return_states set return = '0-64' where function = '__arch_hweight64'; + /* * Preserve the value across byte swapping. By the time we use it for math it * will be byte swapped back to CPU endian. diff --git a/smatch_data/kernel.no_inline_functions b/smatch_data/kernel.no_inline_functions index 7b2e5e82..4adc64bd 100644 --- a/smatch_data/kernel.no_inline_functions +++ b/smatch_data/kernel.no_inline_functions @@ -1,3 +1,7 @@ __fswab16 __fswab32 __fswab64 +__arch_hweight8 +__arch_hweight16 +__arch_hweight32 +__arch_hweight64 -- 2.11.4.GIT