From: kernel test robot <lkp@intel.com>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: kbuild-all@lists.01.org,
"Linux Memory Management List" <linux-mm@kvack.org>,
"Hans de Goede" <hdegoede@redhat.com>,
"Thomas Koch" <linrunner@gmx.net>,
"Nicolò Piazzalunga" <nicolopiazzalunga@gmail.com>
Subject: [linux-next:master 8287/11475] drivers/platform/x86/thinkpad_acpi.c:9600:9: error: implicit declaration of function 'power_supply_charge_behaviour_show'
Date: Sat, 8 Jan 2022 04:08:56 +0800 [thread overview]
Message-ID: <202201080424.U284YcVw-lkp@intel.com> (raw)
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@intel.com/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@intel.com>
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@lists.01.org
next reply other threads:[~2022-01-07 20:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-07 20:08 kernel test robot [this message]
2022-01-08 10:24 ` Hans de Goede
2022-01-08 15:31 ` [PATCH] power: supply: Provide stubs for charge_behaviour helpers Thomas Weißschuh
2022-01-08 15:58 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202201080424.U284YcVw-lkp@intel.com \
--to=lkp@intel.com \
--cc=hdegoede@redhat.com \
--cc=kbuild-all@lists.01.org \
--cc=linrunner@gmx.net \
--cc=linux-mm@kvack.org \
--cc=linux@weissschuh.net \
--cc=nicolopiazzalunga@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox