@@ -133,8 +133,8 @@ static int nfObject_Program(whNvmFlashContext* context, int partition,
133133 int object_index , uint32_t epoch , whNvmMetadata * meta , uint32_t start ,
134134 const uint8_t * data );
135135static int nfObject_ReadDataBytes (whNvmFlashContext * context , int partition ,
136- int object_index , uint32_t byte_offset , uint32_t byte_count ,
137- uint8_t * out_data );
136+ int object_index , uint32_t byte_offset ,
137+ uint32_t byte_count , uint8_t * out_data );
138138static int nfObject_Copy (whNvmFlashContext * context , int object_index ,
139139 int partition , uint32_t * inout_next_object , uint32_t * inout_next_data );
140140
@@ -651,8 +651,8 @@ static int nfObject_Program(whNvmFlashContext* context, int partition,
651651}
652652
653653static int nfObject_ReadDataBytes (whNvmFlashContext * context , int partition ,
654- int object_index ,
655- uint32_t byte_offset , uint32_t byte_count , uint8_t * out_data )
654+ int object_index , uint32_t byte_offset ,
655+ uint32_t byte_count , uint8_t * out_data )
656656{
657657 int start = 0 ;
658658 uint32_t startOffset = 0 ;
@@ -675,18 +675,16 @@ static int nfObject_ReadDataBytes(whNvmFlashContext* context, int partition,
675675 }
676676
677677 /* Ensure we don't read off the end of the active partition */
678- if (WH_ERROR_OK != nfPartition_CheckDataRange (context , partition ,
679- startOffset * WHFU_BYTES_PER_UNIT + byte_offset ,
680- byte_count )) {
678+ if (WH_ERROR_OK != nfPartition_CheckDataRange (
679+ context , partition ,
680+ startOffset * WHFU_BYTES_PER_UNIT + byte_offset ,
681+ byte_count )) {
681682 return WH_ERROR_BADARGS ;
682683 }
683684
684685 return wh_FlashUnit_ReadBytes (
685- context -> cb ,
686- context -> flash ,
687- startOffset * WHFU_BYTES_PER_UNIT + byte_offset ,
688- byte_count ,
689- out_data );
686+ context -> cb , context -> flash ,
687+ startOffset * WHFU_BYTES_PER_UNIT + byte_offset , byte_count , out_data );
690688}
691689
692690static int nfObject_Copy (whNvmFlashContext * context , int object_index ,
@@ -727,13 +725,8 @@ static int nfObject_Copy(whNvmFlashContext* context, int object_index,
727725 }
728726
729727 /* Read the data from the old object. */
730- ret = nfObject_ReadDataBytes (
731- context ,
732- context -> active ,
733- object_index ,
734- data_offset ,
735- this_len ,
736- buffer );
728+ ret = nfObject_ReadDataBytes (context , context -> active , object_index ,
729+ data_offset , this_len , buffer );
737730 if (ret != 0 ) return ret ;
738731
739732 /* Write the data to the new object. */
@@ -1242,30 +1235,23 @@ int wh_NvmFlash_DestroyObjects(void* c, whNvmId list_count,
12421235}
12431236
12441237/* Read the data of the object starting at the byte offset */
1245- int wh_NvmFlash_Read (void * c , whNvmId id , whNvmSize offset ,
1246- whNvmSize data_len , uint8_t * data )
1238+ int wh_NvmFlash_Read (void * c , whNvmId id , whNvmSize offset , whNvmSize data_len ,
1239+ uint8_t * data )
12471240{
12481241 whNvmFlashContext * context = c ;
12491242 int ret = 0 ;
1250- int object_index = -1 ;
1243+ int object_index = -1 ;
12511244
12521245 if ( (context == NULL ) ||
12531246 ((data_len > 0 ) && (data == NULL )) ){
12541247 return WH_ERROR_BADARGS ;
12551248 }
12561249
1257- ret = nfMemDirectory_FindObjectIndexById (
1258- & context -> directory ,
1259- id ,
1260- & object_index );
1250+ ret = nfMemDirectory_FindObjectIndexById (& context -> directory , id ,
1251+ & object_index );
12611252 if (ret == 0 ) {
1262- ret = nfObject_ReadDataBytes (
1263- context ,
1264- context -> active ,
1265- object_index ,
1266- offset ,
1267- data_len ,
1268- data );
1253+ ret = nfObject_ReadDataBytes (context , context -> active , object_index ,
1254+ offset , data_len , data );
12691255 }
12701256 return ret ;
12711257}
0 commit comments