tree-wide: replace config_enabled() with IS_ENABLED()
The use of config_enabled() against config options is ambiguous. In practical terms, config_enabled() is equivalent to IS_BUILTIN(), but the author might have used it for the meaning of IS_ENABLED(). Using IS_ENABLED(), IS_BUILTIN(), IS_MODULE() etc. makes the intention clearer. This commit replaces config_enabled() with IS_ENABLED() where possible. This commit is only touching bool config options. I noticed two cases where config_enabled() is used against a tristate option: - config_enabled(CONFIG_HWMON) [ drivers/net/wireless/ath/ath10k/thermal.c ] - config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE) [ drivers/gpu/drm/gma500/opregion.c ] I did not touch them because they should be converted to IS_BUILTIN() in order to keep the logic, but I was not sure it was the authors' intention. Link: http://lkml.kernel.org/r/1465215656-20569-1-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Kees Cook <keescook@chromium.org> Cc: Stas Sergeev <stsp@list.ru> Cc: Matt Redfearn <matt.redfearn@imgtec.com> Cc: Joshua Kinard <kumba@gentoo.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Borislav Petkov <bp@suse.de> Cc: Markos Chandras <markos.chandras@imgtec.com> Cc: "Dmitry V. Levin" <ldv@altlinux.org> Cc: yu-cheng yu <yu-cheng.yu@intel.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: Brian Gerst <brgerst@gmail.com> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Will Drewry <wad@chromium.org> Cc: Nikolay Martynov <mar.kolya@gmail.com> Cc: Huacai Chen <chenhc@lemote.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> Cc: Rafal Milecki <zajec5@gmail.com> Cc: James Cowgill <James.Cowgill@imgtec.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Alex Smith <alex.smith@imgtec.com> Cc: Adam Buchbinder <adam.buchbinder@gmail.com> Cc: Qais Yousef <qais.yousef@imgtec.com> Cc: Jiang Liu <jiang.liu@linux.intel.com> Cc: Mikko Rapeli <mikko.rapeli@iki.fi> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com> Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Ingo Molnar <mingo@redhat.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> Cc: Roland McGrath <roland@hack.frob.com> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Kalle Valo <kvalo@qca.qualcomm.com> Cc: Viresh Kumar <viresh.kumar@linaro.org> Cc: Tony Wu <tung7970@gmail.com> Cc: Huaitong Han <huaitong.han@intel.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Juergen Gross <jgross@suse.com> Cc: Jason Cooper <jason@lakedaemon.net> Cc: "David S. Miller" <davem@davemloft.net> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andrea Gelmini <andrea.gelmini@gelma.net> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Rabin Vincent <rabin@rab.in> Cc: "Maciej W. Rozycki" <macro@imgtec.com> Cc: David Daney <david.daney@cavium.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
95ba9cdb59
commit
b2b1a07ab5
3 changed files with 12 additions and 12 deletions
|
@ -139,11 +139,11 @@ void ath10k_debug_print_hwfw_info(struct ath10k *ar)
|
||||||
ar->id.subsystem_vendor, ar->id.subsystem_device);
|
ar->id.subsystem_vendor, ar->id.subsystem_device);
|
||||||
|
|
||||||
ath10k_info(ar, "kconfig debug %d debugfs %d tracing %d dfs %d testmode %d\n",
|
ath10k_info(ar, "kconfig debug %d debugfs %d tracing %d dfs %d testmode %d\n",
|
||||||
config_enabled(CONFIG_ATH10K_DEBUG),
|
IS_ENABLED(CONFIG_ATH10K_DEBUG),
|
||||||
config_enabled(CONFIG_ATH10K_DEBUGFS),
|
IS_ENABLED(CONFIG_ATH10K_DEBUGFS),
|
||||||
config_enabled(CONFIG_ATH10K_TRACING),
|
IS_ENABLED(CONFIG_ATH10K_TRACING),
|
||||||
config_enabled(CONFIG_ATH10K_DFS_CERTIFIED),
|
IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED),
|
||||||
config_enabled(CONFIG_NL80211_TESTMODE));
|
IS_ENABLED(CONFIG_NL80211_TESTMODE));
|
||||||
|
|
||||||
firmware = ar->normal_mode_fw.fw_file.firmware;
|
firmware = ar->normal_mode_fw.fw_file.firmware;
|
||||||
if (firmware)
|
if (firmware)
|
||||||
|
@ -2424,7 +2424,7 @@ int ath10k_debug_register(struct ath10k *ar)
|
||||||
debugfs_create_file("nf_cal_period", S_IRUSR | S_IWUSR,
|
debugfs_create_file("nf_cal_period", S_IRUSR | S_IWUSR,
|
||||||
ar->debug.debugfs_phy, ar, &fops_nf_cal_period);
|
ar->debug.debugfs_phy, ar, &fops_nf_cal_period);
|
||||||
|
|
||||||
if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED)) {
|
if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED)) {
|
||||||
debugfs_create_file("dfs_simulate_radar", S_IWUSR,
|
debugfs_create_file("dfs_simulate_radar", S_IWUSR,
|
||||||
ar->debug.debugfs_phy, ar,
|
ar->debug.debugfs_phy, ar,
|
||||||
&fops_simulate_radar);
|
&fops_simulate_radar);
|
||||||
|
|
|
@ -3039,7 +3039,7 @@ static void ath10k_regd_update(struct ath10k *ar)
|
||||||
|
|
||||||
regpair = ar->ath_common.regulatory.regpair;
|
regpair = ar->ath_common.regulatory.regpair;
|
||||||
|
|
||||||
if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) {
|
if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) {
|
||||||
nl_dfs_reg = ar->dfs_detector->region;
|
nl_dfs_reg = ar->dfs_detector->region;
|
||||||
wmi_dfs_reg = ath10k_mac_get_dfs_region(nl_dfs_reg);
|
wmi_dfs_reg = ath10k_mac_get_dfs_region(nl_dfs_reg);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3068,7 +3068,7 @@ static void ath10k_reg_notifier(struct wiphy *wiphy,
|
||||||
|
|
||||||
ath_reg_notifier_apply(wiphy, request, &ar->ath_common.regulatory);
|
ath_reg_notifier_apply(wiphy, request, &ar->ath_common.regulatory);
|
||||||
|
|
||||||
if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) {
|
if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) {
|
||||||
ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "dfs region 0x%x\n",
|
ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "dfs region 0x%x\n",
|
||||||
request->dfs_region);
|
request->dfs_region);
|
||||||
result = ar->dfs_detector->set_dfs_domain(ar->dfs_detector,
|
result = ar->dfs_detector->set_dfs_domain(ar->dfs_detector,
|
||||||
|
@ -7955,7 +7955,7 @@ int ath10k_mac_register(struct ath10k *ar)
|
||||||
if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags))
|
if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags))
|
||||||
ar->hw->netdev_features = NETIF_F_HW_CSUM;
|
ar->hw->netdev_features = NETIF_F_HW_CSUM;
|
||||||
|
|
||||||
if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED)) {
|
if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED)) {
|
||||||
/* Init ath dfs pattern detector */
|
/* Init ath dfs pattern detector */
|
||||||
ar->ath_common.debug_mask = ATH_DBG_DFS;
|
ar->ath_common.debug_mask = ATH_DBG_DFS;
|
||||||
ar->dfs_detector = dfs_pattern_detector_init(&ar->ath_common,
|
ar->dfs_detector = dfs_pattern_detector_init(&ar->ath_common,
|
||||||
|
@ -8003,7 +8003,7 @@ err_unregister:
|
||||||
ieee80211_unregister_hw(ar->hw);
|
ieee80211_unregister_hw(ar->hw);
|
||||||
|
|
||||||
err_dfs_detector_exit:
|
err_dfs_detector_exit:
|
||||||
if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)
|
if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)
|
||||||
ar->dfs_detector->exit(ar->dfs_detector);
|
ar->dfs_detector->exit(ar->dfs_detector);
|
||||||
|
|
||||||
err_free:
|
err_free:
|
||||||
|
@ -8018,7 +8018,7 @@ void ath10k_mac_unregister(struct ath10k *ar)
|
||||||
{
|
{
|
||||||
ieee80211_unregister_hw(ar->hw);
|
ieee80211_unregister_hw(ar->hw);
|
||||||
|
|
||||||
if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)
|
if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)
|
||||||
ar->dfs_detector->exit(ar->dfs_detector);
|
ar->dfs_detector->exit(ar->dfs_detector);
|
||||||
|
|
||||||
kfree(ar->mac.sbands[NL80211_BAND_2GHZ].channels);
|
kfree(ar->mac.sbands[NL80211_BAND_2GHZ].channels);
|
||||||
|
|
|
@ -3704,7 +3704,7 @@ void ath10k_wmi_event_dfs(struct ath10k *ar,
|
||||||
phyerr->tsf_timestamp, tsf, buf_len);
|
phyerr->tsf_timestamp, tsf, buf_len);
|
||||||
|
|
||||||
/* Skip event if DFS disabled */
|
/* Skip event if DFS disabled */
|
||||||
if (!config_enabled(CONFIG_ATH10K_DFS_CERTIFIED))
|
if (!IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ATH10K_DFS_STAT_INC(ar, pulses_total);
|
ATH10K_DFS_STAT_INC(ar, pulses_total);
|
||||||
|
|
Loading…
Add table
Reference in a new issue