Attention is currently required from: Nico Huber, Alexander Couzens. Hello Nico Huber,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/52675
to review the following change.
Change subject: ec/lenovo/h8/h8.c: Skip setting volume if out of range ......................................................................
ec/lenovo/h8/h8.c: Skip setting volume if out of range
This change is needed to update the option API to use unsigned integers. The CMOS option system does not support negative numbers.
The volume field is only 8 bits long. Do not set the volume if it is out of range. Also, use an out-of-range value as fallback to skip setting the volume when it cannot be read using the option API, to preserve the current behavior.
Change-Id: I7af68bb5c1ecd4489ab4b826b9a5e7999c77b1ff Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/ec/lenovo/h8/h8.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/52675/1
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c index be2eee6..e17f0fb 100644 --- a/src/ec/lenovo/h8/h8.c +++ b/src/ec/lenovo/h8/h8.c @@ -299,8 +299,8 @@ h8_trackpoint_enable(1); h8_usb_power_enable(1);
- int volume = get_int_option("volume", -1); - if (volume >= 0 && !acpi_is_wakeup_s3()) + unsigned int volume = get_int_option("volume", ~0); + if (volume <= 0xff && !acpi_is_wakeup_s3()) ec_write(H8_VOLUME_CONTROL, volume);
val = (CONFIG(H8_SUPPORT_BT_ON_WIFI) || h8_has_bdc(dev)) &&