Skip to content

Commit b7836ed

Browse files
committed
lib: fprotect: Delete Kconfig option FPROTECT_ENABLE_IS_PROTECTED
I can't see any reason for the Kconfig option FPROTECT_ENABLE_IS_PROTECTED to exist so it is removed. It is best-practice to rely on the linker to exclude unused functions from the binary instead of using Kconfig options for every single function. This is a breaking change for anyone that is configuring FPROTECT_ENABLE_IS_PROTECTED explicitly, but I don't expect anyone is actually doing this. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
1 parent 45af2b5 commit b7836ed

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

include/fprotect.h

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ int fprotect_area_no_access(uint32_t start, size_t length);
5656
/**
5757
* @brief Check whether a block has already been protected.
5858
*
59+
* NB: Only supported on HW platforms with ACL (CONFIG_HAS_HW_NRF_ACL).
60+
*
5961
* @param[in] addr The address to check. The block containing this address
6062
* will be checked.
6163
*

lib/fprotect/Kconfig

-7
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ config FPROTECT_ENABLE_NO_ACCESS
5959
Allows to protect flash pages both from reading and writing until the
6060
next reboot.
6161

62-
config FPROTECT_ENABLE_IS_PROTECTED
63-
bool
64-
default y
65-
depends on FPROTECT && HAS_HW_NRF_ACL
66-
help
67-
Enable API to query if an address has been protected.
68-
6962
config FPROTECT_APP
7063
bool "Lock image partition using FPROTECT"
7164
depends on PARTITION_MANAGER_ENABLED && FPROTECT

lib/fprotect/fprotect_acl.c

-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ static int fprotect_set_permission(uint32_t start, size_t length,
5757
return 0;
5858
}
5959

60-
#ifdef CONFIG_FPROTECT_ENABLE_IS_PROTECTED
6160
uint32_t fprotect_is_protected(uint32_t addr)
6261
{
6362
uint32_t region_idx;
@@ -90,7 +89,6 @@ uint32_t fprotect_is_protected(uint32_t addr)
9089

9190
return 0;
9291
}
93-
#endif
9492

9593
int fprotect_area(uint32_t start, size_t length)
9694
{

0 commit comments

Comments
 (0)