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 <leo.yan@arm.com>
This commit is contained in:
Leo Yan 2024-06-28 16:21:42 +01:00
parent db04e56c37
commit e2e8a397f8

View file

@ -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,