Skip to content

Commit ef2773d

Browse files
aescolarcarlescufi
authored andcommitted
fs: nvs: Use ZTESTABLE_STATIC instead of STATIC
Use the ZTESTABLE_STATIC macro to define symbols which need to be accessible from ztests, instead of redefining STATIC which causes trouble with some hals. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
1 parent c77d74f commit ef2773d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

‎subsys/kvss/nvs/nvs.c‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
#include <zephyr/logging/log.h>
1818
LOG_MODULE_REGISTER(fs_nvs, CONFIG_NVS_LOG_LEVEL);
1919

20-
#ifdef CONFIG_ZTEST
21-
#define STATIC
22-
#else
23-
#define STATIC static
24-
#endif
25-
2620
static int nvs_prev_ate(struct nvs_fs *fs, uint32_t *addr, struct nvs_ate *ate);
2721
static int nvs_ate_valid(struct nvs_fs *fs, uint16_t entry_addr,
2822
const struct nvs_ate *entry);
@@ -112,8 +106,8 @@ static inline size_t nvs_al_size(struct nvs_fs *fs, size_t len)
112106
* may include a header, primary data, and a tail. All buffers are
113107
* written as a single contiguous stream.
114108
*/
115-
STATIC int nvs_flash_al_wrt_streams(struct nvs_fs *fs, uint32_t addr,
116-
const struct nvs_flash_wrt_stream *strm)
109+
ZTESTABLE_STATIC int nvs_flash_al_wrt_streams(struct nvs_fs *fs, uint32_t addr,
110+
const struct nvs_flash_wrt_stream *strm)
117111
{
118112
const struct flash_parameters *fp = fs->flash_parameters;
119113
size_t wbs = fp->write_block_size;

0 commit comments

Comments
 (0)