All of lore.kernel.org
 help / color / mirror / Atom feed
* [pm:acpica-osl 2/2] drivers/acpi/osl.c:533:13: error: implicit declaration of function 'acpi_os_drop_map_ref'
@ 2020-06-13 21:19 ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-06-13 21:19 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: kbuild-all, linux-acpi, devel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 8691 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git acpica-osl
head:   cfc2a23e4be42e58a453502acaf4a6330ef32f5f
commit: cfc2a23e4be42e58a453502acaf4a6330ef32f5f [2/2] ACPI: OSL: Add support for deferred unmapping of ACPI memory
config: i386-randconfig-s031-20200614 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-250-g42323db3-dirty
        git checkout cfc2a23e4be42e58a453502acaf4a6330ef32f5f
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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 >>, old ones prefixed by <<):

drivers/acpi/osl.c: In function 'acpi_os_vprintf':
drivers/acpi/osl.c:153:2: warning: function 'acpi_os_vprintf' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
153 |  vsprintf(buffer, fmt, args);
|  ^~~~~~~~
drivers/acpi/osl.c: In function 'acpi_os_unmap_generic_address':
>> drivers/acpi/osl.c:533:13: error: implicit declaration of function 'acpi_os_drop_map_ref' [-Werror=implicit-function-declaration]
533 |  refcount = acpi_os_drop_map_ref(map);
|             ^~~~~~~~~~~~~~~~~~~~
>> drivers/acpi/osl.c:537:3: error: implicit declaration of function 'acpi_os_map_cleanup'; did you mean 'acpi_os_map_memory'? [-Werror=implicit-function-declaration]
537 |   acpi_os_map_cleanup(map);
|   ^~~~~~~~~~~~~~~~~~~
|   acpi_os_map_memory
cc1: some warnings being treated as errors

sparse warnings: (new ones prefixed by >>)

   drivers/acpi/osl.c:375:17: sparse: sparse: cast removes address space '<asn:2>' of expression
>> drivers/acpi/osl.c:481:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] <asn:2> *virt @@     got void *virt @@
>> drivers/acpi/osl.c:481:29: sparse:     expected void [noderef] <asn:2> *virt
>> drivers/acpi/osl.c:481:29: sparse:     got void *virt
   drivers/acpi/osl.c:533:20: sparse: sparse: undefined identifier 'acpi_os_drop_map_ref'
   drivers/acpi/osl.c:537:17: sparse: sparse: undefined identifier 'acpi_os_map_cleanup'
   drivers/acpi/osl.c:757:1: sparse: sparse: context imbalance in 'acpi_os_read_memory' - wrong count at exit
   drivers/acpi/osl.c:790:1: sparse: sparse: context imbalance in 'acpi_os_write_memory' - wrong count at exit

vim +/acpi_os_drop_map_ref +533 drivers/acpi/osl.c

