All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: drivers/acpi/x86/s2idle.c:395:13: sparse: sparse: restricted suspend_state_t degrades to integer
Date: Thu, 24 Dec 2020 01:07:16 +0800	[thread overview]
Message-ID: <202012240115.Q2iRfRWw-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   614cb5894306cfa2c7d9b6168182876ff5948735
commit: fef98671194be005853cbbf51b164a3927589b64 ACPI: PM: s2idle: Move x86-specific code to the x86 directory
date:   6 days ago
config: i386-randconfig-s001-20201221 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-184-g1b896707-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fef98671194be005853cbbf51b164a3927589b64
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout fef98671194be005853cbbf51b164a3927589b64
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/acpi/x86/s2idle.c:395:13: sparse: sparse: restricted suspend_state_t degrades to integer
   drivers/acpi/x86/s2idle.c:395:33: sparse: sparse: restricted suspend_state_t degrades to integer

vim +395 drivers/acpi/x86/s2idle.c

   348	
   349	static int lps0_device_attach(struct acpi_device *adev,
   350				      const struct acpi_device_id *not_used)
   351	{
   352		union acpi_object *out_obj;
   353	
   354		if (lps0_device_handle)
   355			return 0;
   356	
   357		if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
   358			return 0;
   359	
   360		if (acpi_s2idle_vendor_amd()) {
   361			guid_parse(ACPI_LPS0_DSM_UUID_AMD, &lps0_dsm_guid);
   362			out_obj = acpi_evaluate_dsm(adev->handle, &lps0_dsm_guid, 0, 0, NULL);
   363			rev_id = 0;
   364		} else {
   365			guid_parse(ACPI_LPS0_DSM_UUID, &lps0_dsm_guid);
   366			out_obj = acpi_evaluate_dsm(adev->handle, &lps0_dsm_guid, 1, 0, NULL);
   367			rev_id = 1;
   368		}
   369	
   370		/* Check if the _DSM is present and as expected. */
   371		if (!out_obj || out_obj->type != ACPI_TYPE_BUFFER) {
   372			acpi_handle_debug(adev->handle,
   373					  "_DSM function 0 evaluation failed\n");
   374			return 0;
   375		}
   376	
   377		lps0_dsm_func_mask = *(char *)out_obj->buffer.pointer;
   378	
   379		ACPI_FREE(out_obj);
   380	
   381		acpi_handle_debug(adev->handle, "_DSM function mask: 0x%x\n",
   382				  lps0_dsm_func_mask);
   383	
   384		lps0_device_handle = adev->handle;
   385	
   386		if (acpi_s2idle_vendor_amd())
   387			lpi_device_get_constraints_amd();
   388		else
   389			lpi_device_get_constraints();
   390	
   391		/*
   392		 * Use suspend-to-idle by default if the default suspend mode was not
   393		 * set from the command line.
   394		 */
 > 395		if (mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3)
   396			mem_sleep_current = PM_SUSPEND_TO_IDLE;
   397	
   398		/*
   399		 * Some LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U, require the
   400		 * EC GPE to be enabled while suspended for certain wakeup devices to
   401		 * work, so mark it as wakeup-capable.
   402		 */
   403		acpi_ec_mark_gpe_for_wake();
   404	
   405		return 0;
   406	}
   407	

---
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: 35562 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: drivers/acpi/x86/s2idle.c:395:13: sparse: sparse: restricted suspend_state_t degrades to integer
Date: Thu, 24 Dec 2020 01:07:16 +0800	[thread overview]
Message-ID: <202012240115.Q2iRfRWw-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   614cb5894306cfa2c7d9b6168182876ff5948735
commit: fef98671194be005853cbbf51b164a3927589b64 ACPI: PM: s2idle: Move x86-specific code to the x86 directory
date:   6 days ago
config: i386-randconfig-s001-20201221 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-184-g1b896707-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fef98671194be005853cbbf51b164a3927589b64
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout fef98671194be005853cbbf51b164a3927589b64
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/acpi/x86/s2idle.c:395:13: sparse: sparse: restricted suspend_state_t degrades to integer
   drivers/acpi/x86/s2idle.c:395:33: sparse: sparse: restricted suspend_state_t degrades to integer

vim +395 drivers/acpi/x86/s2idle.c

   348	
   349	static int lps0_device_attach(struct acpi_device *adev,
   350				      const struct acpi_device_id *not_used)
   351	{
   352		union acpi_object *out_obj;
   353	
   354		if (lps0_device_handle)
   355			return 0;
   356	
   357		if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
   358			return 0;
   359	
   360		if (acpi_s2idle_vendor_amd()) {
   361			guid_parse(ACPI_LPS0_DSM_UUID_AMD, &lps0_dsm_guid);
   362			out_obj = acpi_evaluate_dsm(adev->handle, &lps0_dsm_guid, 0, 0, NULL);
   363			rev_id = 0;
   364		} else {
   365			guid_parse(ACPI_LPS0_DSM_UUID, &lps0_dsm_guid);
   366			out_obj = acpi_evaluate_dsm(adev->handle, &lps0_dsm_guid, 1, 0, NULL);
   367			rev_id = 1;
   368		}
   369	
   370		/* Check if the _DSM is present and as expected. */
   371		if (!out_obj || out_obj->type != ACPI_TYPE_BUFFER) {
   372			acpi_handle_debug(adev->handle,
   373					  "_DSM function 0 evaluation failed\n");
   374			return 0;
   375		}
   376	
   377		lps0_dsm_func_mask = *(char *)out_obj->buffer.pointer;
   378	
   379		ACPI_FREE(out_obj);
   380	
   381		acpi_handle_debug(adev->handle, "_DSM function mask: 0x%x\n",
   382				  lps0_dsm_func_mask);
   383	
   384		lps0_device_handle = adev->handle;
   385	
   386		if (acpi_s2idle_vendor_amd())
   387			lpi_device_get_constraints_amd();
   388		else
   389			lpi_device_get_constraints();
   390	
   391		/*
   392		 * Use suspend-to-idle by default if the default suspend mode was not
   393		 * set from the command line.
   394		 */
 > 395		if (mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3)
   396			mem_sleep_current = PM_SUSPEND_TO_IDLE;
   397	
   398		/*
   399		 * Some LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U, require the
   400		 * EC GPE to be enabled while suspended for certain wakeup devices to
   401		 * work, so mark it as wakeup-capable.
   402		 */
   403		acpi_ec_mark_gpe_for_wake();
   404	
   405		return 0;
   406	}
   407	

---
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: 35562 bytes --]

             reply	other threads:[~2020-12-23 17:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 17:07 kernel test robot [this message]
2020-12-23 17:07 ` drivers/acpi/x86/s2idle.c:395:13: sparse: sparse: restricted suspend_state_t degrades to integer kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-04-24 13:59 kernel test robot
2022-04-23  3:13 kernel test robot
2022-04-22 10:16 kernel test robot
2022-04-21  6:45 kernel test robot
2020-12-23 11:29 kernel test robot
2020-12-23 11:29 ` kernel test robot
2020-12-23 10:23 kernel test robot
2020-12-23 10:23 ` kernel test robot
2020-12-23  6:12 kernel test robot
2020-12-23  6:12 ` kernel test robot

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=202012240115.Q2iRfRWw-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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.