pkarashchenko commented on code in PR #8834:
URL: https://github.com/apache/nuttx/pull/8834#discussion_r1139971060
##########
arch/sim/src/sim/sim_uart.c:
##########
@@ -363,17 +364,14 @@ static int tty_ioctl(struct file *filep, int cmd,
unsigned long arg)
struct tty_priv_s *priv = dev->priv;
struct termios *termiosp = (struct termios *)(uintptr_t)arg;
- if (!termiosp)
- {
- return -EINVAL;
- }
-
switch (cmd)
{
case TCGETS:
+ DEBUGASSERT(termiosp != NULL);
return host_uart_getcflag(priv->fd, &termiosp->c_cflag);
case TCSETS:
+ DEBUGASSERT(termiosp != NULL);
Review Comment:
Could you please add `default: break;` case as some tools might complain
about missing default. Usually it is more when enum is used to make a switch,
but in general it is a good practice to have it explicit.
--
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]