Skip to content

Commit

Permalink
staging: gasket: sysfs: remove unnecessary NULL check on device ptr
Browse files Browse the repository at this point in the history
The device pointer passed into get_mapping() will never be NULL; the
check is unnecessary.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Todd Poynor authored and Greg Kroah-Hartman committed Jul 28, 2018
1 parent f390d08 commit 14d7022
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/staging/gasket/gasket_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ static struct gasket_sysfs_mapping *get_mapping(struct device *device)
{
int i;

if (!device) {
pr_debug("%s: Received NULL device\n", __func__);
return NULL;
}

for (i = 0; i < GASKET_SYSFS_NUM_MAPPINGS; i++) {
mutex_lock(&dev_mappings[i].mutex);
if (dev_mappings[i].device == device) {
Expand Down

0 comments on commit 14d7022

Please sign in to comment.