620242ae8c3d9c Myron Stowe         2010-10-21  466  
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  467  /**
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  468   * acpi_os_unmap_deferred - Drop a memory mapping reference.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  469   * @virt: Start of the address range to drop a reference to.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  470   * @size: Size of the address range to drop a reference to.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  471   *
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  472   * Look up the given virtual address range in the list of existing ACPI memory
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  473   * mappings, drop a reference to it and if there are no more active references
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  474   * to it, put it in the list of unused memory mappings.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  475   *
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  476   * During early init (when acpi_permanent_mmap has not been set yet) this
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  477   * routine behaves like acpi_os_unmap_memory().
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  478   */
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  479  void __ref acpi_os_unmap_deferred(void *virt, acpi_size size)
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  480  {
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13 @481  	acpi_os_unref_iomem(virt, size);
ad71860a17ba33 Alexey Starikovskiy 2007-02-02  482  }
a238317ce81855 Lv Zheng            2014-05-20  483  
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  484  /**
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  485   * acpi_os_release_unused_mappings - Release unused ACPI memory mappings.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  486   */
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  487  void acpi_os_release_unused_mappings(void)
a238317ce81855 Lv Zheng            2014-05-20  488  {
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  489  	__acpi_os_release_unused_mappings(false);
a238317ce81855 Lv Zheng            2014-05-20  490  }
^1da177e4c3f41 Linus Torvalds      2005-04-16  491  
6f68c91c55ea35 Myron Stowe         2011-11-07  492  int acpi_os_map_generic_address(struct acpi_generic_address *gas)
29718521237a1b Myron Stowe         2010-10-21  493  {
bc9ffce27962c0 Myron Stowe         2011-11-07  494  	u64 addr;
29718521237a1b Myron Stowe         2010-10-21  495  	void __iomem *virt;
29718521237a1b Myron Stowe         2010-10-21  496  
bc9ffce27962c0 Myron Stowe         2011-11-07  497  	if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
29718521237a1b Myron Stowe         2010-10-21  498  		return 0;
29718521237a1b Myron Stowe         2010-10-21  499  
bc9ffce27962c0 Myron Stowe         2011-11-07  500  	/* Handle possible alignment issues */
bc9ffce27962c0 Myron Stowe         2011-11-07  501  	memcpy(&addr, &gas->address, sizeof(addr));
bc9ffce27962c0 Myron Stowe         2011-11-07  502  	if (!addr || !gas->bit_width)
29718521237a1b Myron Stowe         2010-10-21  503  		return -EINVAL;
29718521237a1b Myron Stowe         2010-10-21  504  
a238317ce81855 Lv Zheng            2014-05-20  505  	virt = acpi_os_map_iomem(addr, gas->bit_width / 8);
29718521237a1b Myron Stowe         2010-10-21  506  	if (!virt)
29718521237a1b Myron Stowe         2010-10-21  507  		return -EIO;
29718521237a1b Myron Stowe         2010-10-21  508  
29718521237a1b Myron Stowe         2010-10-21  509  	return 0;
29718521237a1b Myron Stowe         2010-10-21  510  }
6f68c91c55ea35 Myron Stowe         2011-11-07  511  EXPORT_SYMBOL(acpi_os_map_generic_address);
29718521237a1b Myron Stowe         2010-10-21  512  
6f68c91c55ea35 Myron Stowe         2011-11-07  513  void acpi_os_unmap_generic_address(struct acpi_generic_address *gas)
29718521237a1b Myron Stowe         2010-10-21  514  {
bc9ffce27962c0 Myron Stowe         2011-11-07  515  	u64 addr;
7fe135dc058fae Rafael J. Wysocki   2011-02-08  516  	struct acpi_ioremap *map;
833a426cc471b6 Francesco Ruggeri   2019-11-19  517  	unsigned long refcount;
29718521237a1b Myron Stowe         2010-10-21  518  
bc9ffce27962c0 Myron Stowe         2011-11-07  519  	if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
29718521237a1b Myron Stowe         2010-10-21  520  		return;
29718521237a1b Myron Stowe         2010-10-21  521  
bc9ffce27962c0 Myron Stowe         2011-11-07  522  	/* Handle possible alignment issues */
bc9ffce27962c0 Myron Stowe         2011-11-07  523  	memcpy(&addr, &gas->address, sizeof(addr));
bc9ffce27962c0 Myron Stowe         2011-11-07  524  	if (!addr || !gas->bit_width)
29718521237a1b Myron Stowe         2010-10-21  525  		return;
29718521237a1b Myron Stowe         2010-10-21  526  
7bbb890358b96c Rafael J. Wysocki   2011-02-08  527  	mutex_lock(&acpi_ioremap_lock);
bc9ffce27962c0 Myron Stowe         2011-11-07  528  	map = acpi_map_lookup(addr, gas->bit_width / 8);
7fe135dc058fae Rafael J. Wysocki   2011-02-08  529  	if (!map) {
7fe135dc058fae Rafael J. Wysocki   2011-02-08  530  		mutex_unlock(&acpi_ioremap_lock);
7fe135dc058fae Rafael J. Wysocki   2011-02-08  531  		return;
7fe135dc058fae Rafael J. Wysocki   2011-02-08  532  	}
833a426cc471b6 Francesco Ruggeri   2019-11-19 @533  	refcount = acpi_os_drop_map_ref(map);
7bbb890358b96c Rafael J. Wysocki   2011-02-08  534  	mutex_unlock(&acpi_ioremap_lock);
29718521237a1b Myron Stowe         2010-10-21  535  
833a426cc471b6 Francesco Ruggeri   2019-11-19  536  	if (!refcount)
b7c1fadd6c2eea Rafael J. Wysocki   2011-02-08 @537  		acpi_os_map_cleanup(map);
29718521237a1b Myron Stowe         2010-10-21  538  }
6f68c91c55ea35 Myron Stowe         2011-11-07  539  EXPORT_SYMBOL(acpi_os_unmap_generic_address);
29718521237a1b Myron Stowe         2010-10-21  540  

