diff options
author | Tom Hughes <tomhughes@chromium.org> | 2021-10-21 21:55:29 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-05 21:14:51 +0000 |
commit | e1d5982202bebb794d8bd28833efb0b31642744f (patch) | |
tree | b75f1c22afec335e4dda78b67262ae00389a0965 /board/collis | |
parent | d7bf7add1329caf0cbd9c116a54ccb62ea329cb6 (diff) | |
download | chrome-ec-e1d5982202bebb794d8bd28833efb0b31642744f.tar.gz |
tree: Work around clang bug
clang warns:
error: initializer element is not a compile-time constant
There is an upstream LLVM review with proposed fix:
https://reviews.llvm.org/D76096.
In the meantime, we will work around it.
BRANCH=none
BUG=b:172020503, b:202062363
TEST=./util/compare_builds.sh -b all -j 120
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I066e082870bcd726555a5f2461f09988d4e6ce55
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3237042
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/collis')
-rw-r--r-- | board/collis/board.c | 64 |
1 files changed, 37 insertions, 27 deletions
diff --git a/board/collis/board.c b/board/collis/board.c index 42a0f1469a..3076c2692f 100644 --- a/board/collis/board.c +++ b/board/collis/board.c @@ -176,17 +176,22 @@ BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); * 130 C. However, sensor is located next to DDR, so we need to use the lower * DDR temperature limit (85 C) */ -const static struct ec_thermal_config thermal_cpu = { - .temp_host = { - [EC_TEMP_THRESH_HIGH] = C_TO_K(70), - [EC_TEMP_THRESH_HALT] = C_TO_K(80), - }, - .temp_host_release = { - [EC_TEMP_THRESH_HIGH] = C_TO_K(65), - }, - .temp_fan_off = C_TO_K(35), - .temp_fan_max = C_TO_K(50), -}; +/* + * TODO(b/202062363): Remove when clang is fixed. + */ +#define THERMAL_CPU \ + { \ + .temp_host = { \ + [EC_TEMP_THRESH_HIGH] = C_TO_K(70), \ + [EC_TEMP_THRESH_HALT] = C_TO_K(80), \ + }, \ + .temp_host_release = { \ + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), \ + }, \ + .temp_fan_off = C_TO_K(35), \ + .temp_fan_max = C_TO_K(50), \ + } +__maybe_unused static const struct ec_thermal_config thermal_cpu = THERMAL_CPU; /* * Inductor limits - used for both charger and PP3300 regulator @@ -199,24 +204,29 @@ const static struct ec_thermal_config thermal_cpu = { * Inductors: limit of 125c * PCB: limit is 80c */ -const static struct ec_thermal_config thermal_inductor = { - .temp_host = { - [EC_TEMP_THRESH_HIGH] = C_TO_K(75), - [EC_TEMP_THRESH_HALT] = C_TO_K(80), - }, - .temp_host_release = { - [EC_TEMP_THRESH_HIGH] = C_TO_K(65), - }, - .temp_fan_off = C_TO_K(40), - .temp_fan_max = C_TO_K(55), -}; - +/* + * TODO(b/202062363): Remove when clang is fixed. + */ +#define THERMAL_INDUCTOR \ + { \ + .temp_host = { \ + [EC_TEMP_THRESH_HIGH] = C_TO_K(75), \ + [EC_TEMP_THRESH_HALT] = C_TO_K(80), \ + }, \ + .temp_host_release = { \ + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), \ + }, \ + .temp_fan_off = C_TO_K(40), \ + .temp_fan_max = C_TO_K(55), \ + } +__maybe_unused static const struct ec_thermal_config thermal_inductor = + THERMAL_INDUCTOR; struct ec_thermal_config thermal_params[] = { - [TEMP_SENSOR_1_CHARGER] = thermal_inductor, - [TEMP_SENSOR_2_PP3300_REGULATOR] = thermal_inductor, - [TEMP_SENSOR_3_DDR_SOC] = thermal_cpu, - [TEMP_SENSOR_4_FAN] = thermal_cpu, + [TEMP_SENSOR_1_CHARGER] = THERMAL_INDUCTOR, + [TEMP_SENSOR_2_PP3300_REGULATOR] = THERMAL_INDUCTOR, + [TEMP_SENSOR_3_DDR_SOC] = THERMAL_CPU, + [TEMP_SENSOR_4_FAN] = THERMAL_CPU, }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); |