jlaitine commented on code in PR #19884:
URL: https://github.com/apache/nuttx/pull/19884#discussion_r3806371656
##########
sched/tls/task_initinfo.c:
##########
@@ -77,21 +77,14 @@ static void task_init_stream(FAR struct streamlist *list)
stream[i].fs_flags |= __FS_FLAG_LBF; /* Line buffering */
# endif /* CONFIG_STDIO_LINEBUFFER */
+#endif /* !CONFIG_STDIO_DISABLE_BUFFERING && CONFIG_STDIO_BUFFER_SIZE > 0 */
/* Save the file description and open flags. Setting the
* file descriptor locks this stream.
*/
stream[i].fs_cookie = (FAR void *)(intptr_t)i;
stream[i].fs_oflags = i ? O_WRONLY : O_RDONLY;
-
- /* Assign custom callbacks to NULL. */
-
- stream[i].fs_iofunc.read = NULL;
- stream[i].fs_iofunc.write = NULL;
- stream[i].fs_iofunc.seek = NULL;
- stream[i].fs_iofunc.close = NULL;
Review Comment:
Not needed, this is effectively dead code. The stream struct is
null-initialized at allocation (zalloc). That's why I just removed those lines.
There are other members which are similarly left 0/NULL as well just by zalloc,
so we can have these the same way. If we want to explicitly write them to NULL
again, we'd need to add the other null-initialized members as well for
consistency. I think it is better this way, not adding dead code.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]