:::::: The code at line 533 was first introduced by commit
:::::: 833a426cc471b6088011b3d67f1dc4e147614647 ACPI: OSL: only free map once in osl.c

:::::: TO: Francesco Ruggeri <fruggeri@arista.com>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29883 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pm:acpica-osl 2/2] drivers/acpi/osl.c:533:13: error: implicit declaration of function 'acpi_os_drop_map_ref'
@ 2020-06-13 21:19 ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-06-13 21:19 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 8822 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git acpica-osl
head:   cfc2a23e4be42e58a453502acaf4a6330ef32f5f
commit: cfc2a23e4be42e58a453502acaf4a6330ef32f5f [2/2] ACPI: OSL: Add support for deferred unmapping of ACPI memory
config: i386-randconfig-s031-20200614 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-250-g42323db3-dirty
        git checkout cfc2a23e4be42e58a453502acaf4a6330ef32f5f
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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 >>, old ones prefixed by <<):

drivers/acpi/osl.c: In function 'acpi_os_vprintf':
drivers/acpi/osl.c:153:2: warning: function 'acpi_os_vprintf' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
153 |  vsprintf(buffer, fmt, args);
|  ^~~~~~~~
drivers/acpi/osl.c: In function 'acpi_os_unmap_generic_address':
>> drivers/acpi/osl.c:533:13: error: implicit declaration of function 'acpi_os_drop_map_ref' [-Werror=implicit-function-declaration]
533 |  refcount = acpi_os_drop_map_ref(map);
|             ^~~~~~~~~~~~~~~~~~~~
>> drivers/acpi/osl.c:537:3: error: implicit declaration of function 'acpi_os_map_cleanup'; did you mean 'acpi_os_map_memory'? [-Werror=implicit-function-declaration]
537 |   acpi_os_map_cleanup(map);
|   ^~~~~~~~~~~~~~~~~~~
|   acpi_os_map_memory
cc1: some warnings being treated as errors

sparse warnings: (new ones prefixed by >>)

   drivers/acpi/osl.c:375:17: sparse: sparse: cast removes address space '<asn:2>' of expression
>> drivers/acpi/osl.c:481:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] <asn:2> *virt @@     got void *virt @@
>> drivers/acpi/osl.c:481:29: sparse:     expected void [noderef] <asn:2> *virt
>> drivers/acpi/osl.c:481:29: sparse:     got void *virt
   drivers/acpi/osl.c:533:20: sparse: sparse: undefined identifier 'acpi_os_drop_map_ref'
   drivers/acpi/osl.c:537:17: sparse: sparse: undefined identifier 'acpi_os_map_cleanup'
   drivers/acpi/osl.c:757:1: sparse: sparse: context imbalance in 'acpi_os_read_memory' - wrong count at exit
   drivers/acpi/osl.c:790:1: sparse: sparse: context imbalance in 'acpi_os_write_memory' - wrong count at exit

vim +/acpi_os_drop_map_ref +533 drivers/acpi/osl.c

