diff mbox series

soc: qcom-geni-se: remove redundant initialization to variable line

Message ID 20210422125810.248166-1-colin.king@canonical.com
State Superseded
Headers show
Series soc: qcom-geni-se: remove redundant initialization to variable line | expand

Commit Message

Colin King April 22, 2021, 12:58 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable line being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/tty/serial/qcom_geni_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Slaby April 23, 2021, 4:09 a.m. UTC | #1
On 22. 04. 21, 14:58, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable line being initialized with a value that is never read
> and it is being updated later with a new value. The initialization is
> redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

> ---
>   drivers/tty/serial/qcom_geni_serial.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index 99375d99f6fa..c5f2a4fa2bb1 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -1338,7 +1338,7 @@ static const struct uart_ops qcom_geni_uart_pops = {
>   static int qcom_geni_serial_probe(struct platform_device *pdev)
>   {
>   	int ret = 0;
> -	int line = -1;
> +	int line;
>   	struct qcom_geni_serial_port *port;
>   	struct uart_port *uport;
>   	struct resource *res;
>
Greg Kroah-Hartman April 23, 2021, 5:22 a.m. UTC | #2
On Thu, Apr 22, 2021 at 01:58:10PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>

> 

> The variable line being initialized with a value that is never read

> and it is being updated later with a new value. The initialization is

> redundant and can be removed.

> 

> Addresses-Coverity: ("Unused value")

> Signed-off-by: Colin Ian King <colin.king@canonical.com>

> ---

>  drivers/tty/serial/qcom_geni_serial.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)


Your subject line is odd, this is not a "SOC" driver :(
diff mbox series

Patch

diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 99375d99f6fa..c5f2a4fa2bb1 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1338,7 +1338,7 @@  static const struct uart_ops qcom_geni_uart_pops = {
 static int qcom_geni_serial_probe(struct platform_device *pdev)
 {
 	int ret = 0;
-	int line = -1;
+	int line;
 	struct qcom_geni_serial_port *port;
 	struct uart_port *uport;
 	struct resource *res;