Skip to contentSkip to conversation

serial: lpc32xx_hs: remove redundant check and assignment of hsu_rate

PATCH New Colin Ian King 1 participant 1 message Feb 15, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: lpc32xx_hs: remove redundant check and assignment of hsu_rate

Variable hsu_rate is being checked for an upper limit and is assigned a value that is never read. The if statement and assignment are redundant and can be removed.

Cleans up clang scan build warning:
drivers/tty/serial/lpc32xx_hs.c:237:3: warning: Value stored to 'hsu_rate' is never read [deadcode.DeadStores]

---
 drivers/tty/serial/lpc32xx_hs.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/lpc32xx_hs.c +0 -2
index ec20329f0603..269efc5e2d51 100644
@@ -233,8 +233,6 @@ static unsigned int __serial_get_clock_div(unsigned long uartclk,
 
 		hsu_rate++;
 	}
-	if (hsu_rate > 0xFF)
-		hsu_rate = 0xFF;
 
 	return goodrate;
 }
Signature · 1 line
2.39.2