[PATCH 1/5] staging: gasket: sysfs: remove check for refcount already zero

From: Todd Poynor
Date: Sat Jul 28 2018 - 01:22:49 EST


From: Todd Poynor <toddpoynor@xxxxxxxxxx>

Remove the check for refcount already zero, which shouldn't be
necessary.

Signed-off-by: Todd Poynor <toddpoynor@xxxxxxxxxx>
---
drivers/staging/gasket/gasket_sysfs.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/staging/gasket/gasket_sysfs.c b/drivers/staging/gasket/gasket_sysfs.c
index 418b81797e638..2d8647de697cd 100644
--- a/drivers/staging/gasket/gasket_sysfs.c
+++ b/drivers/staging/gasket/gasket_sysfs.c
@@ -111,8 +111,6 @@ static void put_mapping(struct gasket_sysfs_mapping *mapping)
}

mutex_lock(&mapping->mutex);
- if (refcount_read(&mapping->refcount.refcount) == 0)
- dev_err(mapping->device, "Refcount is already 0\n");
if (kref_put(&mapping->refcount, release_entry)) {
dev_dbg(mapping->device, "Removing Gasket sysfs mapping\n");
/*
--
2.18.0.345.g5c9ce644c3-goog