staging: gasket: sysfs: remove unnecessary NULL check on device ptr
authorTodd Poynor <toddpoynor@google.com>
Sat, 28 Jul 2018 05:21:58 +0000 (22:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 28 Jul 2018 07:24:10 +0000 (09:24 +0200)
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>
drivers/staging/gasket/gasket_sysfs.c

index 2d8647de697cd9de9d40af54aa81b1739a4a2423..da972ce0e0db0eb84d4d0448e03418b2565de83d 100644 (file)
@@ -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) {