* [PATCH] umem: remove redundant initialization of variable ret
@ 2020-06-11 14:35 Colin King
2020-06-11 15:16 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-06-11 14:35 UTC (permalink / raw)
To: Jens Axboe, linux-block; +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/umem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index d84e8a878df2..1e2aa5ae2796 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -784,7 +784,7 @@ static const struct block_device_operations mm_fops = {
static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
- int ret = -ENODEV;
+ int ret;
struct cardinfo *card = &cards[num_cards];
unsigned char mem_present;
unsigned char batt_status;
--
2.27.0.rc0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] umem: remove redundant initialization of variable ret
2020-06-11 14:35 [PATCH] umem: 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:35 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:35 [PATCH] umem: 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).