Prakhar Kumar commented on a discussion on cpukit/libblock/src/flashdisk.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/912#note_139734 > #define rtems_fdisk_calc_crc16(_b, _c) \ > rtems_fdisk_crc16_factor[((_b) ^ ((_c) & 0xff)) & 0xff] ^ (((_c) >> 8) & > 0xff) > > +/** > + * this describes the current state of mutext initialisation > + * whether the mutext on the current stage is initialised or not > + */ > +typedef enum > +{ > + MUTEX_NOT_INITIALIZED = 0, > + MUTEX_INITIALIZED > +} rtems_mutex_state_t; So, when i was implementing the memory cleanup function first I tried to do something like this same, passing the enum as the stage like at which stage the error had occurred and and free the elements on that iteration before that stage as nothing would have been allocated after that. but it made thing complex as there were several error paths. The idea stuck in my mind and i used it here, I realized as it has only two states like either it can be initialized or not be initialized so boolean can be used but I left it to get a review and also mentioned in a seperate comment about the logic. And there are no real reason why the name is the way it is named, I just struggle with naming and titles, first i had used rtems_mutex_stage_t and then I changed it to state. -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/912#note_139734 You're receiving this email because of your account on gitlab.rtems.org.
_______________________________________________ bugs mailing list [email protected] http://lists.rtems.org/mailman/listinfo/bugs
