Re: [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS

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

 



Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on v5.15 next-20211105]
[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/james-liu-hpe-com/ACPI-OSL-Handle-the-return-value-of-acpi_os_map_generic_address-for-a-non-register-GAS/20211022-091959
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-randconfig-r026-20211024 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 05c21f54a454ebfa44be7825707e6061dc32afab)
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
        # https://github.com/0day-ci/linux/commit/f0340367a7885a3491d7b7c49f4c9bfc53e0b1dd
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review james-liu-hpe-com/ACPI-OSL-Handle-the-return-value-of-acpi_os_map_generic_address-for-a-non-register-GAS/20211022-091959
        git checkout f0340367a7885a3491d7b7c49f4c9bfc53e0b1dd
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 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/acpi/osl.c:467:29: warning: variable 'addr' is uninitialized when used here [-Wuninitialized]
                   return  acpi_os_map_iomem(addr, sizeof(unsigned long long));
                                             ^~~~
   drivers/acpi/osl.c:455:10: note: initialize the variable 'addr' to silence this warning
           u64 addr;
                   ^
                    = 0
   1 warning generated.


vim +/addr +467 drivers/acpi/osl.c

   452	
   453	void __iomem *acpi_os_map_generic_address(struct acpi_generic_address *gas)
   454	{
   455		u64 addr;
   456	
   457		if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
   458			return NULL;
   459		/* Handle a non-register GAS (i.e., a pointer to a data structure),
   460		 * whose bit width is expected to be 0 according to ACPI spec. 6.4.
   461		 * For example, The RegisterRegion field in SET_ERROR_TYPE_WITH_ADDRESS
   462		 * points to a data structure whose format is defined in Table 18.30 in
   463		 * ACPI Spec. 6.4
   464		 */
   465		if (!gas->bit_width) {
   466			pr_info("Mapping IOMEM for a non-register GAS.\n");
 > 467			return  acpi_os_map_iomem(addr, sizeof(unsigned long long));
   468		}
   469	
   470		/* Handle possible alignment issues */
   471		memcpy(&addr, &gas->address, sizeof(addr));
   472		if (!addr)
   473			return NULL;
   474		else
   475			return acpi_os_map_iomem(addr, gas->bit_width / 8);
   476	}
   477	EXPORT_SYMBOL(acpi_os_map_generic_address);
   478	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux