From bd0564c71f8e60e8577046ea0967cffd8f348ff7 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 18 Dec 2023 21:02:39 +0530 Subject: [PATCH] [nrf fromlist] ap: Fix build warning about type mismatch The negation produces "long unsigned int" and as we use %d this causes a build warning, introduce a bit macro for u8 to fix this. Upstream PR: http://lists.infradead.org/pipermail/hostap/2023-December/042112.html Signed-off-by: Chaitanya Tata --- src/ap/ieee802_1x.c | 2 +- src/utils/common.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c index 753c88335..0c70381ae 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c @@ -2606,7 +2606,7 @@ int ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta, HOSTAPD_LEVEL_DEBUG, "did not Ack EAPOL-Key frame (%scast index=%d)", key->key_index & BIT(7) ? "uni" : "broad", - key->key_index & ~BIT(7)); + key->key_index & ~BIT_U8(7)); /* TODO: re-send EAPOL-Key couple of times (with short delay * between them?). If all attempt fail, report error and * deauthenticate STA so that it will get new keys when diff --git a/src/utils/common.h b/src/utils/common.h index 4a06a7126..5cb80129c 100644 --- a/src/utils/common.h +++ b/src/utils/common.h @@ -429,6 +429,10 @@ void perror(const char *s); #define BIT(x) (1U << (x)) #endif +#ifndef BIT_U8 +#define BIT_U8(n) (1U << (n)) +#endif + /* * Definitions for sparse validation * (http://kernel.org/pub/linux/kernel/people/josh/sparse/)