2021-06-22 16:19:04

by Colin King

[permalink] [raw]
Subject: [PATCH][next] block/mq-deadline: remove redundant assignment of variable ret

From: Colin Ian King <[email protected]>

Variable ret is being assigned a value at the end of the function
and the value is never read. The assignment is redundant and can
be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <[email protected]>
---
block/mq-deadline-main.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/block/mq-deadline-main.c b/block/mq-deadline-main.c
index 4815e536091f..e3091d922ba2 100644
--- a/block/mq-deadline-main.c
+++ b/block/mq-deadline-main.c
@@ -639,7 +639,6 @@ static int dd_init_sched(struct request_queue *q, struct elevator_type *e)
if (ret)
goto free_stats;

- ret = 0;
q->elevator = eq;
return 0;

--
2.31.1


2021-06-22 21:16:48

by Bart Van Assche

[permalink] [raw]
Subject: Re: [PATCH][next] block/mq-deadline: remove redundant assignment of variable ret

On 6/22/21 9:17 AM, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> Variable ret is being assigned a value at the end of the function
> and the value is never read. The assignment is redundant and can
> be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <[email protected]>
> ---
> block/mq-deadline-main.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/block/mq-deadline-main.c b/block/mq-deadline-main.c
> index 4815e536091f..e3091d922ba2 100644
> --- a/block/mq-deadline-main.c
> +++ b/block/mq-deadline-main.c
> @@ -639,7 +639,6 @@ static int dd_init_sched(struct request_queue *q, struct elevator_type *e)
> if (ret)
> goto free_stats;
>
> - ret = 0;
> q->elevator = eq;
> return 0;

Reviewed-by: Bart Van Assche <[email protected]>

2021-06-22 21:19:35

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH][next] block/mq-deadline: remove redundant assignment of variable ret

On Jun 22, 2021, at 3:14 PM, Bart Van Assche <[email protected]> wrote:
>
> On 6/22/21 9:17 AM, Colin King wrote:
>> From: Colin Ian King <[email protected]>
>>
>> Variable ret is being assigned a value at the end of the function
>> and the value is never read. The assignment is redundant and can
>> be removed.
>>
>> Addresses-Coverity: ("Unused value")
>> Signed-off-by: Colin Ian King <[email protected]>
>> ---
>> block/mq-deadline-main.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/block/mq-deadline-main.c b/block/mq-deadline-main.c
>> index 4815e536091f..e3091d922ba2 100644
>> --- a/block/mq-deadline-main.c
>> +++ b/block/mq-deadline-main.c
>> @@ -639,7 +639,6 @@ static int dd_init_sched(struct request_queue *q, struct elevator_type *e)
>> if (ret)
>> goto free_stats;
>>
>> - ret = 0;
>> q->elevator = eq;
>> return 0;
>
> Reviewed-by: Bart Van Assche <[email protected]>

Assuming this is fallout from the recent series, we should add a fixes tag to it.


Jens Axboe