Re: [PATCH] add support for battery charging threshold, mute. correctly save ac/dc brightness to hardware registers

From: kernel test robot
Date: Tue Aug 18 2020 - 16:10:15 EST


Hi Kenneth,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.9-rc1 next-20200818]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Kenneth-Chan/add-support-for-battery-charging-threshold-mute-correctly-save-ac-dc-brightness-to-hardware-registers/20200819-020600
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git bcf876870b95592b52519ed4aafcf9d95999bc9c
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64

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

All warnings (new ones prefixed by >>):

drivers/platform/x86/panasonic-laptop.c: In function 'eco_mode_store':
>> drivers/platform/x86/panasonic-laptop.c:602:11: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
602 | int err, rc, state;
| ^~

# https://github.com/0day-ci/linux/commit/1f9eb2351cf22424f1ca39f5068c51fe74189aba
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kenneth-Chan/add-support-for-battery-charging-threshold-mute-correctly-save-ac-dc-brightness-to-hardware-registers/20200819-020600
git checkout 1f9eb2351cf22424f1ca39f5068c51fe74189aba
vim +/rc +602 drivers/platform/x86/panasonic-laptop.c

596
597 static ssize_t eco_mode_store(struct device *dev, struct device_attribute *attr,
598 const char *buf, size_t count)
599 {
600 struct acpi_device *acpi = to_acpi_device(dev);
601 struct pcc_acpi *pcc = acpi_driver_data(acpi);
> 602 int err, rc, state;
603
604 union acpi_object param[2];
605 struct acpi_object_list input;
606 acpi_status status;
607
608 param[0].type = ACPI_TYPE_INTEGER;
609 param[0].integer.value = 0x15;
610 param[1].type = ACPI_TYPE_INTEGER;
611 input.count = 2;
612 input.pointer = param;
613
614 err = kstrtoint(buf, 0, &state);
615 if (err)
616 return err;
617
618 switch (state) {
619 case 0:
620 param[1].integer.value = ECO_MODE_OFF;
621 pcc->sinf[SINF_ECO_MODE] = 0;
622 pcc->eco_mode = 0;
623 break;
624 case 1:
625 param[1].integer.value = ECO_MODE_ON;
626 pcc->sinf[SINF_ECO_MODE] = 1;
627 pcc->eco_mode = 1;
628 break;
629 default:
630 /* nothing to do */
631 rc = -EIO;
632 break;
633 }
634
635 status = acpi_evaluate_object(NULL, METHOD_ECWR,
636 &input, NULL);
637 if (ACPI_FAILURE(status)) {
638 pr_err("%s evaluation failed\n", METHOD_ECWR);
639 return -EINVAL;
640 }
641
642 return count;
643 }
644

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

Attachment: .config.gz
Description: application/gzip