From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] backlight: ili922x: remove redundant variable len
Date: Mon, 06 Nov 2017 12:06:46 +0000 [thread overview]
Message-ID: <5A005056.4020809@bfs.de> (raw)
In-Reply-To: <20171105115326.5276-1-colin.king@canonical.com>
Am 06.11.2017 12:36, schrieb Daniel Thompson:
> 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);
>>
nitpick:
value is u16 so value >> 8 is sufficient
re,
wh
>
> --
> To unsubscribe from this list: send the line "unsubscribe
> kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2017-11-06 12:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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-06 12:06 ` walter harms [this message]
2017-11-06 12:59 ` Dan Carpenter
2017-11-08 10:43 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5A005056.4020809@bfs.de \
--to=wharms@bfs.de \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox