You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/08/04 01:43:37 UTC

[GitHub] [incubator-nuttx] yamt opened a new pull request #1502: Random fixes for issues reported by clang-check

yamt opened a new pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502


   ## Summary
   Random fixes for issues reported by clang-check
   ## Impact
   None of these seems critical
   ## Testing
   Compile tested only


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

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



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464758552



##########
File path: drivers/usbhost/hid_parser.c
##########
@@ -274,8 +274,8 @@ int hid_parsereport(FAR const uint8_t *report, int rptlen,
             {
               collectionpath->usage.usage = usage[0];
 
-              for (i = 0; i < nusage; i++)
-                usage[i] = usage[i + 1];
+              for (i = 1; i < nusage; i++)

Review comment:
       the original code reads usage[nusage]. the new one doesn't.




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

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



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464758272



##########
File path: net/tcp/tcp_timer.c
##########
@@ -182,7 +182,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
 
               /* Notify upper layers about the timeout */
 
-              result = tcp_callback(dev, conn, TCP_TIMEDOUT);
+              tcp_callback(dev, conn, TCP_TIMEDOUT);

Review comment:
       see the commit message for the clang output.
   i read the code and i agreed with clang about this.




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

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



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464757818



##########
File path: arch/sim/src/sim/up_exit.c
##########
@@ -65,9 +65,9 @@
 
 void up_exit(int status)
 {
-  FAR struct tcb_s *tcb = this_task();
+  FAR struct tcb_s *tcb;

Review comment:
       the commit messages have the snippets of the clang output.
   
   this change is intended to appease the warning when sinfo() expands to empty.
   




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

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



[GitHub] [incubator-nuttx] v01d commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464759559



##########
File path: net/tcp/tcp_timer.c
##########
@@ -182,7 +182,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
 
               /* Notify upper layers about the timeout */
 
-              result = tcp_callback(dev, conn, TCP_TIMEDOUT);
+              tcp_callback(dev, conn, TCP_TIMEDOUT);

Review comment:
       ok, tcp_timer does not return errors so I guess it is OK




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

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



[GitHub] [incubator-nuttx] v01d commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464756947



##########
File path: arch/sim/src/sim/up_exit.c
##########
@@ -65,9 +65,9 @@
 
 void up_exit(int status)
 {
-  FAR struct tcb_s *tcb = this_task();
+  FAR struct tcb_s *tcb;

Review comment:
       what does this change accomplish? I can only see that it introduces a second call to `this_task()`.




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

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



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502


   


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

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



[GitHub] [incubator-nuttx] v01d commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464757443



##########
File path: net/tcp/tcp_timer.c
##########
@@ -182,7 +182,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
 
               /* Notify upper layers about the timeout */
 
-              result = tcp_callback(dev, conn, TCP_TIMEDOUT);
+              tcp_callback(dev, conn, TCP_TIMEDOUT);

Review comment:
       ah, I see the commit message. the fact that result is never read probably indicates that it should be read. not assigning the result is not the correct solution if so.




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

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



[GitHub] [incubator-nuttx] v01d commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464757137



##########
File path: net/tcp/tcp_timer.c
##########
@@ -182,7 +182,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
 
               /* Notify upper layers about the timeout */
 
-              result = tcp_callback(dev, conn, TCP_TIMEDOUT);
+              tcp_callback(dev, conn, TCP_TIMEDOUT);

Review comment:
       is this correct? what did clang-check say?




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

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



[GitHub] [incubator-nuttx] v01d commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464757967



##########
File path: drivers/usbhost/hid_parser.c
##########
@@ -274,8 +274,8 @@ int hid_parsereport(FAR const uint8_t *report, int rptlen,
             {
               collectionpath->usage.usage = usage[0];
 
-              for (i = 0; i < nusage; i++)
-                usage[i] = usage[i + 1];
+              for (i = 1; i < nusage; i++)

Review comment:
       I understand the code does the same thing as before, only differently. I don't understand by clang-check considers the other version problematic and this one does not.




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

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



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464758552



##########
File path: drivers/usbhost/hid_parser.c
##########
@@ -274,8 +274,8 @@ int hid_parsereport(FAR const uint8_t *report, int rptlen,
             {
               collectionpath->usage.usage = usage[0];
 
-              for (i = 0; i < nusage; i++)
-                usage[i] = usage[i + 1];
+              for (i = 1; i < nusage; i++)

Review comment:
       the original code reads usage[nusage+1]. the new one doesn't.




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

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



[GitHub] [incubator-nuttx] v01d commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464758538



##########
File path: arch/sim/src/sim/up_exit.c
##########
@@ -65,9 +65,9 @@
 
 void up_exit(int status)
 {
-  FAR struct tcb_s *tcb = this_task();
+  FAR struct tcb_s *tcb;

Review comment:
       Ok, I understand.




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

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



[GitHub] [incubator-nuttx] v01d commented on a change in pull request #1502: Random fixes for issues reported by clang-check

Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #1502:
URL: https://github.com/apache/incubator-nuttx/pull/1502#discussion_r464759907



##########
File path: drivers/usbhost/hid_parser.c
##########
@@ -274,8 +274,8 @@ int hid_parsereport(FAR const uint8_t *report, int rptlen,
             {
               collectionpath->usage.usage = usage[0];
 
-              for (i = 0; i < nusage; i++)
-                usage[i] = usage[i + 1];
+              for (i = 1; i < nusage; i++)

Review comment:
       got it




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

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