kasjer commented on code in PR #3365: URL: https://github.com/apache/mynewt-core/pull/3365#discussion_r1984621818
########## sys/log/full/include/log/log_fcb.h: ########## @@ -125,39 +157,46 @@ void log_fcb_init_bmarks(struct fcb_log *fcb_log, void log_fcb_clear_bmarks(struct fcb_log *fcb_log); /** - * @brief Remove bookmarks which point to oldest FCB/FCB2 area. This is - * meant to get called just before the area is rotated out. + * @brief Get bookmarks for a particular log * - * @param fcb_log The fcb_log to operate on. + * @param log Pointer to the log we want to read bookmarks from + * @param bmarks_size Pointer to the variable we want to read bookmarks into + * + * @return Pointer to the bookmarks array for the provided log */ -void log_fcb_rotate_bmarks(struct fcb_log *fcb_log); +struct log_fcb_bmark *log_fcb_get_bmarks(struct log *log, uint32_t *bmarks_size); /** * @brief Searches an fcb_log for the closest bookmark that comes before or at * the specified index. * * @param fcb_log The log to search. * @param index The index to look for. + * @param min_diff If bookmark was found, fill it up with the difference + * else it will return -1. * * @return The closest bookmark on success; * NULL if the log has no applicable bookmarks. */ -const struct log_fcb_bmark * -log_fcb_closest_bmark(const struct fcb_log *fcb_log, uint32_t index); +struct log_fcb_bmark * Review Comment: I think that you can create separate PR that drops const in places that you can show change in performance due to const removal. Removing const from random places in already complicated code make things harder to review. Right now I'm not convinced that this change is needed. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
