nuttx/arch: remove the custom board check in up_testset implementation #14963
+10
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The
up_testset
implementation is common code, should not add custom board check.If there are new boards that need to use their own
up_testset()
implementation, for example,CONFIG_ARCH_CHIP_1XXX
, has provided thier ownup_testset()
implementation, in order to working withCONFIG_ARCH_CHIP_1XXX
,we need to change the implemetaton to:
which would make the macro check becoming longer and longer;
beside from this, if the board of
CONFIG_ARCH_CHIP_1XXX
will not upstream to github, then this code will also cannot upstream to github;beside from the upper cause, another reason for introducing a new configuration:
CONFIG_ARCH_HAVE_CUSTOM_TESTSET
is that generally a board belongs to an architecture. For example, CONFIG_ARCH_CHIP_LC823450 belongs to ARMV7_M. Then ARMV7_M itself hasCONFIG_ARCH_HAVE_TESTSET
enabled.In this case, all the boards under ARMV7_M have
CONFIG_ARCH_HAVE_TESTSET
enabled by default.However,
CONFIG_ARCH_CHIP_LC823450
doesn't requireCONFIG_ARCH_HAVE_TESTSET
. We can't turn offCONFIG_ARCH_HAVE_TESTSET
for all the boards under the entireARMV7_M
just for the sake of this singleCONFIG_ARCH_CHIP_LC823450.
Therefore, we have introduced a new option called
CONFIG_ARCH_HAVE_CUSTOM_TESTSET
.Impact
If some boards need custom
up_testset
implementation, should not to add macro control onarch/arm/include/spinlock.h
, just modify the board config insidearch/arm/Kconfig
will work.Testing
has passed ostest