[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bdc7e401-a676-4040-9138-8dc5cf35bd05@redhat.com>
Date: Tue, 23 Jan 2024 00:04:23 +0100
From: Danilo Krummrich <dakr@...hat.com>
To: Dan Carpenter <dan.carpenter@...aro.org>,
Colin Ian King <colin.i.king@...il.com>
Cc: nouveau@...ts.freedesktop.org, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
Daniel Vetter <daniel@...ll.ch>
Subject: Re: [PATCH][next] drm/nouveau/fifo/gk104: remove redundant variable
ret
On 1/16/24 13:31, Dan Carpenter wrote:
> On Tue, Jan 16, 2024 at 11:16:09AM +0000, Colin Ian King wrote:
>> The variable ret is being assigned a value but it isn't being
>> read afterwards. The assignment is redundant and so ret can be
>> removed.
>>
>> Cleans up clang scan build warning:
>> warning: Although the value stored to 'ret' is used in the enclosing
>> expression, the value is never actually read from 'ret'
>> [deadcode.DeadStores]
>>
>> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
>> ---
>> drivers/gpu/drm/nouveau/nvif/fifo.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/nouveau/nvif/fifo.c b/drivers/gpu/drm/nouveau/nvif/fifo.c
>> index a463289962b2..e96de14ce87e 100644
>> --- a/drivers/gpu/drm/nouveau/nvif/fifo.c
>> +++ b/drivers/gpu/drm/nouveau/nvif/fifo.c
>> @@ -73,9 +73,9 @@ u64
>> nvif_fifo_runlist(struct nvif_device *device, u64 engine)
>> {
>> u64 runm = 0;
>> - int ret, i;
>> + int i;
>>
>> - if ((ret = nvif_fifo_runlists(device)))
>> + if (nvif_fifo_runlists(device))
>> return runm;
>
> Could we return a literal zero here? Otherwise, I'm surprised this
> doesn't trigger a static checker warning.
Why do you think so? Conditionally, runm is used later on as well. I don't
think the checker should complain about keeping the value single source.
If you agree, want to offer your RB?
- Danilo
>
> regards,
> dan carpenter
>
Powered by blists - more mailing lists