Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:test_parman_check_array

Proto:static int test_parman_check_array(struct test_parman *test_parman, bool gaps_allowed)

Type:int

Parameter:

TypeParameterName
struct test_parman *test_parman
boolgaps_allowed
303  last_unused_items = 0
304  last_priority = 0
305  used_items = 0
308  If prio_array_limit < TEST_PARMAN_BASE_COUNT Then
309  pr_err("Array limit is lower than the base count (%lu < %lu)\n", prio_array_limit, TEST_PARMAN_BASE_COUNT)
311  Return -EINVAL
314  When i < prio_array_limit cycle
315  item = prio_array[i]
317  If Not item Then
319  Continue
321  If last_unused_items && Not gaps_allowed Then
322  pr_err("Gap found in array even though they are forbidden\n")
323  Return -EINVAL
326  last_unused_items = 0
327  used_items++
329  If priority < last_priority Then
330  pr_err("Item belongs under higher priority then the last one (current: %lu, previous: %lu)\n", priority, last_priority)
332  Return -EINVAL
334  last_priority = priority
336  If index != i Then
337  pr_err("Item has different index in compare to where it actually is (%lu != %d)\n", index, i)
339  Return -EINVAL
343  If used_items != used_items Then
344  pr_err("Number of used items in array does not match (%u != %u)\n", used_items, used_items)
346  Return -EINVAL
349  If last_unused_items >= TEST_PARMAN_RESIZE_STEP_COUNT Then
350  pr_err("Number of unused item at the end of array is bigger than resize step (%u >= %lu)\n", last_unused_items, TEST_PARMAN_RESIZE_STEP_COUNT)
352  Return -EINVAL
355  pr_info("Priority array check successful\n")
357  Return 0
Caller
NameDescribe
test_parman_lsort