[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210813164049.GA2310720@pc>
Date: Fri, 13 Aug 2021 17:40:49 +0100
From: Salah Triki <salah.triki@...il.com>
To: Keith Packard <keithp@...thp.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] usb: misc: chaoskey: remove useless else
Remove useless else in order to make the code cleaner.
Signed-off-by: Salah Triki <salah.triki@...il.com>
---
drivers/usb/misc/chaoskey.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c
index 87067c3d6109..9814ac2201d5 100644
--- a/drivers/usb/misc/chaoskey.c
+++ b/drivers/usb/misc/chaoskey.c
@@ -299,14 +299,11 @@ static int chaoskey_release(struct inode *inode, struct file *file)
--dev->open;
- if (!dev->present) {
- if (dev->open == 0) {
- mutex_unlock(&dev->lock);
+ mutex_unlock(&dev->lock);
+
+ if (!dev->present)
+ if (dev->open == 0)
chaoskey_free(dev);
- } else
- mutex_unlock(&dev->lock);
- } else
- mutex_unlock(&dev->lock);
usb_dbg(interface, "release success");
return 0;
--
2.25.1
Powered by blists - more mailing lists