vrahane commented on code in PR #3168:
URL: https://github.com/apache/mynewt-core/pull/3168#discussion_r1669171215


##########
sys/log/full/src/log_fcb.c:
##########
@@ -446,11 +507,35 @@ log_fcb_append_mbuf_body(struct log *log, const struct 
log_entry_hdr *hdr,
         }
         loc.fe_data_off += LOG_IMG_HASHLEN;
     }
+
     rc = log_fcb_write_mbuf(&loc, om);
     if (rc != 0) {
         return rc;
     }
 
+    if (hdr->ue_flags & LOG_FLAGS_TLV_SUPPORT) {
+#if MYNEWT_VAL(LOG_FLAGS_TLV_SUPPORT) && MYNEWT_VAL(LOG_TLV_NUM_ENTRIES)
+        struct log_tlv tlv;
+        tlv.tag = LOG_TLV_NUM_ENTRIES;
+        tlv.len = LOG_NUM_ENTRIES_SIZE;
+        /* Write TLV */
+        rc = flash_area_write(loc.fe_area, loc.fe_data_off, &tlv,
+                              sizeof(struct log_tlv));
+        if (rc != 0) {
+            return rc;
+        }
+        loc.fe_data_off += sizeof(struct log_tlv);;
+        /* Write LOG_NUM_ENTRIES_SIZE bytes */
+        rc = flash_area_write(loc.fe_area, loc.fe_data_off,

Review Comment:
   Saves code size but increases stack space by 4 bytes.



-- 
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]

Reply via email to