From 935984c900356b93d4bae5a1ea667a34bb7c1f80 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Mon, 7 Aug 2023 09:41:19 -0700 Subject: [PATCH 1/2] gcc-plugins: Rename last_stmt() for GCC 14+ In GCC 14, last_stmt() was renamed to last_nondebug_stmt(). Add a helper macro to handle the renaming. Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook --- scripts/gcc-plugins/gcc-common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h index 9a1895747b153..2bf22939707b3 100644 --- a/scripts/gcc-plugins/gcc-common.h +++ b/scripts/gcc-plugins/gcc-common.h @@ -440,4 +440,8 @@ static inline void debug_gimple_stmt(const_gimple s) #define SET_DECL_MODE(decl, mode) DECL_MODE(decl) = (mode) #endif +#if BUILDING_GCC_VERSION >= 14000 +#define last_stmt(x) last_nondebug_stmt(x) +#endif + #endif From 4d5d10920160a50f3ed2156235fdf38ae06754a2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 27 Jan 2024 16:44:07 -0800 Subject: [PATCH 2/2] eswin: Repace NULL with 0 where it is converted from int to pointer Fixes build with gcc-14 include/linux/stddef.h:8:14: error: passing argument 3 of 'ecrnx_cfg80211_add_key' makes integer from pointer without a cast [-Wint-conversion] 8 | #define NULL ((void *)0) | ^~~~~~~~~~~ | | | void * /mnt/b/yoe/master/build/tmp/work-shared/visionfive2/kernel-source/drivers/net/wireless/eswin/fullmac/ecrnx_main.c:1715:44: note: in expansion of macro 'NULL' 1715 | ecrnx_cfg80211_add_key(wiphy, dev, NULL, sme->key_idx, false, NULL, &key_params); Signed-off-by: Khem Raj --- drivers/net/wireless/eswin/fullmac/ecrnx_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/eswin/fullmac/ecrnx_main.c b/drivers/net/wireless/eswin/fullmac/ecrnx_main.c index a302b22fe71e4..89bfddfda2812 100644 --- a/drivers/net/wireless/eswin/fullmac/ecrnx_main.c +++ b/drivers/net/wireless/eswin/fullmac/ecrnx_main.c @@ -1347,7 +1347,7 @@ static int ecrnx_cfg80211_change_iface(struct wiphy *wiphy, { if((ECRNX_VIF_TYPE(vif) == NL80211_IFTYPE_AP) || (ECRNX_VIF_TYPE(vif) == NL80211_IFTYPE_P2P_GO)) { - ecrnx_cfg80211_stop_ap(wiphy, dev, NULL); + ecrnx_cfg80211_stop_ap(wiphy, dev, 0); } else if((ECRNX_VIF_TYPE(vif) == NL80211_IFTYPE_STATION) || (ECRNX_VIF_TYPE(vif) == NL80211_IFTYPE_P2P_CLIENT)) { @@ -1712,7 +1712,7 @@ static int ecrnx_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, key_params.key_len = sme->key_len; key_params.seq_len = 0; key_params.cipher = sme->crypto.cipher_group; - ecrnx_cfg80211_add_key(wiphy, dev, NULL, sme->key_idx, false, NULL, &key_params); + ecrnx_cfg80211_add_key(wiphy, dev, 0, sme->key_idx, false, NULL, &key_params); } #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) else if ((sme->auth_type == NL80211_AUTHTYPE_SAE) &&