All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: james.liu@hpe.com, rafael@kernel.org, lenb@kernel.org
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-acpi@vger.kernel.org, James Liu <james.liu@hpe.com>
Subject: Re: [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS
Date: Sat, 6 Nov 2021 01:43:41 +0800	[thread overview]
Message-ID: <202111060108.UnuKGY12-lkp@intel.com> (raw)
In-Reply-To: <20211022011833.24308-1-james.liu@hpe.com>

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

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@intel.com>

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@lists.01.org

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS
Date: Sat, 06 Nov 2021 01:43:41 +0800	[thread overview]
Message-ID: <202111060108.UnuKGY12-lkp@intel.com> (raw)
In-Reply-To: <20211022011833.24308-1-james.liu@hpe.com>

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

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@intel.com>

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(a)lists.01.org

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

  parent reply	other threads:[~2021-11-05 17:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  1:18 [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS james.liu
2021-10-22 14:55 ` Rafael J. Wysocki
2021-11-03  6:39   ` James Liu
2021-10-29  6:16 ` [ACPI] f0340367a7: WARNING:at_arch/x86/mm/ioremap.c:#__ioremap_caller kernel test robot
2021-11-05 17:43 ` kernel test robot [this message]
2021-11-05 17:43   ` [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-11-08 17:36 kernel test robot
2021-11-09  9:41 ` Dan Carpenter
2021-11-09  9:41 ` Dan Carpenter

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=202111060108.UnuKGY12-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=james.liu@hpe.com \
    --cc=kbuild-all@lists.01.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=rafael@kernel.org \
    /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 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.