anchao commented on code in PR #7890: URL: https://github.com/apache/nuttx/pull/7890#discussion_r1051880874
########## mm/iob/iob_initialize.c: ########## @@ -117,25 +118,18 @@ sem_t g_qentry_sem = SEM_INITIALIZER(CONFIG_IOB_NCHAINS); void iob_initialize(void) { int i; - uintptr_t buf; - - /* Get a start address which plus offsetof(struct iob_s, io_data) is - * aligned to the CONFIG_IOB_ALIGNMENT memory boundary - */ - - buf = ROUNDUP((uintptr_t)g_iob_buffer + offsetof(struct iob_s, io_data), - CONFIG_IOB_ALIGNMENT) - offsetof(struct iob_s, io_data); /* Get I/O buffer instance from the start address and add each I/O buffer * to the free list */ for (i = 0; i < CONFIG_IOB_NBUFFERS; i++) { - FAR struct iob_s *iob = (FAR struct iob_s *)(buf + i * IOB_ALIGN_SIZE); + FAR struct iob_s *iob = &g_iob_list[i]; /* Add the pre-allocate I/O buffer to the head of the free list */ + iob->io_data = &g_iob_buffer[i * IOB_BUFSIZE]; Review Comment: Done ,move to https://github.com/apache/nuttx/pull/7920 ########## net/tcp/tcp_send.c: ########## @@ -402,7 +405,10 @@ void tcp_reset(FAR struct net_driver_s *dev) /* Update device buffer length before setup the IP header */ - iob_update_pktlen(dev->d_iob, dev->d_len); Review Comment: Done ,move to https://github.com/apache/nuttx/pull/7920 -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org