620242ae8c3d9c Myron Stowe         2010-10-21  466  
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  467  /**
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  468   * acpi_os_unmap_deferred - Drop a memory mapping reference.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  469   * @virt: Start of the address range to drop a reference to.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  470   * @size: Size of the address range to drop a reference to.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  471   *
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  472   * Look up the given virtual address range in the list of existing ACPI memory
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  473   * mappings, drop a reference to it and if there are no more active references
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  474   * to it, put it in the list of unused memory mappings.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  475   *
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  476   * During early init (when acpi_permanent_mmap has not been set yet) this
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  477   * routine behaves like acpi_os_unmap_memory().
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  478   */
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  479  void __ref acpi_os_unmap_deferred(void *virt, acpi_size size)
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  480  {
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13 @481  	acpi_os_unref_iomem(virt, size);
ad71860a17ba33 Alexey Starikovskiy 2007-02-02  482  }
a238317ce81855 Lv Zheng            2014-05-20  483  
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  484  /**
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  485   * acpi_os_release_unused_mappings - Release unused ACPI memory mappings.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  486   */
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  487  void acpi_os_release_unused_mappings(void)
a238317ce81855 Lv Zheng            2014-05-20  488  {
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  489  	__acpi_os_release_unused_mappings(false);
a238317ce81855 Lv Zheng            2014-05-20  490  }
^1da177e4c3f41 Linus Torvalds      2005-04-16  491  
6f68c91c55ea35 Myron Stowe         2011-11-07  492  int acpi_os_map_generic_address(struct acpi_generic_address *gas)
29718521237a1b Myron Stowe         2010-10-21  493  {
bc9ffce27962c0 Myron Stowe         2011-11-07  494  	u64 addr;
29718521237a1b Myron Stowe         2010-10-21  495  	void __iomem *virt;
29718521237a1b Myron Stowe         2010-10-21  496  
bc9ffce27962c0 Myron Stowe         2011-11-07  497  	if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
29718521237a1b Myron Stowe         2010-10-21  498  		return 0;
29718521237a1b Myron Stowe         2010-10-21  499  
bc9ffce27962c0 Myron Stowe         2011-11-07  500  	/* Handle possible alignment issues */
bc9ffce27962c0 Myron Stowe         2011-11-07  501  	memcpy(&addr, &gas->address, sizeof(addr));
bc9ffce27962c0 Myron Stowe         2011-11-07  502  	if (!addr || !gas->bit_width)
29718521237a1b Myron Stowe         2010-10-21  503  		return -EINVAL;
29718521237a1b Myron Stowe         2010-10-21  504  
a238317ce81855 Lv Zheng            2014-05-20  505  	virt = acpi_os_map_iomem(addr, gas->bit_width / 8);
29718521237a1b Myron Stowe         2010-10-21  506  	if (!virt)
29718521237a1b Myron Stowe         2010-10-21  507  		return -EIO;
29718521237a1b Myron Stowe         2010-10-21  508  
29718521237a1b Myron Stowe         2010-10-21  509  	return 0;
29718521237a1b Myron Stowe         2010-10-21  510  }
6f68c91c55ea35 Myron Stowe         2011-11-07  511  EXPORT_SYMBOL(acpi_os_map_generic_address);
29718521237a1b Myron Stowe         2010-10-21  512  
6f68c91c55ea35 Myron Stowe         2011-11-07  513  void acpi_os_unmap_generic_address(struct acpi_generic_address *gas)
29718521237a1b Myron Stowe         2010-10-21  514  {
bc9ffce27962c0 Myron Stowe         2011-11-07  515  	u64 addr;
7fe135dc058fae Rafael J. Wysocki   2011-02-08  516  	struct acpi_ioremap *map;
833a426cc471b6 Francesco Ruggeri   2019-11-19  517  	unsigned long refcount;
29718521237a1b Myron Stowe         2010-10-21  518  
bc9ffce27962c0 Myron Stowe         2011-11-07  519  	if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
29718521237a1b Myron Stowe         2010-10-21  520  		return;
29718521237a1b Myron Stowe         2010-10-21  521  
bc9ffce27962c0 Myron Stowe         2011-11-07  522  	/* Handle possible alignment issues */
bc9ffce27962c0 Myron Stowe         2011-11-07  523  	memcpy(&addr, &gas->address, sizeof(addr));
bc9ffce27962c0 Myron Stowe         2011-11-07  524  	if (!addr || !gas->bit_width)
29718521237a1b Myron Stowe         2010-10-21  525  		return;
29718521237a1b Myron Stowe         2010-10-21  526  
7bbb890358b96c Rafael J. Wysocki   2011-02-08  527  	mutex_lock(&acpi_ioremap_lock);
bc9ffce27962c0 Myron Stowe         2011-11-07  528  	map = acpi_map_lookup(addr, gas->bit_width / 8);
7fe135dc058fae Rafael J. Wysocki   2011-02-08  529  	if (!map) {
7fe135dc058fae Rafael J. Wysocki   2011-02-08  530  		mutex_unlock(&acpi_ioremap_lock);
7fe135dc058fae Rafael J. Wysocki   2011-02-08  531  		return;
7fe135dc058fae Rafael J. Wysocki   2011-02-08  532  	}
833a426cc471b6 Francesco Ruggeri   2019-11-19 @533  	refcount = acpi_os_drop_map_ref(map);
7bbb890358b96c Rafael J. Wysocki   2011-02-08  534  	mutex_unlock(&acpi_ioremap_lock);
29718521237a1b Myron Stowe         2010-10-21  535  
833a426cc471b6 Francesco Ruggeri   2019-11-19  536  	if (!refcount)
b7c1fadd6c2eea Rafael J. Wysocki   2011-02-08 @537  		acpi_os_map_cleanup(map);
29718521237a1b Myron Stowe         2010-10-21  538  }
6f68c91c55ea35 Myron Stowe         2011-11-07  539  EXPORT_SYMBOL(acpi_os_unmap_generic_address);
29718521237a1b Myron Stowe         2010-10-21  540  

