From: Michael Benedict Date: Mon, 3 Jun 2019 08:21:08 +0000 (+1000) Subject: battery_v2: silence enum-conversion warnings X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f9db72af931354932755b60d41fbbd662851fe9;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git battery_v2: silence enum-conversion warnings Signed-off-by: Michael Benedict --- diff --git a/drivers/battery_v2/include/sec_charging_common.h b/drivers/battery_v2/include/sec_charging_common.h index 172c0985afa9..ec9ce8b5f89d 100755 --- a/drivers/battery_v2/include/sec_charging_common.h +++ b/drivers/battery_v2/include/sec_charging_common.h @@ -1031,7 +1031,8 @@ static inline struct power_supply *get_power_supply_by_name(char *name) ret = -ENOENT; \ } else { \ if (psy->desc->function##_property != NULL) { \ - ret = psy->desc->function##_property(psy, (property), &(value)); \ + ret = psy->desc->function##_property(psy, \ + (enum power_supply_property) (property), &(value)); \ if (ret < 0) { \ pr_err("%s: Fail to %s "#function" (%d=>%d)\n", \ __func__, name, (property), ret); \ diff --git a/drivers/battery_v2/max77865_charger.c b/drivers/battery_v2/max77865_charger.c index da10d164ce93..a6ae1d4b3f77 100755 --- a/drivers/battery_v2/max77865_charger.c +++ b/drivers/battery_v2/max77865_charger.c @@ -895,7 +895,7 @@ static int max77865_chg_get_property(struct power_supply *psy, { struct max77865_charger_data *charger = power_supply_get_drvdata(psy); u8 reg_data; - enum power_supply_ext_property ext_psp = psp; + enum power_supply_ext_property ext_psp = (enum power_supply_ext_property)psp; switch (psp) { case POWER_SUPPLY_PROP_ONLINE: @@ -1031,7 +1031,7 @@ static int max77865_chg_set_property(struct power_supply *psy, u8 reg = 0; static u8 chg_int_state; int buck_state = ENABLE; - enum power_supply_ext_property ext_psp = psp; + enum power_supply_ext_property ext_psp = (enum power_supply_ext_property)psp; switch (psp) { /* val->intval : type */ diff --git a/drivers/battery_v2/mfc_charger.c b/drivers/battery_v2/mfc_charger.c index 8cb8135c8003..a69a52ec90e9 100755 --- a/drivers/battery_v2/mfc_charger.c +++ b/drivers/battery_v2/mfc_charger.c @@ -1774,7 +1774,7 @@ static int mfc_chg_get_property(struct power_supply *psy, union power_supply_propval *val) { struct mfc_charger_data *charger = power_supply_get_drvdata(psy); - enum power_supply_ext_property ext_psp = psp; + enum power_supply_ext_property ext_psp = (enum power_supply_ext_property) psp; // union power_supply_propval value; u8 mst_mode; u8 reg_data; diff --git a/drivers/battery_v2/sec_battery.c b/drivers/battery_v2/sec_battery.c index a67256024b42..65bab09c2fa9 100755 --- a/drivers/battery_v2/sec_battery.c +++ b/drivers/battery_v2/sec_battery.c @@ -6241,7 +6241,7 @@ static int sec_bat_set_property(struct power_supply *psy, int current_cable_type = SEC_BATTERY_CABLE_NONE; int full_check_type = SEC_BATTERY_FULLCHARGED_NONE; union power_supply_propval value = {0, }; - enum power_supply_ext_property ext_psp = psp; + enum power_supply_ext_property ext_psp = (enum power_supply_ext_property) psp; dev_dbg(battery->dev, "%s: (%d,%d)\n", __func__, psp, val->intval); @@ -6491,7 +6491,7 @@ static int sec_bat_get_property(struct power_supply *psy, { struct sec_battery_info *battery = power_supply_get_drvdata(psy); union power_supply_propval value = {0, }; - enum power_supply_ext_property ext_psp = psp; + enum power_supply_ext_property ext_psp = (enum power_supply_ext_property) psp; switch (psp) { case POWER_SUPPLY_PROP_STATUS: @@ -6738,7 +6738,7 @@ static int sec_ac_get_property(struct power_supply *psy, union power_supply_propval *val) { struct sec_battery_info *battery = power_supply_get_drvdata(psy); - enum power_supply_ext_property ext_psp = psp; + enum power_supply_ext_property ext_psp = (enum power_supply_ext_property) psp; switch (psp) { case POWER_SUPPLY_PROP_ONLINE: