[linux-next:master 8287/11475] drivers/platform/x86/thinkpad_acpi.c:9600:9: error: implicit declaration of function 'power_supply_charge_behaviour_show'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   b8170452cd5121b11a5726e3ea8dbdfc2d74e771
commit: b55d416d48f5907f66218ae3d878e3bfb69ae4e6 [8287/11475] platform/x86: thinkpad_acpi: support force-discharge
config: x86_64-buildonly-randconfig-r005-20220107 (https://download.01.org/0day-ci/archive/20220108/202201080424.U284YcVw-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b55d416d48f5907f66218ae3d878e3bfb69ae4e6
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout b55d416d48f5907f66218ae3d878e3bfb69ae4e6
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/platform/x86/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   drivers/platform/x86/thinkpad_acpi.c: In function 'charge_behaviour_show':
>> drivers/platform/x86/thinkpad_acpi.c:9600:9: error: implicit declaration of function 'power_supply_charge_behaviour_show' [-Werror=implicit-function-declaration]
    9600 |  return power_supply_charge_behaviour_show(dev, available, active, buf);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c: In function 'charge_behaviour_store':
>> drivers/platform/x86/thinkpad_acpi.c:9627:13: error: implicit declaration of function 'power_supply_charge_behaviour_parse' [-Werror=implicit-function-declaration]
    9627 |  selected = power_supply_charge_behaviour_parse(available, buf);
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/power_supply_charge_behaviour_show +9600 drivers/platform/x86/thinkpad_acpi.c

  9580	
  9581	static ssize_t charge_behaviour_show(struct device *dev,
  9582					     struct device_attribute *attr,
  9583					     char *buf)
  9584	{
  9585		enum power_supply_charge_behaviour active = POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO;
  9586		struct power_supply *supply = to_power_supply(dev);
  9587		unsigned int available;
  9588		int ret, battery;
  9589	
  9590		battery = tpacpi_battery_get_id(supply->desc->name);
  9591		available = battery_info.batteries[battery].charge_behaviours;
  9592	
  9593		if (available & BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE)) {
  9594			if (tpacpi_battery_get(FORCE_DISCHARGE, battery, &ret))
  9595				return -ENODEV;
  9596			if (ret)
  9597				active = POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE;
  9598		}
  9599	
> 9600		return power_supply_charge_behaviour_show(dev, available, active, buf);
  9601	}
  9602	
  9603	static ssize_t charge_control_start_threshold_store(struct device *dev,
  9604					struct device_attribute *attr,
  9605					const char *buf, size_t count)
  9606	{
  9607		return tpacpi_battery_store(THRESHOLD_START, dev, buf, count);
  9608	}
  9609	
  9610	static ssize_t charge_control_end_threshold_store(struct device *dev,
  9611					struct device_attribute *attr,
  9612					const char *buf, size_t count)
  9613	{
  9614		return tpacpi_battery_store(THRESHOLD_STOP, dev, buf, count);
  9615	}
  9616	
  9617	static ssize_t charge_behaviour_store(struct device *dev,
  9618					      struct device_attribute *attr,
  9619					      const char *buf, size_t count)
  9620	{
  9621		struct power_supply *supply = to_power_supply(dev);
  9622		int selected, battery, ret = 0;
  9623		unsigned int available;
  9624	
  9625		battery = tpacpi_battery_get_id(supply->desc->name);
  9626		available = battery_info.batteries[battery].charge_behaviours;
> 9627		selected = power_supply_charge_behaviour_parse(available, buf);
  9628	
  9629		if (selected < 0)
  9630			return selected;
  9631	
  9632		switch (selected) {
  9633		case POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO:
  9634			if (available & BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE))
  9635				ret = tpacpi_battery_set_validate(FORCE_DISCHARGE, battery, 0);
  9636			if (ret < 0)
  9637				return ret;
  9638			break;
  9639		case POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE:
  9640			ret = tpacpi_battery_set_validate(FORCE_DISCHARGE, battery, 1);
  9641			if (ret < 0)
  9642				return ret;
  9643			break;
  9644		default:
  9645			dev_err(dev, "Unexpected charge behaviour: %d\n", selected);
  9646			return -EINVAL;
  9647		}
  9648	
  9649		return count;
  9650	}
  9651	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux