linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] backlight: ili922x: remove redundant variable len
@ 2017-11-05 11:53 Colin King
  2017-11-05 17:23 ` Jingoo Han
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Colin King @ 2017-11-05 11:53 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han,
	Bartlomiej Zolnierkiewicz, dri-devel, linux-fbdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable len is assigned but never read, therefore it is redundant
and can be removed. Cleans up clang warning:

drivers/video/backlight/ili922x.c:276:2: warning: Value stored to 'len'
is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/video/backlight/ili922x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c
index a9e9cef..2b6c6aa 100644
--- a/drivers/video/backlight/ili922x.c
+++ b/drivers/video/backlight/ili922x.c
@@ -251,7 +251,7 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
 	struct spi_transfer xfer_regindex, xfer_regvalue;
 	unsigned char tbuf[CMD_BUFSIZE];
 	unsigned char rbuf[CMD_BUFSIZE];
-	int ret, len = 0;
+	int ret;
 
 	memset(&xfer_regindex, 0, sizeof(struct spi_transfer));
 	memset(&xfer_regvalue, 0, sizeof(struct spi_transfer));
@@ -273,7 +273,6 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
 	ret = spi_sync(spi, &msg);
 
 	spi_message_init(&msg);
-	len = 0;
 	tbuf[0] = set_tx_byte(START_BYTE(ili922x_id, START_RS_REG,
 					 START_RW_WRITE));
 	tbuf[1] = set_tx_byte((value & 0xFF00) >> 8);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] backlight: ili922x: remove redundant variable len
  2017-11-05 11:53 [PATCH] backlight: ili922x: remove redundant variable len Colin King
@ 2017-11-05 17:23 ` Jingoo Han
  2017-11-06 11:36 ` Daniel Thompson
  2017-11-08 10:43 ` Lee Jones
  2 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2017-11-05 17:23 UTC (permalink / raw)
  To: 'Colin King', 'Lee Jones',
	'Daniel Thompson', 'Bartlomiej Zolnierkiewicz',
	dri-devel, linux-fbdev
  Cc: kernel-janitors, linux-kernel

On Sunday, November 5, 2017 6:53 AM, Colin King wrote:
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable len is assigned but never read, therefore it is redundant
> and can be removed. Cleans up clang warning:
> 
> drivers/video/backlight/ili922x.c:276:2: warning: Value stored to 'len'
> is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Jingoo Han <jingoohan1@gmail.com>

Thank you for sending the patch.
It looks good.

Best regards,
Jingoo Han

> ---
>  drivers/video/backlight/ili922x.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/backlight/ili922x.c
> b/drivers/video/backlight/ili922x.c
> index a9e9cef..2b6c6aa 100644
> --- a/drivers/video/backlight/ili922x.c
> +++ b/drivers/video/backlight/ili922x.c
> @@ -251,7 +251,7 @@ static int ili922x_write(struct spi_device *spi, u8
> reg, u16 value)
>  	struct spi_transfer xfer_regindex, xfer_regvalue;
>  	unsigned char tbuf[CMD_BUFSIZE];
>  	unsigned char rbuf[CMD_BUFSIZE];
> -	int ret, len = 0;
> +	int ret;
> 
>  	memset(&xfer_regindex, 0, sizeof(struct spi_transfer));
>  	memset(&xfer_regvalue, 0, sizeof(struct spi_transfer));
> @@ -273,7 +273,6 @@ static int ili922x_write(struct spi_device *spi, u8
> reg, u16 value)
>  	ret = spi_sync(spi, &msg);
> 
>  	spi_message_init(&msg);
> -	len = 0;
>  	tbuf[0] = set_tx_byte(START_BYTE(ili922x_id, START_RS_REG,
>  					 START_RW_WRITE));
>  	tbuf[1] = set_tx_byte((value & 0xFF00) >> 8);
> --
> 2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] backlight: ili922x: remove redundant variable len
  2017-11-05 11:53 [PATCH] backlight: ili922x: remove redundant variable len Colin King
  2017-11-05 17:23 ` Jingoo Han
@ 2017-11-06 11:36 ` Daniel Thompson
  2017-11-08 10:43 ` Lee Jones
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Thompson @ 2017-11-06 11:36 UTC (permalink / raw)
  To: Colin King, Lee Jones, Jingoo Han, Bartlomiej Zolnierkiewicz,
	dri-devel, linux-fbdev
  Cc: kernel-janitors, linux-kernel

On 05/11/17 11:53, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable len is assigned but never read, therefore it is redundant
> and can be removed. Cleans up clang warning:
> 
> drivers/video/backlight/ili922x.c:276:2: warning: Value stored to 'len'
> is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Daniel Thompson <daniel.thompson@linaro.org>

> ---
>   drivers/video/backlight/ili922x.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c
> index a9e9cef..2b6c6aa 100644
> --- a/drivers/video/backlight/ili922x.c
> +++ b/drivers/video/backlight/ili922x.c
> @@ -251,7 +251,7 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
>   	struct spi_transfer xfer_regindex, xfer_regvalue;
>   	unsigned char tbuf[CMD_BUFSIZE];
>   	unsigned char rbuf[CMD_BUFSIZE];
> -	int ret, len = 0;
> +	int ret;
>   
>   	memset(&xfer_regindex, 0, sizeof(struct spi_transfer));
>   	memset(&xfer_regvalue, 0, sizeof(struct spi_transfer));
> @@ -273,7 +273,6 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
>   	ret = spi_sync(spi, &msg);
>   
>   	spi_message_init(&msg);
> -	len = 0;
>   	tbuf[0] = set_tx_byte(START_BYTE(ili922x_id, START_RS_REG,
>   					 START_RW_WRITE));
>   	tbuf[1] = set_tx_byte((value & 0xFF00) >> 8);
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] backlight: ili922x: remove redundant variable len
  2017-11-05 11:53 [PATCH] backlight: ili922x: remove redundant variable len Colin King
  2017-11-05 17:23 ` Jingoo Han
  2017-11-06 11:36 ` Daniel Thompson
@ 2017-11-08 10:43 ` Lee Jones
  2 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2017-11-08 10:43 UTC (permalink / raw)
  To: Colin King
  Cc: Daniel Thompson, Jingoo Han, Bartlomiej Zolnierkiewicz,
	dri-devel, linux-fbdev, kernel-janitors, linux-kernel

On Sun, 05 Nov 2017, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable len is assigned but never read, therefore it is redundant
> and can be removed. Cleans up clang warning:
> 
> drivers/video/backlight/ili922x.c:276:2: warning: Value stored to 'len'
> is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/video/backlight/ili922x.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied, thanks.

> diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c
> index a9e9cef..2b6c6aa 100644
> --- a/drivers/video/backlight/ili922x.c
> +++ b/drivers/video/backlight/ili922x.c
> @@ -251,7 +251,7 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
>  	struct spi_transfer xfer_regindex, xfer_regvalue;
>  	unsigned char tbuf[CMD_BUFSIZE];
>  	unsigned char rbuf[CMD_BUFSIZE];
> -	int ret, len = 0;
> +	int ret;
>  
>  	memset(&xfer_regindex, 0, sizeof(struct spi_transfer));
>  	memset(&xfer_regvalue, 0, sizeof(struct spi_transfer));
> @@ -273,7 +273,6 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
>  	ret = spi_sync(spi, &msg);
>  
>  	spi_message_init(&msg);
> -	len = 0;
>  	tbuf[0] = set_tx_byte(START_BYTE(ili922x_id, START_RS_REG,
>  					 START_RW_WRITE));
>  	tbuf[1] = set_tx_byte((value & 0xFF00) >> 8);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-08 10:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-05 11:53 [PATCH] backlight: ili922x: remove redundant variable len Colin King
2017-11-05 17:23 ` Jingoo Han
2017-11-06 11:36 ` Daniel Thompson
2017-11-08 10:43 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).