summaryrefslogtreecommitdiff
path: root/board/hatch_fp
diff options
context:
space:
mode:
authorBobby Casey <bobbycasey@google.com>2022-06-16 17:32:06 -0400
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-07 21:25:39 +0000
commitc25ffdb3164b0421d73f5258a71f3d371bfea623 (patch)
tree98fc0156448dd79b457f36896c385b5b04784733 /board/hatch_fp
parent7eab3811962cde5b5c66a5952a4f7d9b1b41cd67 (diff)
downloadchrome-ec-c25ffdb3164b0421d73f5258a71f3d371bfea623.tar.gz
common: Conditionally support printf %l and %i modifiers
The libfp library prints some values with PRIx32 or PRId32 format specifiers which, in their compilation environment, output "%lx" and "%ld". Unfortunately, support for printing any '%l' format in EC code was deprecated in issuetracker.google.com/issues/172210614 after changing it from it being treated as a hard-coded 64-bit length. There was concern that new code using %l with 32-bit values would be cherry-picked to older branches without the updated printf. In these cases, the older code would interpret that %l as 64-bit argument, causing it to over-ingest arguments and potentially behave in an undefined manner. Printing 32-bit values with "%l" or "%i" is safe as long as we can guarantee no legacy code will attempt to print using "%l" with a 64-bit value. The logic here is protected by a config flag that is only enabled for FPMCU and FPMCU doesn't use long running release branches. A printf test is also added to ensure that only dartmonkey and bloonchipper boards have long32 enabled. BRANCH=none BUG=b:234781655 BUG=b:234143158 TEST=./test/run_device_tests.py -b dartmonkey -t printf TEST=./test/run_device_tests.py -b bloonchipper -t printf TEST=make runhosttests Signed-off-by: Bobby Casey <bobbycasey@google.com> Change-Id: If432f507a31cc12a4c5c4bdcd07c6141407bd70d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3707743 Reviewed-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'board/hatch_fp')
-rw-r--r--board/hatch_fp/board.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/board/hatch_fp/board.h b/board/hatch_fp/board.h
index 2702152576..a4c4e2923b 100644
--- a/board/hatch_fp/board.h
+++ b/board/hatch_fp/board.h
@@ -230,7 +230,7 @@
#define CONFIG_HOST_COMMAND_STATUS
#define CONFIG_MKBP_EVENT
#define CONFIG_MKBP_USE_GPIO
-#define CONFIG_PRINTF_LEGACY_LI_FORMAT
+#define CONFIG_PRINTF_LONG_IS_32BITS
#define CONFIG_RNG
#define CONFIG_SHA256
#define CONFIG_SHA256_UNROLLED