staging: gasket Fix comparison with Null
authorMayank Suman <mayanksuman@live.com>
Fri, 19 Feb 2021 17:41:14 +0000 (23:11 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Mar 2021 08:25:27 +0000 (09:25 +0100)
Comparison with NULL is redundant
as pointer will evaluate to true if is non-NULL.
The change was suggested by checkpatch.pl.

Signed-off-by: Mayank Suman <mayanksuman@live.com>
Link: https://lore.kernel.org/r/PS1PR04MB2934D85E82A3730349F56FE9D6849@PS1PR04MB2934.apcprd04.prod.outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gasket/gasket_sysfs.c

index af26bc9..c5658fd 100644 (file)
@@ -228,7 +228,7 @@ int gasket_sysfs_create_entries(struct device *device,
        }
 
        mutex_lock(&mapping->mutex);
-       for (i = 0; attrs[i].attr.attr.name != NULL; i++) {
+       for (i = 0; attrs[i].attr.attr.name; i++) {
                if (mapping->attribute_count == GASKET_SYSFS_MAX_NODES) {
                        dev_err(device,
                                "Maximum number of sysfs nodes reached for device\n");