From a65b555c826b9e3fa0eb301711976333514f30c4 Mon Sep 17 00:00:00 2001 From: Peter Bee Date: Mon, 5 Feb 2024 17:06:29 +0800 Subject: [PATCH] drivers/serial: fix cmsdk serial driver warning 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 --- drivers/serial/serial_cmsdk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/serial/serial_cmsdk.c b/drivers/serial/serial_cmsdk.c index 16f84ca937193..90a30e08aa8e5 100644 --- a/drivers/serial/serial_cmsdk.c +++ b/drivers/serial/serial_cmsdk.c @@ -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) { @@ -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;