Skip to content

Commit

Permalink
drivers/serial: fix cmsdk serial driver warning
Browse files Browse the repository at this point in the history
serial/serial_cmsdk.c: In function 'uart_cmsdk_ioctl':
serial/serial_cmsdk.c:544:10: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
  544 |   return ret;
      |          ^~~

Signed-off-by: Peter Bee <[email protected]>
  • Loading branch information
PeterBee97 authored and W-M-R committed Oct 15, 2024
1 parent 48dd8bc commit a65b555
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/serial/serial_cmsdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ static int uart_cmsdk_tx_interrupt(int irq, FAR void *context, FAR void *arg)
static int uart_cmsdk_ioctl(struct file *filep, int cmd, unsigned long arg)
{
FAR struct uart_dev_s *dev = filep->f_inode->i_private;
FAR struct uart_cmsdk_s *priv = dev->priv;
int ret;
FAR struct uart_cmsdk_s *priv = (FAR struct uart_cmsdk_s *)dev->priv;
int ret = OK;

switch (cmd)
{
Expand All @@ -514,7 +514,6 @@ static int uart_cmsdk_ioctl(struct file *filep, int cmd, unsigned long arg)

cfsetispeed(termiosp, priv->baud);
termiosp->c_cflag = CS8;
break;
}
break;

Expand Down

0 comments on commit a65b555

Please sign in to comment.