This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 36cdd5ac3af1143b79c66bff7c64d15652c6896f Author: jingfei <[email protected]> AuthorDate: Wed Nov 11 15:32:36 2026 +0800 fs/romfs: fix nxstyle errors Fix the case label indentation in romfs_seek(), the indentation of an error branch, and add the blank lines after declarations that nxstyle requires. Signed-off-by: jingfei <[email protected]> --- fs/romfs/fs_romfs.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c index fa162a77770..c272430c6d2 100644 --- a/fs/romfs/fs_romfs.c +++ b/fs/romfs/fs_romfs.c @@ -527,23 +527,23 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence) switch (whence) { - case SEEK_SET: /* The offset is set to offset bytes. */ + case SEEK_SET: /* The offset is set to offset bytes. */ position = offset; break; - case SEEK_CUR: /* The offset is set to its current location plus - * offset bytes. */ + case SEEK_CUR: /* The offset is set to its current location plus + * offset bytes. */ position = offset + filep->f_pos; break; - case SEEK_END: /* The offset is set to the size of the file plus - * offset bytes. */ + case SEEK_END: /* The offset is set to the size of the file plus + * offset bytes. */ position = offset + rf->rf_size; break; - default: + default: ferr("ERROR: Whence is invalid: %d\n", whence); return -EINVAL; } @@ -559,8 +559,8 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence) ret = romfs_checkmount(rm); if (ret < 0) { - ferr("ERROR: romfs_checkmount failed: %d\n", ret); - goto errout_with_lock; + ferr("ERROR: romfs_checkmount failed: %d\n", ret); + goto errout_with_lock; } if (position < 0) @@ -610,6 +610,7 @@ static int romfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) if (cmd == FIOC_FILEPATH) { FAR char *ptr = (FAR char *)((uintptr_t)arg); + inode_getpath(filep->f_inode, ptr, PATH_MAX); strlcat(ptr, rf->rf_path, PATH_MAX); return 0; @@ -1247,6 +1248,7 @@ static int romfs_unbind(FAR void *handle, FAR struct inode **blkdriver, if (rm->rm_blkdriver) { FAR struct inode *inode = rm->rm_blkdriver; + if (inode) { if (INODE_IS_BLOCK(inode) && inode->u.i_bops->close != NULL)
