mkiiskila commented on a change in pull request #2052: FCB Rotate Notification
URL: https://github.com/apache/mynewt-core/pull/2052#discussion_r335973997
 
 

 ##########
 File path: fs/fcb/include/fcb/fcb.h
 ##########
 @@ -60,6 +60,7 @@ struct fcb {
     /* Flash circular buffer internal state */
     struct os_mutex f_mtx;     /* Locking for accessing the FCB data */
     struct flash_area *f_oldest;
+    struct flash_area *f_scratch;
 
 Review comment:
   I don't think adding f_scratch is something we'd want. From reading the 
code, it behaves the same as an FCB with f_scratch_cnt set to 1 (or +1 compared 
to what you had there before).
   
   The only use I can see is as a convenience pointer to f_sectors. But it is 
very easy to create without the extra costs.
   E.g.
   
   struct flash_area *
   fcb_area_past_newest(struct fcb *fcb)
   {
      struct flash_area *fap;
   
      fap = &fcb->f_active.fe_area;
      if (fap >= &fcb->f_sectors[fcb->f_sector_cnt]) {
          return &fcb->f_sectors[0];
     } else {
         return fap;
     }
   }
   
   Is there some nother reason which necessitates adding f_scratch?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to