serial: lpc32xx_hs: remove redundant check and assignment of hsu_rate
authorColin Ian King <colin.i.king@gmail.com>
Thu, 15 Feb 2024 23:29:44 +0000 (23:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Feb 2024 17:59:58 +0000 (18:59 +0100)
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]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240215232944.2075789-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/lpc32xx_hs.c

index ec20329f06036d066c00056a39588dc502e9977d..269efc5e2d51f7c34949a7d984436a85b7e7884f 100644 (file)
@@ -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;
 }