* [PATCH] pktcdvd: remove redundant initialization of variable ret
@ 2020-06-11 14:30 Colin King
2020-06-11 15:16 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-06-11 14:30 UTC (permalink / raw)
To: linux-block, Jens Axboe; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable ret is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/block/pktcdvd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 0b944ac96d6b..27a33adc41e4 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1613,7 +1613,7 @@ static noinline_for_stack int pkt_get_last_written(struct pktcdvd_device *pd,
disc_information di;
track_information ti;
__u32 last_track;
- int ret = -1;
+ int ret;
ret = pkt_get_disc_info(pd, &di);
if (ret)
--
2.27.0.rc0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pktcdvd: remove redundant initialization of variable ret
2020-06-11 14:30 [PATCH] pktcdvd: remove redundant initialization of variable ret Colin King
@ 2020-06-11 15:16 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2020-06-11 15:16 UTC (permalink / raw)
To: Colin King, linux-block; +Cc: kernel-janitors, linux-kernel
On 6/11/20 8:30 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable ret is being initialized with a value that is never read
> and it is being updated later with a new value. The initialization is
> redundant and can be removed.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-11 15:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 14:30 [PATCH] pktcdvd: remove redundant initialization of variable ret Colin King
2020-06-11 15:16 ` 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).