power: supply: core: Use true and false for bool variable
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Tue, 9 Feb 2021 09:58:43 +0000 (17:58 +0800)
committerSebastian Reichel <sre@kernel.org>
Mon, 5 Apr 2021 10:12:18 +0000 (12:12 +0200)
Fix the following coccicheck warning:

./include/linux/power_supply.h:507:9-10: WARNING: return of 0/1 in
function 'power_supply_is_watt_property' with return type bool.

./include/linux/power_supply.h:479:9-10: WARNING: return of 0/1 in
function 'power_supply_is_amp_property' with return type bool.

Reported-by: Abaci Robot<abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
include/linux/power_supply.h

index 6e776be5bfa0853098198fbec42ced7a7d17add7..174a534fd9075cc236b897aca470ce7d5691bd40 100644 (file)
@@ -482,12 +482,12 @@ static inline bool power_supply_is_amp_property(enum power_supply_property psp)
        case POWER_SUPPLY_PROP_CURRENT_NOW:
        case POWER_SUPPLY_PROP_CURRENT_AVG:
        case POWER_SUPPLY_PROP_CURRENT_BOOT:
-               return 1;
+               return true;
        default:
                break;
        }
 
-       return 0;
+       return false;
 }
 
 static inline bool power_supply_is_watt_property(enum power_supply_property psp)
@@ -510,12 +510,12 @@ static inline bool power_supply_is_watt_property(enum power_supply_property psp)
        case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
        case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX:
        case POWER_SUPPLY_PROP_POWER_NOW:
-               return 1;
+               return true;
        default:
                break;
        }
 
-       return 0;
+       return false;
 }
 
 #ifdef CONFIG_POWER_SUPPLY_HWMON