From 7c3893423d6ba5088f92f4ebdb626285759a1bcd Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 21 Mar 2023 13:45:24 +0100 Subject: [PATCH] fix(scmi): fix compilation error in scmi base Fix compilation error when scmi base in enabled. The following compilation error is visible: drivers/scmi-msg/base.c: In function 'discover_list_protocols': include/lib/utils_def.h:70:20: error: comparison of distinct pointer types lacks a cast [-Werror] 70 | (void)(&_x == &_y); \ | ^~ drivers/scmi-msg/base.c:154:25: note: in expansion of macro 'MIN' 154 | count = MIN(count - a2p->skip, msg->out_size - sizeof(p2a)); Change-Id: I79e60d4bc9c4f6e78a76099a36ebf4fe5212a7d1 Signed-off-by: Michal Simek --- drivers/scmi-msg/base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scmi-msg/base.c b/drivers/scmi-msg/base.c index 2db4d7e9e..52502a5a5 100644 --- a/drivers/scmi-msg/base.c +++ b/drivers/scmi-msg/base.c @@ -151,7 +151,8 @@ static void discover_list_protocols(struct scmi_msg *msg) count = count_protocols_in_list(list); if (count > a2p->skip) { - count = MIN(count - a2p->skip, msg->out_size - sizeof(p2a)); + count = MIN((uint32_t)(count - a2p->skip), + (uint32_t)(msg->out_size - sizeof(p2a))); } else { count = 0U; } -- 2.39.5