From e2e8a397f88eaedb9d3f16b6b4560eec51aee7e0 Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Fri, 28 Jun 2024 16:21:42 +0100 Subject: [PATCH] fix(mhu): fix compilation error with ENABLE_ASSERTIONS=0 option After disabling assertion with -DENABLE_ASSERTIONS=0, the build reports error: drivers/arm/mhu/mhu_wrapper_v3_x.c: In function 'mhu_get_max_message_size': drivers/arm/mhu/mhu_wrapper_v3_x.c:448:31: error: variable 'err' set but not used [-Werror=unused-but-set-variable] enum mhu_v3_x_error_t err; ^~~ This commit fixes the building failure by making the variable 'err' as __maybe_unused. Change-Id: I338e6df03d2f0805c83e96d8e3a4abae41e68678 Signed-off-by: Leo Yan --- drivers/arm/mhu/mhu_wrapper_v3_x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/arm/mhu/mhu_wrapper_v3_x.c b/drivers/arm/mhu/mhu_wrapper_v3_x.c index b3d51e3bf..3efd7017c 100644 --- a/drivers/arm/mhu/mhu_wrapper_v3_x.c +++ b/drivers/arm/mhu/mhu_wrapper_v3_x.c @@ -445,7 +445,7 @@ enum mhu_error_t mhu_receive_data(uint8_t *receive_buffer, size_t *size) size_t mhu_get_max_message_size(void) { - enum mhu_v3_x_error_t err; + enum mhu_v3_x_error_t err __maybe_unused; uint8_t num_channels; err = mhu_v3_x_get_num_channel_implemented(&mhu_seh_dev,