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 2021/02/15 03:52:59 UTC

[GitHub] [incubator-nuttx] masayuki2009 opened a new pull request #2848: graphics: nxmu: Fix hard fault in nxmu_server.c

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


   ## Summary
   
   - Recently I noticed that the nxhello caused hard fault
   - Finally, I found that mq_open() had been changed to nxmq_open()
     but the calling convention was not correct.
   - This commit fixes this issue.
   
   ## Impact
   
   - nxmu_server.c only
   
   ## Testing
   
   - Tested with nxhello, nxlines & nxdemo with the following configs
   - spresense:wifi, spresense:wifi_smp
   


----------------------------------------------------------------
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] masayuki2009 commented on pull request #2848: graphics: nxmu: Fix hard fault in nxmu_server.c

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #2848:
URL: https://github.com/apache/incubator-nuttx/pull/2848#issuecomment-778920444


   This PR relates to https://github.com/apache/incubator-nuttx/pull/2668
   


----------------------------------------------------------------
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 #2848: graphics: nxmu: Fix hard fault in nxmu_server.c

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


   


----------------------------------------------------------------
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] masayuki2009 commented on pull request #2848: graphics: nxmu: Fix hard fault in nxmu_server.c

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #2848:
URL: https://github.com/apache/incubator-nuttx/pull/2848#issuecomment-778940681


   @xiaoxiang781216 
   
   I've just pushed with -f.
   


----------------------------------------------------------------
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 commented on a change in pull request #2848: graphics: nxmu: Fix hard fault in nxmu_server.c

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



##########
File path: graphics/nxmu/nxmu_server.c
##########
@@ -86,10 +86,10 @@ static inline void nxmu_connect(FAR struct nxmu_conn_s *conn)
    * client
    */
 
-  ret = nxmq_open(mqname, O_WRONLY, 0, NULL, &conn->swrmq);
-  if (ret < 0)
+  conn->swrmq = nxmq_open(mqname, O_WRONLY);
+  if (conn->swrmq == (mqd_t)-1)
     {
-      gerr("ERROR: nxmq_open(%s) failed: %d\n", mqname, ret);
+      gerr("ERROR: nxmq_open(%s) failed: %d\n", mqname, errno);

Review comment:
       change to conn->swrmq

##########
File path: graphics/nxmu/nxmu_server.c
##########
@@ -86,10 +86,10 @@ static inline void nxmu_connect(FAR struct nxmu_conn_s *conn)
    * client
    */
 
-  ret = nxmq_open(mqname, O_WRONLY, 0, NULL, &conn->swrmq);
-  if (ret < 0)
+  conn->swrmq = nxmq_open(mqname, O_WRONLY);
+  if (conn->swrmq == (mqd_t)-1)

Review comment:
       change to conn->swrmq < 0 since nxmq_open return the negative error code in the fail case

##########
File path: graphics/nxmu/nxmu_server.c
##########
@@ -190,12 +190,12 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
   attr.mq_msgsize = NX_MXSVRMSGLEN;
   attr.mq_flags   = 0;
 
-  ret = nxmq_open(mqname, O_RDONLY | O_CREAT,
-                  0666, &attr, &nxmu->conn.crdmq);
-  if (ret < 0)
+  nxmu->conn.crdmq = nxmq_open(mqname, O_RDONLY | O_CREAT, 0666, &attr);

Review comment:
       same comment for the rest change




----------------------------------------------------------------
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] masayuki2009 commented on a change in pull request #2848: graphics: nxmu: Fix hard fault in nxmu_server.c

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



##########
File path: graphics/nxmu/nxmu_server.c
##########
@@ -86,10 +86,10 @@ static inline void nxmu_connect(FAR struct nxmu_conn_s *conn)
    * client
    */
 
-  ret = nxmq_open(mqname, O_WRONLY, 0, NULL, &conn->swrmq);
-  if (ret < 0)
+  conn->swrmq = nxmq_open(mqname, O_WRONLY);
+  if (conn->swrmq == (mqd_t)-1)
     {
-      gerr("ERROR: nxmq_open(%s) failed: %d\n", mqname, ret);
+      gerr("ERROR: nxmq_open(%s) failed: %d\n", mqname, errno);

Review comment:
       OK

##########
File path: graphics/nxmu/nxmu_server.c
##########
@@ -86,10 +86,10 @@ static inline void nxmu_connect(FAR struct nxmu_conn_s *conn)
    * client
    */
 
-  ret = nxmq_open(mqname, O_WRONLY, 0, NULL, &conn->swrmq);
-  if (ret < 0)
+  conn->swrmq = nxmq_open(mqname, O_WRONLY);
+  if (conn->swrmq == (mqd_t)-1)

Review comment:
       OK

##########
File path: graphics/nxmu/nxmu_server.c
##########
@@ -190,12 +190,12 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
   attr.mq_msgsize = NX_MXSVRMSGLEN;
   attr.mq_flags   = 0;
 
-  ret = nxmq_open(mqname, O_RDONLY | O_CREAT,
-                  0666, &attr, &nxmu->conn.crdmq);
-  if (ret < 0)
+  nxmu->conn.crdmq = nxmq_open(mqname, O_RDONLY | O_CREAT, 0666, &attr);

Review comment:
       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