linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, Johan Hovold <johan@kernel.org>
Subject: [PATCH 2/3] USB: idmouse: drop redundant open-count check from release
Date: Tue,  5 Nov 2019 11:36:37 +0100	[thread overview]
Message-ID: <20191105103638.4929-3-johan@kernel.org> (raw)
In-Reply-To: <20191105103638.4929-1-johan@kernel.org>

The open count will always be exactly one when release is called, so
drop the redundant sanity check.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/misc/idmouse.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c
index 0386bac224c4..9b9d5df829d5 100644
--- a/drivers/usb/misc/idmouse.c
+++ b/drivers/usb/misc/idmouse.c
@@ -278,12 +278,6 @@ static int idmouse_release(struct inode *inode, struct file *file)
 	/* lock our device */
 	mutex_lock(&dev->lock);
 
-	/* are we really open? */
-	if (dev->open <= 0) {
-		mutex_unlock(&dev->lock);
-		return -ENODEV;
-	}
-
 	--dev->open;
 
 	if (!dev->present) {
-- 
2.23.0


  parent reply	other threads:[~2019-11-05 10:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 10:36 [PATCH 0/3] USB: idmouse: disconnect clean ups Johan Hovold
2019-11-05 10:36 ` [PATCH 1/3] USB: idmouse: simplify disconnect handling Johan Hovold
2019-11-05 10:36 ` Johan Hovold [this message]
2019-11-05 10:36 ` [PATCH 3/3] USB: idmouse: clean up runaway white space Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191105103638.4929-3-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).