diff options
author | Evan Green <evgreen@chromium.org> | 2019-10-01 13:39:24 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-05 00:47:56 +0000 |
commit | 1d82a0592eedcfdaf666111a4ff8e6a9665fa014 (patch) | |
tree | 02d30616c04b4e945647dacfb6d254223a593a9f /board/zinger | |
parent | 3247d52abeb0ccacc49f0d18dadf47c77f8f0177 (diff) | |
download | chrome-ec-1d82a0592eedcfdaf666111a4ff8e6a9665fa014.tar.gz |
include: De-longify BIT() macro
The BIT() macro was recently introduced to make things more
comfortable to upstream Linux. However, there's no need for it to
be a long.
Change the macro back to being an int (int and long are the same on
32-bit platforms, which all of our ECs are), so that we can reduce
the number of %l specifiers. The semantics of %l have changed, we
are deprecating its use on master to reduce the risk that we
accidentally cherry-pick one of those printfs to an old firmware
branch.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=None
Change-Id: I95b9cd49895cc67998dcb1de9bab5b5591d93243
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1834601
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: caveh jalali <caveh@chromium.org>
Diffstat (limited to 'board/zinger')
-rw-r--r-- | board/zinger/usb_pd_policy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/board/zinger/usb_pd_policy.c b/board/zinger/usb_pd_policy.c index c18c6073b9..52a87c285b 100644 --- a/board/zinger/usb_pd_policy.c +++ b/board/zinger/usb_pd_policy.c @@ -344,7 +344,7 @@ int pd_board_checks(void) break; /* trigger the slow OCP iff all 4 samples are above the max */ if (count == 3) { - debug_printf("OCP %ld mA\n", + debug_printf("OCP %d mA\n", vbus_amp * VDDA_MV / CURR_GAIN * 1000 / R_SENSE / ADC_SCALE); pd_log_event(PD_EVENT_PS_FAULT, 0, PS_FAULT_OCP, NULL); @@ -375,7 +375,7 @@ int pd_board_checks(void) if ((output_is_enabled() && (vbus_volt > voltages[ovp_idx].ovp)) || (fault && (vbus_volt > voltages[ovp_idx].ovp_rec))) { if (!fault) { - debug_printf("OVP %ld mV\n", + debug_printf("OVP %d mV\n", ADC_TO_VOLT_MV(vbus_volt)); pd_log_event(PD_EVENT_PS_FAULT, 0, PS_FAULT_OVP, NULL); } @@ -395,7 +395,7 @@ int pd_board_checks(void) discharge_disable(); /* enable over-current monitoring */ adc_enable_watchdog(ADC_CH_A_SENSE, MAX_CURRENT_FAST, 0); - debug_printf("Disch FAIL %ld mV\n", + debug_printf("Disch FAIL %d mV\n", ADC_TO_VOLT_MV(vbus_volt)); pd_log_event(PD_EVENT_PS_FAULT, 0, PS_FAULT_DISCH, NULL); fault = FAULT_DISCHARGE; |