xiaoxiang781216 commented on code in PR #14877:
URL: https://github.com/apache/nuttx/pull/14877#discussion_r1851392729


##########
libs/libbuiltin/compiler-rt/coverage.c:
##########
@@ -323,4 +323,33 @@ void __llvm_profile_dump(const char *path)
 
 exit:
   _NX_CLOSE(fd);
+
+  return ret;

Review Comment:
   ret isn't the written size



##########
libs/libbuiltin/compiler-rt/coverage.c:
##########
@@ -266,11 +259,18 @@ void __llvm_profile_dump(const char *path)
   hdr.names_delta = (uintptr_t)names_begin;
   hdr.value_kind_last = IPVK_LAST;
 
+#ifndef CONFIG_COVERAGE_DUMP_MEMORY
+
+  int fd;
+  int ret;
+
+  const char *filename = path;
+
   fd = _NX_OPEN(filename, O_WRONLY | O_CREAT);

Review Comment:
   why not use path directly



##########
libs/libbuiltin/compiler-rt/coverage.c:
##########
@@ -266,11 +259,18 @@ void __llvm_profile_dump(const char *path)
   hdr.names_delta = (uintptr_t)names_begin;
   hdr.value_kind_last = IPVK_LAST;
 
+#ifndef CONFIG_COVERAGE_DUMP_MEMORY
+
+  int fd;
+  int ret;
+
+  const char *filename = path;
+
   fd = _NX_OPEN(filename, O_WRONLY | O_CREAT);

Review Comment:
   let's check path equal NULL for memory dump? 



##########
libs/libbuiltin/compiler-rt/coverage.c:
##########
@@ -323,4 +323,33 @@ void __llvm_profile_dump(const char *path)
 
 exit:
   _NX_CLOSE(fd);
+
+  return ret;
+#else

Review Comment:
   let's use lib_memoutstream and lib_rawoutstream to avoid the code dup



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to