Skip to content

Commit d0b9a4e

Browse files
ndrs-pstkartben
authored andcommitted
drivers: wifi: nxp: use IS_ENABLED() for CONFIG_NXP_WIFI_SOFTAP_SUPPORT
Replaced conditional compilation of `CONFIG_NXP_WIFI_SOFTAP_SUPPORT` where applicable with IS_ENABLED() macro to improve code readability. Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
1 parent 2265dd7 commit d0b9a4e

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

drivers/wifi/nxp/nxp_wifi_drv.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,12 +1213,10 @@ static int nxp_wifi_status(const struct device *dev, struct wifi_iface_status *s
12131213

12141214
if (if_handle->state.interface == WLAN_BSS_TYPE_STA) {
12151215
status->iface_mode = WIFI_MODE_INFRA;
1216-
}
1217-
#ifdef CONFIG_NXP_WIFI_SOFTAP_SUPPORT
1218-
else if (if_handle->state.interface == WLAN_BSS_TYPE_UAP) {
1216+
} else if (IS_ENABLED(CONFIG_NXP_WIFI_SOFTAP_SUPPORT) &&
1217+
(if_handle->state.interface == WLAN_BSS_TYPE_UAP)) {
12191218
status->iface_mode = WIFI_MODE_AP;
12201219
}
1221-
#endif
12221220

12231221
#ifdef CONFIG_NXP_WIFI_11AX
12241222
if (nxp_wlan_network.dot11ax) {
@@ -1273,12 +1271,11 @@ static int nxp_wifi_get_detail_stats(int bss_type, wlan_pkt_stats_t *stats)
12731271

12741272
if (bss_type == WLAN_BSS_TYPE_STA) {
12751273
ret = wlan_get_log(stats);
1276-
}
1277-
#ifdef CONFIG_NXP_WIFI_SOFTAP_SUPPORT
1278-
else if (bss_type == WLAN_BSS_TYPE_UAP) {
1274+
} else if (IS_ENABLED(CONFIG_NXP_WIFI_SOFTAP_SUPPORT) &&
1275+
(bss_type == WLAN_BSS_TYPE_UAP)) {
12791276
ret = wlan_uap_get_log(stats);
12801277
}
1281-
#endif
1278+
12821279
return ret;
12831280
}
12841281
#endif
@@ -2030,13 +2027,12 @@ static int nxp_wifi_set_config(const struct device *dev, enum ethernet_config_ty
20302027
LOG_ERR("Failed to set Wi-Fi MAC Address");
20312028
return -ENOEXEC;
20322029
}
2033-
#ifdef CONFIG_NXP_WIFI_SOFTAP_SUPPORT
2034-
} else if (if_handle->state.interface == WLAN_BSS_TYPE_UAP) {
2030+
} else if (IS_ENABLED(CONFIG_NXP_WIFI_SOFTAP_SUPPORT) &&
2031+
(if_handle->state.interface == WLAN_BSS_TYPE_UAP)) {
20352032
if (wlan_set_uap_mac_addr(if_handle->mac_address)) {
20362033
LOG_ERR("Failed to set Wi-Fi MAC Address");
20372034
return -ENOEXEC;
20382035
}
2039-
#endif
20402036
} else {
20412037
LOG_ERR("Invalid Interface index");
20422038
return -ENOEXEC;

0 commit comments

Comments
 (0)