memblock tests: Split up reset_memblock function

All memblock data structure fields are reset in one function. In some
test cases, it's preferred to reset memory region arrays without
modifying other values like allocation direction flag.

Extract two functions from reset_memblock, so it's possible to reset
different parts of memblock:
  - reset_memblock_regions    - reset region arrays and their counters
  - reset_memblock_attributes - set other fields to their default values

Update checks in basic_api.c to use new definitions. Remove
reset_memblock call from memblock_initialization_check, so the true
initial values are tested.

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Link: https://lore.kernel.org/r/5cc1ba9a0ade922dbf4ba450165b81a9ed17d4a9.1646055639.git.karolinadrobnik@gmail.com
This commit is contained in:
Karolina Drobnik
2022-02-28 15:46:43 +01:00
committed by Mike Rapoport
parent 2a7ceac9e5
commit 2c3dacba5d
3 changed files with 33 additions and 32 deletions

View File

@@ -10,6 +10,7 @@ struct region {
phys_addr_t size;
};
void reset_memblock(void);
void reset_memblock_regions(void);
void reset_memblock_attributes(void);
#endif