Skip to content

Commit 8a573c6

Browse files
committed
net: wireless: rtl8189es: Guard debug function with CONFIG_RTW_DEBUG
The helper function `nl80211_tx_power_setting_str` is only used for debugging purposes when `CONFIG_RTW_DEBUG` is enabled. When this config is disabled, the function is defined but not used, causing a build failure with `-Werror=unused-function`. Fix this by enclosing the entire function definition within an `#ifdef CONFIG_RTW_DEBUG` block. This ensures the function is only compiled when it is actually needed, resolving the build error in a clean and idiomatic way. Signed-off-by: Khusika Dhamar Gusti <[email protected]>
1 parent b435215 commit 8a573c6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/wireless/rtl8189es/os_dep/linux/ioctl_cfg80211.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4143,6 +4143,7 @@ static int cfg80211_rtw_disconnect(struct wiphy *wiphy, struct net_device *ndev,
41434143
}
41444144

41454145
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31))
4146+
#ifdef CONFIG_RTW_DEBUG
41464147
static const char *nl80211_tx_power_setting_str(int type)
41474148
{
41484149
switch (type) {
@@ -4156,6 +4157,7 @@ static const char *nl80211_tx_power_setting_str(int type)
41564157
return "UNKNOWN";
41574158
};
41584159
}
4160+
#endif /* CONFIG_RTW_DEBUG */
41594161

41604162
static int cfg80211_rtw_set_txpower(struct wiphy *wiphy,
41614163
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))

0 commit comments

Comments
 (0)