函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\memweight.c Create Date:2022-07-27 07:21:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: 计算内存区域中的位总数

函数原型:size_t memweight(const void *ptr, size_t bytes)

返回类型:size_t

参数:

类型参数名称
const void *ptr
size_tbytes
13  ret等于0
15  bitmap等于ptr
17 bytes大于0且bitmap取模sizeof(long)循环ret加等于Generic interface.( * bitmap)
21  longs等于bytessizeof(long)
22  如果longs
23  BUG_ON(longs >= INT_MAX / BITS_PER_LONG)
24  ret加等于bitmap_weight((unsignedlong * )bitmap, longs * BITS_PER_LONG)
26  bytes减等于longssizeof(long)
27  bitmap加等于longssizeof(long)
34 bytes大于0循环ret加等于Generic interface.( * bitmap)
37  返回:ret