andrzej-kaczmarek closed pull request #896: sys/log: Remove undefined 
log_rtr_erasei()
URL: https://github.com/apache/mynewt-core/pull/896
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sys/log/full/include/log/log.h b/sys/log/full/include/log/log.h
index a74f1937d..7bb5174e4 100644
--- a/sys/log/full/include/log/log.h
+++ b/sys/log/full/include/log/log.h
@@ -70,11 +70,6 @@ typedef int (*lh_append_func_t)(struct log *, void *buf, int 
len);
 typedef int (*lh_walk_func_t)(struct log *,
         log_walk_func_t walk_func, struct log_offset *log_offset);
 typedef int (*lh_flush_func_t)(struct log *);
-/*
- * This function pointer points to a function that restores the numebr
- * of entries that are specified while erasing
- */
-typedef int (*lh_rtr_erase_func_t)(struct log *, void *arg);
 
 #define LOG_TYPE_STREAM  (0)
 #define LOG_TYPE_MEMORY  (1)
@@ -86,7 +81,6 @@ struct log_handler {
     lh_append_func_t log_append;
     lh_walk_func_t log_walk;
     lh_flush_func_t log_flush;
-    lh_rtr_erase_func_t log_rtr_erase;
 };
 
 struct log_entry_hdr {
@@ -221,7 +215,6 @@ int log_read(struct log *log, void *dptr, void *buf, 
uint16_t off,
 int log_walk(struct log *log, log_walk_func_t walk_func,
         struct log_offset *log_offset);
 int log_flush(struct log *log);
-int log_rtr_erase(struct log *log, void *arg);
 
 /* Handler exports */
 #if MYNEWT_VAL(LOG_CONSOLE)
diff --git a/sys/log/full/src/log_cbmem.c b/sys/log/full/src/log_cbmem.c
index c8f9d936d..982a4c94e 100644
--- a/sys/log/full/src/log_cbmem.c
+++ b/sys/log/full/src/log_cbmem.c
@@ -127,5 +127,4 @@ const struct log_handler log_cbmem_handler = {
     .log_append = log_cbmem_append,
     .log_walk = log_cbmem_walk,
     .log_flush = log_cbmem_flush,
-    .log_rtr_erase = NULL,
 };
diff --git a/sys/log/full/src/log_console.c b/sys/log/full/src/log_console.c
index 7349d172c..409f4cdae 100644
--- a/sys/log/full/src/log_console.c
+++ b/sys/log/full/src/log_console.c
@@ -76,7 +76,6 @@ const struct log_handler log_console_handler = {
     .log_append = log_console_append,
     .log_walk = log_console_walk,
     .log_flush = log_console_flush,
-    .log_rtr_erase = NULL,
 };
 
 #endif
diff --git a/sys/log/full/src/log_fcb.c b/sys/log/full/src/log_fcb.c
index ed1f502d6..91247b8bc 100644
--- a/sys/log/full/src/log_fcb.c
+++ b/sys/log/full/src/log_fcb.c
@@ -32,6 +32,8 @@
 
 static struct flash_area sector;
 
+static int log_fcb_rtr_erase(struct log *log, void *arg);
+
 static int
 log_fcb_append(struct log *log, void *buf, int len)
 {
@@ -53,8 +55,8 @@ log_fcb_append(struct log *log, void *buf, int len)
             goto err;
         }
 
-        if (log->l_log->log_rtr_erase && fcb_log->fl_entries) {
-            rc = log->l_log->log_rtr_erase(log, fcb_log);
+        if (fcb_log->fl_entries) {
+            rc = log_fcb_rtr_erase(log, fcb_log);
             if (rc) {
                 goto err;
             }
@@ -278,7 +280,6 @@ const struct log_handler log_fcb_handler = {
     .log_append = log_fcb_append,
     .log_walk = log_fcb_walk,
     .log_flush = log_fcb_flush,
-    .log_rtr_erase = log_fcb_rtr_erase,
 };
 
 #endif


 

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


With regards,
Apache Git Services

Reply via email to