From 9e9c24307deb302ed969b268e97cebfa4061c79c Mon Sep 17 00:00:00 2001 From: Denis Brockus Date: Tue, 28 May 2019 09:01:51 -0600 Subject: common: board_[read/write]_serial weak reference cleanup board_read_serial and board_write_serial were prototyped as weak and this made all instances, that included that prototype, weak as well. In order to not lose information from the prototype, default and override functions, I changed to use the override weak marker symbols. These functions defaulted for specific configurations as different functionality and used an #ifdef tree to do this. I made these a single definition for each function and used IS_ENABLED instead of the #ifdef tree. I also added a definition for the case that the configuration would not have produced a function. BUG=none BRANCH=none TEST=make buildall -j Change-Id: Ie41c53f3a17d665358e46eefd3ded3066ee80a7d Signed-off-by: Denis Brockus Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1631583 Reviewed-by: Daisuke Nojiri Reviewed-by: Jett Rink Reviewed-by: Jack Rosenthal Commit-Queue: Jett Rink --- board/hammer/board.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'board') diff --git a/board/hammer/board.c b/board/hammer/board.c index 8b3de4268c..6b7a4029cf 100644 --- a/board/hammer/board.c +++ b/board/hammer/board.c @@ -303,7 +303,7 @@ int board_get_entropy(void *buffer, int len) /* * Generate a USB serial number from unique chip ID. */ -const char *board_read_serial(void) +__override const char *board_read_serial(void) { static char str[CONFIG_SERIALNO_LEN]; @@ -322,7 +322,7 @@ const char *board_read_serial(void) return str; } -int board_write_serial(const char *serialno) +__override int board_write_serial(const char *serialno) { return 0; } -- cgit v1.2.1