pkarashchenko commented on code in PR #7900:
URL: https://github.com/apache/nuttx/pull/7900#discussion_r1055248037


##########
drivers/note/note_driver.c:
##########
@@ -435,6 +455,122 @@ static inline int note_isenabled_dump(void)
 }
 #endif
 
+#if CONFIG_TASK_NAME_SIZE > 0
+
+/****************************************************************************
+ * Name: note_read_taskname
+ *
+ * Description:
+ *   read task name info from the specified position in buffer
+ *
+ * Input Parameters:
+ *   pos - position
+ *   info - task name info buffer
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void note_read_taskname(size_t pos,
+                               FAR struct note_taskname_info_s *info)
+{
+  size_t space;
+  pos = pos % CONFIG_DRIVER_NOTERAM_TASKNAME_BUFSIZE;
+  space = CONFIG_DRIVER_NOTERAM_TASKNAME_BUFSIZE - pos;
+  if (space > sizeof(struct note_taskname_info_s))
+    {
+      space = sizeof(struct note_taskname_info_s);
+    }
+
+  memcpy(info, g_note_taskname.buffer + pos, space);
+  memcpy(((void *)info) + space, g_note_taskname.buffer,

Review Comment:
   ```suggestion
     memcpy(((char *)info) + space, g_note_taskname.buffer,
   ```
   since if I recall correctly `(void *)` increment is undefined



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