Function report |
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 activity | Download SCCT | Chinese |
Name:test_parman_check_array
Proto:static int test_parman_check_array(struct test_parman *test_parman, bool gaps_allowed)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct test_parman * | test_parman | |
| bool | gaps_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 |
| 318 | last_unused_items++ |
| 319 | Continue |
| 321 | If last_unused_items && Not gaps_allowed Then |
| 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 |
| 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 |
| Name | Describe |
|---|---|
| test_parman_lsort |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |