ec/google/chromeec: Fix ACPI FWTS error

Fix the following FWTS error:
FAILED [MEDIUM] AMLAsmASL_MSG_RETURN_TYPES: Test 1, Assembler warning in line
3038
Line | AML source
--------------------------------------------------------------------------------
03035|                 Return (One)
03036|             }
03037|
03038|             Method (_Q09, 0, NotSerialized)  // _Qxx: EC Query
     |                       ^
     | Warning 3115: Not all control paths return a value    (_Q09)
03039|             {
03040|                 If (Acquire (PATM, 0x03E8))
03041|                 {
================================================================================

ADVICE: (for Warning #3115, ASL_MSG_RETURN_TYPES): Some of the execution paths
do not return a value. All control paths that return must return a value
otherwise unexpected behaviour may occur. This error occurs because a branch on
an conditional op-code returns a value and another does not, which is
inconsistent behaviour.

_Q09 is a reserved method and can't return a value. Change the logic
so that no return is used and avoid this test error.

BUG=b:112476331
TEST=Run FWTS.

Change-Id: Ibbda1649ec2eb9cdf9966d4ec92bfd203bb78d07
Signed-off-by: Marc Jones <marcj303@gmail.com>
Reviewed-on: https://review.coreboot.org/28123
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
Marc Jones 2018-08-15 22:53:34 -06:00 committed by Martin Roth
parent 4ae02818fc
commit e17ec3e2e8
1 changed files with 12 additions and 14 deletions

View File

@ -467,10 +467,7 @@ Device (EC0)
*/ */
Method (_Q09, 0, NotSerialized) Method (_Q09, 0, NotSerialized)
{ {
If (Acquire (^PATM, 1000)) { If (LNot(Acquire (^PATM, 1000))) {
Return ()
}
/* Read sensor ID for event */ /* Read sensor ID for event */
Store (^PATI, Local0) Store (^PATI, Local0)
@ -487,6 +484,7 @@ Device (EC0)
Release (^PATM) Release (^PATM)
} }
}
/* /*
* Set Charger Current Limit * Set Charger Current Limit