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 2023/01/12 13:34:29 UTC

[GitHub] [nuttx] acassis commented on a diff in pull request #8080: net/netdev: Avoid hardcoded guardsize when using d_iob

acassis commented on code in PR #8080:
URL: https://github.com/apache/nuttx/pull/8080#discussion_r1068127490


##########
include/nuttx/net/netdev.h:
##########
@@ -161,8 +161,8 @@
  * headers
  */
 
-#define IPBUF(hl) ((FAR void *)\
-                   &dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE + (hl)])
+#define IPBUF(hl) ((FAR void *)(IOB_DATA(dev->d_iob) + (hl)))
+#define LLBUF     (IPBUF(-NET_LL_HDRLEN(dev)))

Review Comment:
   The LLBUF is too generic, maybe NETLLBUF is better to make it easy to understand its purpose



##########
include/nuttx/net/netdev.h:
##########
@@ -161,8 +161,8 @@
  * headers
  */
 
-#define IPBUF(hl) ((FAR void *)\
-                   &dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE + (hl)])
+#define IPBUF(hl) ((FAR void *)(IOB_DATA(dev->d_iob) + (hl)))
+#define LLBUF     (IPBUF(-NET_LL_HDRLEN(dev)))

Review Comment:
   ```suggestion
   #define LLBUF     (IPBUF - (NET_LL_HDRLEN(dev)))



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