linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] block/mq-deadline: remove redundant assignment of variable ret
@ 2021-06-22 16:17 Colin King
  2021-06-22 21:14 ` Bart Van Assche
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2021-06-22 16:17 UTC (permalink / raw)
  To: Jens Axboe, linux-block; +Cc: kernel-janitors, linux-kernel

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

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 <colin.king@canonical.com>
---
 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


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

* Re: [PATCH][next] block/mq-deadline: remove redundant assignment of variable ret
  2021-06-22 16:17 [PATCH][next] block/mq-deadline: remove redundant assignment of variable ret Colin King
@ 2021-06-22 21:14 ` Bart Van Assche
  2021-06-22 21:15   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2021-06-22 21:14 UTC (permalink / raw)
  To: Colin King, Jens Axboe, linux-block; +Cc: kernel-janitors, linux-kernel

On 6/22/21 9:17 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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 <colin.king@canonical.com>
> ---
>  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 <bvanassche@acm.org>

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

* Re: [PATCH][next] block/mq-deadline: remove redundant assignment of variable ret
  2021-06-22 21:14 ` Bart Van Assche
@ 2021-06-22 21:15   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2021-06-22 21:15 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Colin King, linux-block, kernel-janitors, linux-kernel

On Jun 22, 2021, at 3:14 PM, Bart Van Assche <bvanassche@acm.org> wrote:
> 
> On 6/22/21 9:17 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>> 
>> 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 <colin.king@canonical.com>
>> ---
>> 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 <bvanassche@acm.org>

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

— 
Jens Axboe

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

end of thread, other threads:[~2021-06-22 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 16:17 [PATCH][next] block/mq-deadline: remove redundant assignment of variable ret Colin King
2021-06-22 21:14 ` Bart Van Assche
2021-06-22 21:15   ` Jens Axboe

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).