cxl: Simplify bool conversion
authorYang Li <yang.lee@linux.alibaba.com>
Fri, 29 Jan 2021 08:25:05 +0000 (16:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Feb 2021 16:02:18 +0000 (17:02 +0100)
Fix the following coccicheck warning:
./drivers/misc/cxl/sysfs.c:181:48-53: WARNING: conversion to bool not
needed here

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1611908705-98507-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/cxl/sysfs.c

index d97a243ad30c09f853d52b9ed084ecf1ed87ddfd..c173a5e88c910858a122d75d8301085251d111e0 100644 (file)
@@ -178,7 +178,7 @@ static ssize_t perst_reloads_same_image_store(struct device *device,
        if ((rc != 1) || !(val == 1 || val == 0))
                return -EINVAL;
 
-       adapter->perst_same_image = (val == 1 ? true : false);
+       adapter->perst_same_image = (val == 1);
        return count;
 }