:::::: The code at line 533 was first introduced by commit
:::::: 833a426cc471b6088011b3d67f1dc4e147614647 ACPI: OSL: only free map once in osl.c

:::::: TO: Francesco Ruggeri <fruggeri@arista.com>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29883 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Devel] [pm:acpica-osl 2/2] drivers/acpi/osl.c:533:13: error: implicit declaration of function 'acpi_os_drop_map_ref'
@ 2020-06-13 21:19 ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-06-13 21:19 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 8828 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git acpica-osl
head:   cfc2a23e4be42e58a453502acaf4a6330ef32f5f
commit: cfc2a23e4be42e58a453502acaf4a6330ef32f5f [2/2] ACPI: OSL: Add support for deferred unmapping of ACPI memory
config: i386-randconfig-s031-20200614 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-250-g42323db3-dirty
        git checkout cfc2a23e4be42e58a453502acaf4a6330ef32f5f
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

drivers/acpi/osl.c: In function 'acpi_os_vprintf':
drivers/acpi/osl.c:153:2: warning: function 'acpi_os_vprintf' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
153 |  vsprintf(buffer, fmt, args);
|  ^~~~~~~~
drivers/acpi/osl.c: In function 'acpi_os_unmap_generic_address':
>> drivers/acpi/osl.c:533:13: error: implicit declaration of function 'acpi_os_drop_map_ref' [-Werror=implicit-function-declaration]
533 |  refcount = acpi_os_drop_map_ref(map);
|             ^~~~~~~~~~~~~~~~~~~~
>> drivers/acpi/osl.c:537:3: error: implicit declaration of function 'acpi_os_map_cleanup'; did you mean 'acpi_os_map_memory'? [-Werror=implicit-function-declaration]
537 |   acpi_os_map_cleanup(map);
|   ^~~~~~~~~~~~~~~~~~~
|   acpi_os_map_memory
cc1: some warnings being treated as errors

sparse warnings: (new ones prefixed by >>)

   drivers/acpi/osl.c:375:17: sparse: sparse: cast removes address space '<asn:2>' of expression
>> drivers/acpi/osl.c:481:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] <asn:2> *virt @@     got void *virt @@
>> drivers/acpi/osl.c:481:29: sparse:     expected void [noderef] <asn:2> *virt
>> drivers/acpi/osl.c:481:29: sparse:     got void *virt
   drivers/acpi/osl.c:533:20: sparse: sparse: undefined identifier 'acpi_os_drop_map_ref'
   drivers/acpi/osl.c:537:17: sparse: sparse: undefined identifier 'acpi_os_map_cleanup'
   drivers/acpi/osl.c:757:1: sparse: sparse: context imbalance in 'acpi_os_read_memory' - wrong count at exit
   drivers/acpi/osl.c:790:1: sparse: sparse: context imbalance in 'acpi_os_write_memory' - wrong count at exit

vim +/acpi_os_drop_map_ref +533 drivers/acpi/osl.c

