diff --git a/pkg/fatfs/fatfs_vfs/fatfs_vfs.c b/pkg/fatfs/fatfs_vfs/fatfs_vfs.c index 0b8b47f47c..5c6886b2f2 100644 --- a/pkg/fatfs/fatfs_vfs/fatfs_vfs.c +++ b/pkg/fatfs/fatfs_vfs/fatfs_vfs.c @@ -307,8 +307,6 @@ static int _fstat(vfs_file_t *filp, struct stat *buf) FILINFO fi; FRESULT res; - memset(buf, 0, sizeof(*buf)); - res = f_stat(fs_desc->abs_path_str_buff, &fi); if (res != FR_OK) { diff --git a/pkg/spiffs/fs/spiffs_fs.c b/pkg/spiffs/fs/spiffs_fs.c index bff851af00..076a0876ee 100644 --- a/pkg/spiffs/fs/spiffs_fs.c +++ b/pkg/spiffs/fs/spiffs_fs.c @@ -227,7 +227,6 @@ static int _statvfs(vfs_mount_t *mountp, const char *restrict path, struct statv return -EFAULT; } spiffs_desc_t *fs_desc = mountp->private_data; - memset(buf, 0, sizeof(*buf)); uint32_t total; uint32_t used; @@ -347,8 +346,6 @@ static int _fstat(vfs_file_t *filp, struct stat *buf) spiffs_stat stat; s32_t ret; - memset(buf, 0, sizeof(*buf)); - ret = SPIFFS_fstat(&fs_desc->fs, filp->private_data.value, &stat); if (ret < 0) { diff --git a/sys/fs/constfs/constfs.c b/sys/fs/constfs/constfs.c index d8a5da39e1..f3fcbe1c8f 100644 --- a/sys/fs/constfs/constfs.c +++ b/sys/fs/constfs/constfs.c @@ -144,7 +144,6 @@ static int constfs_statvfs(vfs_mount_t *mountp, const char *restrict path, struc } constfs_t *fs = mountp->private_data; /* clear out the stat buffer first */ - memset(buf, 0, sizeof(*buf)); buf->f_bsize = sizeof(uint8_t); /* block size */ buf->f_frsize = sizeof(uint8_t); /* fundamental block size */ fsblkcnt_t f_blocks = 0; @@ -309,8 +308,7 @@ static int constfs_closedir(vfs_DIR *dirp) static void _constfs_write_stat(const constfs_file_t *fp, struct stat *restrict buf) { - /* clear out the stat buffer first */ - memset(buf, 0, sizeof(*buf)); + /* buffer is cleared by vfs already */ buf->st_nlink = 1; buf->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH; buf->st_size = fp->size; diff --git a/sys/posix/sockets/posix_sockets.c b/sys/posix/sockets/posix_sockets.c index e95344b755..e0117e79fa 100644 --- a/sys/posix/sockets/posix_sockets.c +++ b/sys/posix/sockets/posix_sockets.c @@ -328,7 +328,6 @@ static int socket_close(vfs_file_t *filp) static inline int socket_fstat(vfs_file_t *filp, struct stat *buf) { (void)filp; - memset(buf, 0, sizeof(struct stat)); buf->st_mode |= (S_IFSOCK | S_IRWXU | S_IRWXG | S_IRWXO); buf->st_blksize = SOCKET_BLKSIZE; return 0; diff --git a/sys/vfs/vfs.c b/sys/vfs/vfs.c index c3de601eeb..bb81cf71bc 100644 --- a/sys/vfs/vfs.c +++ b/sys/vfs/vfs.c @@ -1046,7 +1046,6 @@ int vfs_sysop_stat_from_fstat(vfs_mount_t *mountp, const char *restrict path, st if (err < 0) { return err; } - memset(buf, 0, sizeof(*buf)); err = f_op->fstat(&opened, buf); f_op->close(&opened); return err;