Re: [PATCH V2 5/9] platform/x86: intel_pmc_core: Get LPM requirements for Tiger Lake
From: kernel test robot
Date: Sat Apr 17 2021 - 02:02:14 EST
Hi "David,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on 823b31517ad3196324322804ee365d5fcff704d6]
url: https://github.com/0day-ci/linux/commits/David-E-Box/intel_pmc_core-Add-sub-state-requirements-and-mode/20210417-111530
base: 823b31517ad3196324322804ee365d5fcff704d6
config: i386-randconfig-a001-20210417 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/703038f16e99686bf2538222cee482f823bfa60f
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review David-E-Box/intel_pmc_core-Add-sub-state-requirements-and-mode/20210417-111530
git checkout 703038f16e99686bf2538222cee482f823bfa60f
# save the attached .config to linux build tree
make W=1 W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
In file included from drivers/platform/x86/intel_pmc_core.c:14:
drivers/platform/x86/intel_pmc_core.c: In function 'pmc_core_get_tgl_lpm_reqs':
>> drivers/platform/x86/intel_pmc_core.c:621:5: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
621 | "_DSM returned unexpected buffer size,"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
622 | " have %d, expect %ld\n", size, lpm_size);
| ~~~~~~~~
| |
| size_t {aka unsigned int}
include/linux/acpi.h:1073:42: note: in definition of macro 'acpi_handle_debug'
1073 | acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__); \
| ^~~
drivers/platform/x86/intel_pmc_core.c:622:25: note: format string is defined here
622 | " have %d, expect %ld\n", size, lpm_size);
| ~~^
| |
| long int
| %d
vim +621 drivers/platform/x86/intel_pmc_core.c
597
598 static void pmc_core_get_tgl_lpm_reqs(struct platform_device *pdev)
599 {
600 struct pmc_dev *pmcdev = platform_get_drvdata(pdev);
601 const int num_maps = pmcdev->map->lpm_num_maps;
602 size_t lpm_size = LPM_MAX_NUM_MODES * num_maps * 4;
603 union acpi_object *out_obj;
604 struct acpi_device *adev;
605 guid_t s0ix_dsm_guid;
606 u32 *lpm_req_regs, *addr;
607
608 adev = ACPI_COMPANION(&pdev->dev);
609 if (!adev)
610 return;
611
612 guid_parse(ACPI_S0IX_DSM_UUID, &s0ix_dsm_guid);
613
614 out_obj = acpi_evaluate_dsm(adev->handle, &s0ix_dsm_guid, 0,
615 ACPI_GET_LOW_MODE_REGISTERS, NULL);
616 if (out_obj && out_obj->type == ACPI_TYPE_BUFFER) {
617 int size = out_obj->buffer.length;
618
619 if (size != lpm_size) {
620 acpi_handle_debug(adev->handle,
> 621 "_DSM returned unexpected buffer size,"
622 " have %d, expect %ld\n", size, lpm_size);
623 goto free_acpi_obj;
624 }
625 } else {
626 acpi_handle_debug(adev->handle,
627 "_DSM function 0 evaluation failed\n");
628 goto free_acpi_obj;
629 }
630
631 addr = (u32 *)out_obj->buffer.pointer;
632
633 lpm_req_regs = devm_kzalloc(&pdev->dev, lpm_size * sizeof(u32),
634 GFP_KERNEL);
635 if (!lpm_req_regs)
636 goto free_acpi_obj;
637
638 memcpy(lpm_req_regs, addr, lpm_size);
639 pmcdev->lpm_req_regs = lpm_req_regs;
640
641 free_acpi_obj:
642 ACPI_FREE(out_obj);
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