620242ae8c3d9c Myron Stowe         2010-10-21  466  
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  467  /**
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  468   * acpi_os_unmap_deferred - Drop a memory mapping reference.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  469   * @virt: Start of the address range to drop a reference to.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  470   * @size: Size of the address range to drop a reference to.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  471   *
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  472   * Look up the given virtual address range in the list of existing ACPI memory
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  473   * mappings, drop a reference to it and if there are no more active references
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  474   * to it, put it in the list of unused memory mappings.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  475   *
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  476   * During early init (when acpi_permanent_mmap has not been set yet) this
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  477   * routine behaves like acpi_os_unmap_memory().
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  478   */
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  479  void __ref acpi_os_unmap_deferred(void *virt, acpi_size size)
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  480  {
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13 @481  	acpi_os_unref_iomem(virt, size);
ad71860a17ba33 Alexey Starikovskiy 2007-02-02  482  }
a238317ce81855 Lv Zheng            2014-05-20  483  
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  484  /**
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  485   * acpi_os_release_unused_mappings - Release unused ACPI memory mappings.
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  486   */
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  487  void acpi_os_release_unused_mappings(void)
a238317ce81855 Lv Zheng            2014-05-20  488  {
cfc2a23e4be42e Rafael J. Wysocki   2020-06-13  489  	__acpi_os_release_unused_mappings(false);
a238317ce81855 Lv Zheng            2014-05-20  490  }
^1da177e4c3f41 Linus Torvalds      2005-04-16  491  
6f68c91c55ea35 Myron Stowe         2011-11-07  492  int acpi_os_map_generic_address(struct acpi_generic_address *gas)
29718521237a1b Myron Stowe         2010-10-21  493  {
bc9ffce27962c0 Myron Stowe         2011-11-07  494  	u64 addr;
29718521237a1b Myron Stowe         2010-10-21  495  	void __iomem *virt;
29718521237a1b Myron Stowe         2010-10-21  496  
bc9ffce27962c0 Myron Stowe         2011-11-07  497  	if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
29718521237a1b Myron Stowe         2010-10-21  498  		return 0;
29718521237a1b Myron Stowe         2010-10-21  499  
bc9ffce27962c0 Myron Stowe         2011-11-07  500  	/* Handle possible alignment issues */
bc9ffce27962c0 Myron Stowe         2011-11-07  501  	memcpy(&addr, &gas->address, sizeof(addr));
bc9ffce27962c0 Myron Stowe         2011-11-07  502  	if (!addr || !gas->bit_width)
29718521237a1b Myron Stowe         2010-10-21  503  		return -EINVAL;
29718521237a1b Myron Stowe         2010-10-21  504  
a238317ce81855 Lv Zheng            2014-05-20  505  	virt = acpi_os_map_iomem(addr, gas->bit_width / 8);
29718521237a1b Myron Stowe         2010-10-21  506  	if (!virt)
29718521237a1b Myron Stowe         2010-10-21  507  		return -EIO;
29718521237a1b Myron Stowe         2010-10-21  508  
29718521237a1b Myron Stowe         2010-10-21  509  	return 0;
29718521237a1b Myron Stowe         2010-10-21  510  }
6f68c91c55ea35 Myron Stowe         2011-11-07  511  EXPORT_SYMBOL(acpi_os_map_generic_address);
29718521237a1b Myron Stowe         2010-10-21  512  
6f68c91c55ea35 Myron Stowe         2011-11-07  513  void acpi_os_unmap_generic_address(struct acpi_generic_address *gas)
29718521237a1b Myron Stowe         2010-10-21  514  {
bc9ffce27962c0 Myron Stowe         2011-11-07  515  	u64 addr;
7fe135dc058fae Rafael J. Wysocki   2011-02-08  516  	struct acpi_ioremap *map;
833a426cc471b6 Francesco Ruggeri   2019-11-19  517  	unsigned long refcount;
29718521237a1b Myron Stowe         2010-10-21  518  
bc9ffce27962c0 Myron Stowe         2011-11-07  519  	if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
29718521237a1b Myron Stowe         2010-10-21  520  		return;
29718521237a1b Myron Stowe         2010-10-21  521  
bc9ffce27962c0 Myron Stowe         2011-11-07  522  	/* Handle possible alignment issues */
bc9ffce27962c0 Myron Stowe         2011-11-07  523  	memcpy(&addr, &gas->address, sizeof(addr));
bc9ffce27962c0 Myron Stowe         2011-11-07  524  	if (!addr || !gas->bit_width)
29718521237a1b Myron Stowe         2010-10-21  525  		return;
29718521237a1b Myron Stowe         2010-10-21  526  
7bbb890358b96c Rafael J. Wysocki   2011-02-08  527  	mutex_lock(&acpi_ioremap_lock);
bc9ffce27962c0 Myron Stowe         2011-11-07  528  	map = acpi_map_lookup(addr, gas->bit_width / 8);
7fe135dc058fae Rafael J. Wysocki   2011-02-08  529  	if (!map) {
7fe135dc058fae Rafael J. Wysocki   2011-02-08  530  		mutex_unlock(&acpi_ioremap_lock);
7fe135dc058fae Rafael J. Wysocki   2011-02-08  531  		return;
7fe135dc058fae Rafael J. Wysocki   2011-02-08  532  	}
833a426cc471b6 Francesco Ruggeri   2019-11-19 @533  	refcount = acpi_os_drop_map_ref(map);
7bbb890358b96c Rafael J. Wysocki   2011-02-08  534  	mutex_unlock(&acpi_ioremap_lock);
29718521237a1b Myron Stowe         2010-10-21  535  
833a426cc471b6 Francesco Ruggeri   2019-11-19  536  	if (!refcount)
b7c1fadd6c2eea Rafael J. Wysocki   2011-02-08 @537  		acpi_os_map_cleanup(map);
29718521237a1b Myron Stowe         2010-10-21  538  }
6f68c91c55ea35 Myron Stowe         2011-11-07  539  EXPORT_SYMBOL(acpi_os_unmap_generic_address);
29718521237a1b Myron Stowe         2010-10-21  540  

