Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\kfifo.c Create Date:2022-07-28 06:24:36
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__kfifo_init

Proto:int __kfifo_init(struct __kfifo *fifo, void *buffer, unsigned int size, size_t esize)

Type:int

Parameter:

TypeParameterName
struct __kfifo *fifo
void *buffer
unsigned intsize
size_tesize
69  size /= esize
71  If Not s_power_of_2() - check if a value is a power of two*@n: the value to check* Determine whether some value is a power of two, where zero is* *not* considered a power of two.* Return: true if @n is a power of 2, otherwise false. Then size = unddown_pow_of_two - round the given value down to nearest power of two*@n: parameter* round the given value down to the nearest power of two* - the result is undefined when n == 0* - this can be used to initialise global variables from constant data(size)
74  in = 0
75  out = 0
76  esize = esize
77  data = buffer
79  If size < 2 Then
80  mask = 0
81  Return -EINVAL
83  mask = size - 1
85  Return 0