diff options
author | Wealian Liao <whliao@nuvoton.corp-partner.google.com> | 2021-06-10 16:17:34 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-27 15:57:20 +0000 |
commit | 15d5e2039030d22d2a65870542e7200f5f7fa335 (patch) | |
tree | 3826324de44bb086a642164160eb78f8dfd1ee06 /zephyr/shim/include | |
parent | b011985e89d9d2e6fceb8ca4dc91bfb8fea52e3d (diff) | |
download | chrome-ec-15d5e2039030d22d2a65870542e7200f5f7fa335.tar.gz |
zephyr: Fix warning for host command disable
Zephyr enables unused function warning for GCC compiler. It generates
warnings for those static host command functions when the host command
disable. Add __attribute__((unused)) for the routine in
DECLARE_HOST_COMMAND.
However, for all the test which use Clang will generate another warning
"attribute declaration must precede definition" for host command.
Zephyr doesn't enable unused function warning for Clang compiler, so
define DECLARE_HOST_COMMAND as empty for Clang.
BUG=none
BRANCH=none
TEST=zmake testall
Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Change-Id: If19bf7f76b742313674885eb8f8f2dce8038fc76
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3033228
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/shim/include')
-rw-r--r-- | zephyr/shim/include/zephyr_host_command.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/zephyr/shim/include/zephyr_host_command.h b/zephyr/shim/include/zephyr_host_command.h index 377578311c..6535bb8876 100644 --- a/zephyr/shim/include/zephyr_host_command.h +++ b/zephyr/shim/include/zephyr_host_command.h @@ -53,6 +53,11 @@ void zshim_setup_host_command( } \ SYS_INIT(_setup_host_command_##line, APPLICATION, 1) #else /* !CONFIG_PLATFORM_EC_HOSTCMD */ -#define DECLARE_HOST_COMMAND(command, routine, version_mask) \ - enum ec_status (routine)(struct host_cmd_handler_args *args) +#ifdef __clang__ +#define DECLARE_HOST_COMMAND(command, routine, version_mask) +#else +#define DECLARE_HOST_COMMAND(command, routine, version_mask) \ + enum ec_status (routine)(struct host_cmd_handler_args *args) \ + __attribute__((unused)) +#endif /* __clang__ */ #endif /* CONFIG_PLATFORM_EC_HOSTCMD */ |