:::::: The code at line 533 was first introduced by commit
:::::: 833a426cc471b6088011b3d67f1dc4e147614647 ACPI: OSL: only free map once in osl.c

:::::: TO: Francesco Ruggeri <fruggeri(a)arista.com>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29883 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pm:acpica-osl 2/2] drivers/acpi/osl.c:533:13: error: implicit declaration of function 'acpi_os_drop_map_ref'
@ 2020-06-13 23:06 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-06-13 23:06 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5386 bytes --]

CC: kbuild-all(a)lists.01.org
CC: clang-built-linux(a)googlegroups.com
CC: linux-acpi(a)vger.kernel.org
CC: devel(a)acpica.org
CC: linux-pm(a)vger.kernel.org
TO: "Rafael J. Wysocki" <rjw@rjwysocki.net>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git acpica-osl
head:   cfc2a23e4be42e58a453502acaf4a6330ef32f5f
commit: cfc2a23e4be42e58a453502acaf4a6330ef32f5f [2/2] ACPI: OSL: Add support for deferred unmapping of ACPI memory
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project c669a1ed6386d57a75a602b53266466dae1e1d84)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git checkout cfc2a23e4be42e58a453502acaf4a6330ef32f5f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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 >>, old ones prefixed by <<):

>> drivers/acpi/osl.c:533:13: error: implicit declaration of function 'acpi_os_drop_map_ref' [-Werror,-Wimplicit-function-declaration]
refcount = acpi_os_drop_map_ref(map);
^
>> drivers/acpi/osl.c:537:3: error: implicit declaration of function 'acpi_os_map_cleanup' [-Werror,-Wimplicit-function-declaration]
acpi_os_map_cleanup(map);
^
drivers/acpi/osl.c:537:3: note: did you mean 'acpi_os_map_memory'?
drivers/acpi/osl.c:377:19: note: 'acpi_os_map_memory' declared here
EXPORT_SYMBOL_GPL(acpi_os_map_memory);
^
include/linux/export.h:159:48: note: expanded from macro 'EXPORT_SYMBOL_GPL'
#define EXPORT_SYMBOL_GPL(sym)          _EXPORT_SYMBOL(sym, "_gpl")
^
include/linux/export.h:155:50: note: expanded from macro '_EXPORT_SYMBOL'
#define _EXPORT_SYMBOL(sym, sec)        __EXPORT_SYMBOL(sym, sec, "")
^
include/linux/export.h:147:56: note: expanded from macro '__EXPORT_SYMBOL'
#define __EXPORT_SYMBOL(sym, sec, ns)   ___EXPORT_SYMBOL(sym, sec, ns)
^
include/linux/export.h:98:21: note: expanded from macro '___EXPORT_SYMBOL'
extern typeof(sym) sym;                                                                               ^
2 errors generated.

