@@ -188,7 +188,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath,
188
188
}
189
189
190
190
ret = romfs_checkmount (rm );
191
- if (ret != OK )
191
+ if (ret < 0 )
192
192
{
193
193
ferr ("ERROR: romfs_checkmount failed: %d\n" , ret );
194
194
goto errout_with_lock ;
@@ -394,7 +394,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer,
394
394
}
395
395
396
396
ret = romfs_checkmount (rm );
397
- if (ret != OK )
397
+ if (ret < 0 )
398
398
{
399
399
ferr ("ERROR: romfs_checkmount failed: %d\n" , ret );
400
400
goto errout_with_lock ;
@@ -553,7 +553,7 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence)
553
553
}
554
554
555
555
ret = romfs_checkmount (rm );
556
- if (ret != OK )
556
+ if (ret < 0 )
557
557
{
558
558
ferr ("ERROR: romfs_checkmount failed: %d\n" , ret );
559
559
goto errout_with_lock ;
@@ -596,14 +596,12 @@ static int romfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
596
596
597
597
rf = filep -> f_priv ;
598
598
599
- /* Only one ioctl command is supported */
600
-
601
599
if (cmd == FIOC_FILEPATH )
602
600
{
603
601
FAR char * ptr = (FAR char * )((uintptr_t )arg );
604
602
inode_getpath (filep -> f_inode , ptr , PATH_MAX );
605
603
strlcat (ptr , rf -> rf_path , PATH_MAX );
606
- return OK ;
604
+ return 0 ;
607
605
}
608
606
else if (cmd == FIOC_XIPBASE )
609
607
{
@@ -613,7 +611,7 @@ static int romfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
613
611
if (rm -> rm_xipbase != 0 )
614
612
{
615
613
* ptr = (uintptr_t )rm -> rm_xipbase + rf -> rf_startoffset ;
616
- return OK ;
614
+ return 0 ;
617
615
}
618
616
else
619
617
{
@@ -646,7 +644,7 @@ static int romfs_mmap(FAR struct file *filep, FAR struct mm_map_entry_s *map)
646
644
map -> length != 0 && map -> offset + map -> length <= rf -> rf_size )
647
645
{
648
646
map -> vaddr = rm -> rm_xipbase + rf -> rf_startoffset + map -> offset ;
649
- return OK ;
647
+ return 0 ;
650
648
}
651
649
652
650
return - ENOTTY ;
@@ -688,7 +686,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp)
688
686
}
689
687
690
688
ret = romfs_checkmount (rm );
691
- if (ret != OK )
689
+ if (ret < 0 )
692
690
{
693
691
ferr ("ERROR: romfs_checkmount failed: %d\n" , ret );
694
692
goto errout_with_lock ;
@@ -731,7 +729,6 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp)
731
729
/* Attach the new private date to the new struct file instance */
732
730
733
731
newp -> f_priv = newrf ;
734
-
735
732
rm -> rm_refs ++ ;
736
733
737
734
errout_with_lock :
@@ -742,7 +739,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp)
742
739
/****************************************************************************
743
740
* Name: romfs_fstat
744
741
*
745
- * Description:
742
+ * Description
746
743
* Obtain information about an open file associated with the file
747
744
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
748
745
*
@@ -792,7 +789,7 @@ static int romfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
792
789
/****************************************************************************
793
790
* Name: romfs_opendir
794
791
*
795
- * Description:
792
+ * Description
796
793
* Open a directory for read access
797
794
*
798
795
****************************************************************************/
@@ -830,7 +827,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
830
827
}
831
828
832
829
ret = romfs_checkmount (rm );
833
- if (ret != OK )
830
+ if (ret < 0 )
834
831
{
835
832
ferr ("ERROR: romfs_checkmount failed: %d\n" , ret );
836
833
goto errout_with_lock ;
@@ -868,7 +865,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
868
865
869
866
* dir = & rdir -> base ;
870
867
nxrmutex_unlock (& rm -> rm_lock );
871
- return OK ;
868
+ return 0 ;
872
869
873
870
errout_with_lock :
874
871
nxrmutex_unlock (& rm -> rm_lock );
@@ -881,7 +878,8 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
881
878
/****************************************************************************
882
879
* Name: romfs_closedir
883
880
*
884
- * Description: Close the directory
881
+ * Description
882
+ * Close the directory
885
883
*
886
884
****************************************************************************/
887
885
@@ -896,7 +894,8 @@ static int romfs_closedir(FAR struct inode *mountpt,
896
894
/****************************************************************************
897
895
* Name: romfs_readdir
898
896
*
899
- * Description: Read the next directory entry
897
+ * Description
898
+ * Read the next directory entry
900
899
*
901
900
****************************************************************************/
902
901
@@ -934,7 +933,7 @@ static int romfs_readdir(FAR struct inode *mountpt,
934
933
}
935
934
936
935
ret = romfs_checkmount (rm );
937
- if (ret != OK )
936
+ if (ret < 0 )
938
937
{
939
938
ferr ("ERROR: omfs_checkmount failed: %d\n" , ret );
940
939
goto errout_with_lock ;
@@ -1019,7 +1018,8 @@ static int romfs_readdir(FAR struct inode *mountpt,
1019
1018
/****************************************************************************
1020
1019
* Name: romfs_rewindir
1021
1020
*
1022
- * Description: Reset directory read to the first entry
1021
+ * Description
1022
+ * Reset directory read to the first entry
1023
1023
*
1024
1024
****************************************************************************/
1025
1025
@@ -1050,7 +1050,7 @@ static int romfs_rewinddir(FAR struct inode *mountpt,
1050
1050
}
1051
1051
1052
1052
ret = romfs_checkmount (rm );
1053
- if (ret == OK )
1053
+ if (ret >= 0 )
1054
1054
{
1055
1055
#ifdef CONFIG_FS_ROMFS_CACHE_NODE
1056
1056
rdir -> currnode = rdir -> firstnode ;
@@ -1066,11 +1066,12 @@ static int romfs_rewinddir(FAR struct inode *mountpt,
1066
1066
/****************************************************************************
1067
1067
* Name: romfs_bind
1068
1068
*
1069
- * Description: This implements a portion of the mount operation. This
1070
- * function allocates and initializes the mountpoint private data and
1071
- * binds the blockdriver inode to the filesystem private data. The final
1072
- * binding of the private data (containing the blockdriver) to the
1073
- * mountpoint is performed by mount().
1069
+ * Description
1070
+ * This implements a portion of the mount operation. This
1071
+ * function allocates and initializes the mountpoint private data and
1072
+ * binds the blockdriver inode to the filesystem private data. The final
1073
+ * binding of the private data (containing the blockdriver) to the
1074
+ * mountpoint is performed by mount().
1074
1075
*
1075
1076
****************************************************************************/
1076
1077
@@ -1091,7 +1092,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data,
1091
1092
}
1092
1093
1093
1094
if (blkdriver -> u .i_bops -> open != NULL &&
1094
- (ret = blkdriver -> u .i_bops -> open (blkdriver )) != OK )
1095
+ (ret = blkdriver -> u .i_bops -> open (blkdriver )) < 0 )
1095
1096
{
1096
1097
ferr ("ERROR: No open method\n" );
1097
1098
return ret ;
@@ -1108,7 +1109,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data,
1108
1109
}
1109
1110
1110
1111
/* Initialize the allocated mountpt state structure. The filesystem is
1111
- * responsible for one reference ont the blkdriver inode and does not
1112
+ * responsible for one reference on the blkdriver inode and does not
1112
1113
* have to addref() here (but does have to release in ubind().
1113
1114
*/
1114
1115
@@ -1171,7 +1172,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data,
1171
1172
/* Mounted! */
1172
1173
1173
1174
* handle = rm ;
1174
- return OK ;
1175
+ return 0 ;
1175
1176
1176
1177
errout_with_buffer :
1177
1178
fs_heap_free (rm -> rm_devbuffer );
@@ -1192,7 +1193,8 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data,
1192
1193
/****************************************************************************
1193
1194
* Name: romfs_unbind
1194
1195
*
1195
- * Description: This implements the filesystem portion of the umount
1196
+ * Description
1197
+ * This implements the filesystem portion of the umount
1196
1198
* operation.
1197
1199
*
1198
1200
****************************************************************************/
@@ -1271,7 +1273,7 @@ static int romfs_unbind(FAR void *handle, FAR struct inode **blkdriver,
1271
1273
#endif
1272
1274
nxrmutex_destroy (& rm -> rm_lock );
1273
1275
fs_heap_free (rm );
1274
- return OK ;
1276
+ return 0 ;
1275
1277
}
1276
1278
1277
1279
nxrmutex_unlock (& rm -> rm_lock );
@@ -1281,7 +1283,8 @@ static int romfs_unbind(FAR void *handle, FAR struct inode **blkdriver,
1281
1283
/****************************************************************************
1282
1284
* Name: romfs_statfs
1283
1285
*
1284
- * Description: Return filesystem statistics
1286
+ * Description
1287
+ * Return filesystem statistics
1285
1288
*
1286
1289
****************************************************************************/
1287
1290
@@ -1339,7 +1342,7 @@ static int romfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf)
1339
1342
/****************************************************************************
1340
1343
* Name: romfs_stat_common
1341
1344
*
1342
- * Description:
1345
+ * Description
1343
1346
* Return information about a file or directory
1344
1347
*
1345
1348
****************************************************************************/
@@ -1389,13 +1392,14 @@ static int romfs_stat_common(uint8_t type, uint32_t size,
1389
1392
buf -> st_size = size ;
1390
1393
buf -> st_blksize = sectorsize ;
1391
1394
buf -> st_blocks = (buf -> st_size + sectorsize - 1 ) / sectorsize ;
1392
- return OK ;
1395
+ return 0 ;
1393
1396
}
1394
1397
1395
1398
/****************************************************************************
1396
1399
* Name: romfs_stat
1397
1400
*
1398
- * Description: Return information about a file or directory
1401
+ * Description
1402
+ * Return information about a file or directory
1399
1403
*
1400
1404
****************************************************************************/
1401
1405
@@ -1426,7 +1430,7 @@ static int romfs_stat(FAR struct inode *mountpt, FAR const char *relpath,
1426
1430
}
1427
1431
1428
1432
ret = romfs_checkmount (rm );
1429
- if (ret != OK )
1433
+ if (ret < 0 )
1430
1434
{
1431
1435
ferr ("ERROR: romfs_checkmount failed: %d\n" , ret );
1432
1436
goto errout_with_lock ;
0 commit comments