Skip to content

Commit 4e44822

Browse files
OmegaRelaykartben
authored andcommitted
fs: zms: make zms_active_sector_free_space return type signed
zms_active_sector_free_space is documented to return -EACCES on fs not mounted error but currently returns an usigned type size_t. This fixes that by changing the return value into a ssize_t Signed-off-by: Theis Mejnertsen <[email protected]>
1 parent 7ff93d7 commit 4e44822

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/zephyr/fs/zms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ ssize_t zms_calc_free_space(struct zms_fs *fs);
218218
* @retval >=0 Number of free bytes in the currently active sector
219219
* @retval -EACCES if ZMS is still not initialized.
220220
*/
221-
size_t zms_active_sector_free_space(struct zms_fs *fs);
221+
ssize_t zms_active_sector_free_space(struct zms_fs *fs);
222222

223223
/**
224224
* @brief Close the currently active sector and switch to the next one.

subsys/fs/zms/zms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ ssize_t zms_calc_free_space(struct zms_fs *fs)
18371837
return free_space;
18381838
}
18391839

1840-
size_t zms_active_sector_free_space(struct zms_fs *fs)
1840+
ssize_t zms_active_sector_free_space(struct zms_fs *fs)
18411841
{
18421842
if (!fs->ready) {
18431843
LOG_ERR("ZMS not initialized");

0 commit comments

Comments
 (0)