# https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?id=cfc2a23e4be42e58a453502acaf4a6330ef32f5f
git remote add pm https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
git remote update pm
git checkout cfc2a23e4be42e58a453502acaf4a6330ef32f5f
vim +/acpi_os_drop_map_ref +533 drivers/acpi/osl.c

29718521237a1b Myron Stowe       2010-10-21  512  
6f68c91c55ea35 Myron Stowe       2011-11-07  513  void acpi_os_unmap_generic_address(struct acpi_generic_address *gas)
29718521237a1b Myron Stowe       2010-10-21  514  {
bc9ffce27962c0 Myron Stowe       2011-11-07  515  	u64 addr;
7fe135dc058fae Rafael J. Wysocki 2011-02-08  516  	struct acpi_ioremap *map;
833a426cc471b6 Francesco Ruggeri 2019-11-19  517  	unsigned long refcount;
29718521237a1b Myron Stowe       2010-10-21  518  
bc9ffce27962c0 Myron Stowe       2011-11-07  519  	if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
29718521237a1b Myron Stowe       2010-10-21  520  		return;
29718521237a1b Myron Stowe       2010-10-21  521  
bc9ffce27962c0 Myron Stowe       2011-11-07  522  	/* Handle possible alignment issues */
bc9ffce27962c0 Myron Stowe       2011-11-07  523  	memcpy(&addr, &gas->address, sizeof(addr));
bc9ffce27962c0 Myron Stowe       2011-11-07  524  	if (!addr || !gas->bit_width)
29718521237a1b Myron Stowe       2010-10-21  525  		return;
29718521237a1b Myron Stowe       2010-10-21  526  
7bbb890358b96c Rafael J. Wysocki 2011-02-08  527  	mutex_lock(&acpi_ioremap_lock);
bc9ffce27962c0 Myron Stowe       2011-11-07  528  	map = acpi_map_lookup(addr, gas->bit_width / 8);
7fe135dc058fae Rafael J. Wysocki 2011-02-08  529  	if (!map) {
7fe135dc058fae Rafael J. Wysocki 2011-02-08  530  		mutex_unlock(&acpi_ioremap_lock);
7fe135dc058fae Rafael J. Wysocki 2011-02-08  531  		return;
7fe135dc058fae Rafael J. Wysocki 2011-02-08  532  	}
833a426cc471b6 Francesco Ruggeri 2019-11-19 @533  	refcount = acpi_os_drop_map_ref(map);
7bbb890358b96c Rafael J. Wysocki 2011-02-08  534  	mutex_unlock(&acpi_ioremap_lock);
29718521237a1b Myron Stowe       2010-10-21  535  
833a426cc471b6 Francesco Ruggeri 2019-11-19  536  	if (!refcount)
b7c1fadd6c2eea Rafael J. Wysocki 2011-02-08 @537  		acpi_os_map_cleanup(map);
29718521237a1b Myron Stowe       2010-10-21  538  }
6f68c91c55ea35 Myron Stowe       2011-11-07  539  EXPORT_SYMBOL(acpi_os_unmap_generic_address);
29718521237a1b Myron Stowe       2010-10-21  540  

:::::: The code at line 533 was first introduced by commit
:::::: 833a426cc471b6088011b3d67f1dc4e147614647 ACPI: OSL: only free map once in osl.c

:::::: TO: Francesco Ruggeri <fruggeri@arista.com>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 73695 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-13 23:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-13 21:19 [pm:acpica-osl 2/2] drivers/acpi/osl.c:533:13: error: implicit declaration of function 'acpi_os_drop_map_ref' kernel test robot
2020-06-13 21:19 ` [Devel] " kernel test robot
2020-06-13 21:19 ` kernel test robot
2020-06-13 23:06 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.