memblock tests: Split up reset_memblock function
authorKarolina Drobnik <karolinadrobnik@gmail.com>
Mon, 28 Feb 2022 14:46:43 +0000 (15:46 +0100)
committerMike Rapoport <rppt@linux.ibm.com>
Wed, 9 Mar 2022 13:18:57 +0000 (15:18 +0200)
commit2c3dacba5d46ef0ff83fe6b82570c433910b63ab
tree6f9ecc3261af43f6e187cf2f7b97ca7419e8f61e
parent2a7ceac9e58167fadc3496c5f694543d4bbe03ef
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
tools/testing/memblock/tests/basic_api.c
tools/testing/memblock/tests/common.c
tools/testing/memblock/tests/common.h