You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "zhhyu7 (via GitHub)" <gi...@apache.org> on 2023/08/18 15:32:26 UTC

[GitHub] [nuttx] zhhyu7 opened a new pull request, #10296: ipv6_setsockopt: remove redundant logic

zhhyu7 opened a new pull request, #10296:
URL: https://github.com/apache/nuttx/pull/10296

   ## Summary
   Synchronize code differences from internal repositories to the community
   
   ## Impact
   
   ## Testing
   sim:local
   


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #10296: ipv6_setsockopt: remove redundant logic

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10296:
URL: https://github.com/apache/nuttx/pull/10296#discussion_r1299169245


##########
net/inet/ipv6_setsockopt.c:
##########
@@ -86,28 +86,17 @@ int ipv6_setsockopt(FAR struct socket *psock, int option,
       /* Handle MLD-related socket options */
 
       case IPV6_JOIN_GROUP:       /* Join a multicast group */
-        {
-          FAR const struct ipv6_mreq *mrec ;
-
-          mrec = (FAR const struct ipv6_mreq *)value;
-          ret = mld_joingroup(mrec);
-        }
+        ret = mld_joingroup(value);

Review Comment:
   Both C/C++ allow any pointer type convert to void * without cast, but only C allow void * convert to other pointer type without cast.



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] acassis commented on a diff in pull request #10296: ipv6_setsockopt: remove redundant logic

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #10296:
URL: https://github.com/apache/nuttx/pull/10296#discussion_r1298713303


##########
net/inet/ipv6_setsockopt.c:
##########
@@ -86,28 +86,17 @@ int ipv6_setsockopt(FAR struct socket *psock, int option,
       /* Handle MLD-related socket options */
 
       case IPV6_JOIN_GROUP:       /* Join a multicast group */
-        {
-          FAR const struct ipv6_mreq *mrec ;
-
-          mrec = (FAR const struct ipv6_mreq *)value;
-          ret = mld_joingroup(mrec);
-        }
+        ret = mld_joingroup(value);

Review Comment:
   I think you still need to use the casting, because some compiler could raise some warnings.
   ```
   ret = mld_joingroup((FAR const struct ipv6_mreq *) value);
   ```



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] acassis merged pull request #10296: ipv6_setsockopt: remove redundant logic

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #10296:
URL: https://github.com/apache/nuttx/pull/10296


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #10296: ipv6_setsockopt: remove redundant logic

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #10296:
URL: https://github.com/apache/nuttx/pull/10296#discussion_r1298724905


##########
net/inet/ipv6_setsockopt.c:
##########
@@ -86,28 +86,17 @@ int ipv6_setsockopt(FAR struct socket *psock, int option,
       /* Handle MLD-related socket options */
 
       case IPV6_JOIN_GROUP:       /* Join a multicast group */
-        {
-          FAR const struct ipv6_mreq *mrec ;
-
-          mrec = (FAR const struct ipv6_mreq *)value;
-          ret = mld_joingroup(mrec);
-        }
+        ret = mld_joingroup(value);

Review Comment:
   I'm really not sure about this. I think cast from/to `void *` do not require additional type cast



-- 
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-unsubscribe@nuttx.apache.org

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