pkarashchenko commented on code in PR #6618:
URL: https://github.com/apache/incubator-nuttx/pull/6618#discussion_r922121584


##########
arch/arm/src/common/arm_semi_syslog.c:
##########
@@ -54,15 +52,25 @@ int up_putc(int ch)
 }
 
 /****************************************************************************
- * Name: up_puts
+ * Name: up_nputs
  *
  * Description:
  *   Output a string on the console
  *
  ****************************************************************************/
 
-void up_puts(const char *str)
+void up_nputs(const char *str, size_t len)
 {
-  smh_call(SEMI_SYSLOG_WRITE0, (char *)str);
+  if (len == ~((size_t)0))
+    {
+      smh_call(SEMI_SYSLOG_WRITE0, (char *)str);
+    }
+  else
+    {
+      while (len-- > 0)

Review Comment:
   ```suggestion
         while (*str && len-- > 0)
   ```



##########
drivers/syslog/syslog_channel.c:
##########
@@ -217,16 +217,7 @@ static ssize_t syslog_default_write(FAR struct 
syslog_channel_s *channel,
                                     FAR const char *buffer, size_t buflen)
 {
 #if defined(CONFIG_ARCH_LOWPUTC)
-  static sem_t sem = SEM_INITIALIZER(1);
-  size_t nwritten;
-
-  nxsem_wait(&sem);

Review Comment:
   why the lock is removed? will it not lead to messed up output in 
multi-tasking syslog usage?



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