Skip to content

Commit

Permalink
wireless: Use octal not symbolic permissions
Browse files Browse the repository at this point in the history
Prefer the direct use of octal for permissions.

Done with checkpatch -f --types=SYMBOLIC_PERMS --fix-inplace
and some typing.

Miscellanea:

o Whitespace neatening around these conversions.

Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
JoePerches authored and Kalle Valo committed Mar 27, 2018
1 parent 255dd5b commit 2ef00c5
Show file tree
Hide file tree
Showing 53 changed files with 427 additions and 486 deletions.
6 changes: 3 additions & 3 deletions drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@
#include "trace.h"

bool ath5k_modparam_nohwcrypt;
module_param_named(nohwcrypt, ath5k_modparam_nohwcrypt, bool, S_IRUGO);
module_param_named(nohwcrypt, ath5k_modparam_nohwcrypt, bool, 0444);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");

static bool modparam_fastchanswitch;
module_param_named(fastchanswitch, modparam_fastchanswitch, bool, S_IRUGO);
module_param_named(fastchanswitch, modparam_fastchanswitch, bool, 0444);
MODULE_PARM_DESC(fastchanswitch, "Enable fast channel switching for AR2413/AR5413 radios.");

static bool ath5k_modparam_no_hw_rfkill_switch;
module_param_named(no_hw_rfkill_switch, ath5k_modparam_no_hw_rfkill_switch,
bool, S_IRUGO);
bool, 0444);
MODULE_PARM_DESC(no_hw_rfkill_switch, "Ignore the GPIO RFKill switch state");


Expand Down
37 changes: 11 additions & 26 deletions drivers/net/wireless/ath/ath5k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,32 +1004,17 @@ ath5k_debug_init_device(struct ath5k_hw *ah)
if (!phydir)
return;

debugfs_create_file("debug", S_IWUSR | S_IRUSR, phydir, ah,
&fops_debug);

debugfs_create_file("registers", S_IRUSR, phydir, ah, &fops_registers);

debugfs_create_file("beacon", S_IWUSR | S_IRUSR, phydir, ah,
&fops_beacon);

debugfs_create_file("reset", S_IWUSR, phydir, ah, &fops_reset);

debugfs_create_file("antenna", S_IWUSR | S_IRUSR, phydir, ah,
&fops_antenna);

debugfs_create_file("misc", S_IRUSR, phydir, ah, &fops_misc);

debugfs_create_file("eeprom", S_IRUSR, phydir, ah, &fops_eeprom);

debugfs_create_file("frameerrors", S_IWUSR | S_IRUSR, phydir, ah,
&fops_frameerrors);

debugfs_create_file("ani", S_IWUSR | S_IRUSR, phydir, ah, &fops_ani);

debugfs_create_file("queue", S_IWUSR | S_IRUSR, phydir, ah,
&fops_queue);

debugfs_create_bool("32khz_clock", S_IWUSR | S_IRUSR, phydir,
debugfs_create_file("debug", 0600, phydir, ah, &fops_debug);
debugfs_create_file("registers", 0400, phydir, ah, &fops_registers);
debugfs_create_file("beacon", 0600, phydir, ah, &fops_beacon);
debugfs_create_file("reset", 0200, phydir, ah, &fops_reset);
debugfs_create_file("antenna", 0600, phydir, ah, &fops_antenna);
debugfs_create_file("misc", 0400, phydir, ah, &fops_misc);
debugfs_create_file("eeprom", 0400, phydir, ah, &fops_eeprom);
debugfs_create_file("frameerrors", 0600, phydir, ah, &fops_frameerrors);
debugfs_create_file("ani", 0600, phydir, ah, &fops_ani);
debugfs_create_file("queue", 0600, phydir, ah, &fops_queue);
debugfs_create_bool("32khz_clock", 0600, phydir,
&ah->ah_use_32khz_clock);
}

Expand Down
8 changes: 4 additions & 4 deletions drivers/net/wireless/ath/ath5k/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static ssize_t ath5k_attr_store_##name(struct device *dev, \
set(ah, val); \
return count; \
} \
static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, \
static DEVICE_ATTR(name, 0644, \
ath5k_attr_show_##name, ath5k_attr_store_##name)

#define SIMPLE_SHOW(name, get) \
Expand All @@ -43,7 +43,7 @@ static ssize_t ath5k_attr_show_##name(struct device *dev, \
struct ath5k_hw *ah = hw->priv; \
return snprintf(buf, PAGE_SIZE, "%d\n", get); \
} \
static DEVICE_ATTR(name, S_IRUGO, ath5k_attr_show_##name, NULL)
static DEVICE_ATTR(name, 0444, ath5k_attr_show_##name, NULL)

/*** ANI ***/

Expand All @@ -66,7 +66,7 @@ static ssize_t ath5k_attr_show_noise_immunity_level_max(struct device *dev,
{
return snprintf(buf, PAGE_SIZE, "%d\n", ATH5K_ANI_MAX_NOISE_IMM_LVL);
}
static DEVICE_ATTR(noise_immunity_level_max, S_IRUGO,
static DEVICE_ATTR(noise_immunity_level_max, 0444,
ath5k_attr_show_noise_immunity_level_max, NULL);

static ssize_t ath5k_attr_show_firstep_level_max(struct device *dev,
Expand All @@ -75,7 +75,7 @@ static ssize_t ath5k_attr_show_firstep_level_max(struct device *dev,
{
return snprintf(buf, PAGE_SIZE, "%d\n", ATH5K_ANI_MAX_FIRSTEP_LVL);
}
static DEVICE_ATTR(firstep_level_max, S_IRUGO,
static DEVICE_ATTR(firstep_level_max, 0444,
ath5k_attr_show_firstep_level_max, NULL);

static struct attribute *ath5k_sysfs_entries_ani[] = {
Expand Down
43 changes: 21 additions & 22 deletions drivers/net/wireless/ath/ath6kl/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,69 +1794,68 @@ int ath6kl_debug_init_fs(struct ath6kl *ar)
if (!ar->debugfs_phy)
return -ENOMEM;

debugfs_create_file("tgt_stats", S_IRUSR, ar->debugfs_phy, ar,
debugfs_create_file("tgt_stats", 0400, ar->debugfs_phy, ar,
&fops_tgt_stats);

if (ar->hif_type == ATH6KL_HIF_TYPE_SDIO)
debugfs_create_file("credit_dist_stats", S_IRUSR,
debugfs_create_file("credit_dist_stats", 0400,
ar->debugfs_phy, ar,
&fops_credit_dist_stats);

debugfs_create_file("endpoint_stats", S_IRUSR | S_IWUSR,
debugfs_create_file("endpoint_stats", 0600,
ar->debugfs_phy, ar, &fops_endpoint_stats);

debugfs_create_file("fwlog", S_IRUSR, ar->debugfs_phy, ar,
&fops_fwlog);
debugfs_create_file("fwlog", 0400, ar->debugfs_phy, ar, &fops_fwlog);

debugfs_create_file("fwlog_block", S_IRUSR, ar->debugfs_phy, ar,
debugfs_create_file("fwlog_block", 0400, ar->debugfs_phy, ar,
&fops_fwlog_block);

debugfs_create_file("fwlog_mask", S_IRUSR | S_IWUSR, ar->debugfs_phy,
debugfs_create_file("fwlog_mask", 0600, ar->debugfs_phy,
ar, &fops_fwlog_mask);

debugfs_create_file("reg_addr", S_IRUSR | S_IWUSR, ar->debugfs_phy, ar,
debugfs_create_file("reg_addr", 0600, ar->debugfs_phy, ar,
&fops_diag_reg_read);

debugfs_create_file("reg_dump", S_IRUSR, ar->debugfs_phy, ar,
debugfs_create_file("reg_dump", 0400, ar->debugfs_phy, ar,
&fops_reg_dump);

debugfs_create_file("lrssi_roam_threshold", S_IRUSR | S_IWUSR,
debugfs_create_file("lrssi_roam_threshold", 0600,
ar->debugfs_phy, ar, &fops_lrssi_roam_threshold);

debugfs_create_file("reg_write", S_IRUSR | S_IWUSR,
debugfs_create_file("reg_write", 0600,
ar->debugfs_phy, ar, &fops_diag_reg_write);

debugfs_create_file("war_stats", S_IRUSR, ar->debugfs_phy, ar,
debugfs_create_file("war_stats", 0400, ar->debugfs_phy, ar,
&fops_war_stats);

debugfs_create_file("roam_table", S_IRUSR, ar->debugfs_phy, ar,
debugfs_create_file("roam_table", 0400, ar->debugfs_phy, ar,
&fops_roam_table);

debugfs_create_file("force_roam", S_IWUSR, ar->debugfs_phy, ar,
debugfs_create_file("force_roam", 0200, ar->debugfs_phy, ar,
&fops_force_roam);

debugfs_create_file("roam_mode", S_IWUSR, ar->debugfs_phy, ar,
debugfs_create_file("roam_mode", 0200, ar->debugfs_phy, ar,
&fops_roam_mode);

debugfs_create_file("keepalive", S_IRUSR | S_IWUSR, ar->debugfs_phy, ar,
debugfs_create_file("keepalive", 0600, ar->debugfs_phy, ar,
&fops_keepalive);

debugfs_create_file("disconnect_timeout", S_IRUSR | S_IWUSR,
debugfs_create_file("disconnect_timeout", 0600,
ar->debugfs_phy, ar, &fops_disconnect_timeout);

debugfs_create_file("create_qos", S_IWUSR, ar->debugfs_phy, ar,
debugfs_create_file("create_qos", 0200, ar->debugfs_phy, ar,
&fops_create_qos);

debugfs_create_file("delete_qos", S_IWUSR, ar->debugfs_phy, ar,
debugfs_create_file("delete_qos", 0200, ar->debugfs_phy, ar,
&fops_delete_qos);

debugfs_create_file("bgscan_interval", S_IWUSR,
debugfs_create_file("bgscan_interval", 0200,
ar->debugfs_phy, ar, &fops_bgscan_int);

debugfs_create_file("listen_interval", S_IRUSR | S_IWUSR,
debugfs_create_file("listen_interval", 0600,
ar->debugfs_phy, ar, &fops_listen_int);

debugfs_create_file("power_params", S_IWUSR, ar->debugfs_phy, ar,
debugfs_create_file("power_params", 0200, ar->debugfs_phy, ar,
&fops_power_params);

return 0;
Expand Down
9 changes: 4 additions & 5 deletions drivers/net/wireless/ath/ath9k/common-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static const struct file_operations fops_modal_eeprom = {
void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy,
struct ath_hw *ah)
{
debugfs_create_file("modal_eeprom", S_IRUSR, debugfs_phy, ah,
debugfs_create_file("modal_eeprom", 0400, debugfs_phy, ah,
&fops_modal_eeprom);
}
EXPORT_SYMBOL(ath9k_cmn_debug_modal_eeprom);
Expand Down Expand Up @@ -82,7 +82,7 @@ static const struct file_operations fops_base_eeprom = {
void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy,
struct ath_hw *ah)
{
debugfs_create_file("base_eeprom", S_IRUSR, debugfs_phy, ah,
debugfs_create_file("base_eeprom", 0400, debugfs_phy, ah,
&fops_base_eeprom);
}
EXPORT_SYMBOL(ath9k_cmn_debug_base_eeprom);
Expand Down Expand Up @@ -178,8 +178,7 @@ static const struct file_operations fops_recv = {
void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
struct ath_rx_stats *rxstats)
{
debugfs_create_file("recv", S_IRUSR, debugfs_phy, rxstats,
&fops_recv);
debugfs_create_file("recv", 0400, debugfs_phy, rxstats, &fops_recv);
}
EXPORT_SYMBOL(ath9k_cmn_debug_recv);

Expand Down Expand Up @@ -255,7 +254,7 @@ static const struct file_operations fops_phy_err = {
void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
struct ath_rx_stats *rxstats)
{
debugfs_create_file("phy_err", S_IRUSR, debugfs_phy, rxstats,
debugfs_create_file("phy_err", 0400, debugfs_phy, rxstats,
&fops_phy_err);
}
EXPORT_SYMBOL(ath9k_cmn_debug_phy_err);
10 changes: 5 additions & 5 deletions drivers/net/wireless/ath/ath9k/common-spectral.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,23 +1098,23 @@ void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv,
return;

debugfs_create_file("spectral_scan_ctl",
S_IRUSR | S_IWUSR,
0600,
debugfs_phy, spec_priv,
&fops_spec_scan_ctl);
debugfs_create_file("spectral_short_repeat",
S_IRUSR | S_IWUSR,
0600,
debugfs_phy, spec_priv,
&fops_spectral_short_repeat);
debugfs_create_file("spectral_count",
S_IRUSR | S_IWUSR,
0600,
debugfs_phy, spec_priv,
&fops_spectral_count);
debugfs_create_file("spectral_period",
S_IRUSR | S_IWUSR,
0600,
debugfs_phy, spec_priv,
&fops_spectral_period);
debugfs_create_file("spectral_fft_period",
S_IRUSR | S_IWUSR,
0600,
debugfs_phy, spec_priv,
&fops_spectral_fft_period);
}
Expand Down
40 changes: 19 additions & 21 deletions drivers/net/wireless/ath/ath9k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ int ath9k_init_debug(struct ath_hw *ah)
return -ENOMEM;

#ifdef CONFIG_ATH_DEBUG
debugfs_create_file("debug", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
debugfs_create_file("debug", 0600, sc->debug.debugfs_phy,
sc, &fops_debug);
#endif

Expand All @@ -1409,22 +1409,22 @@ int ath9k_init_debug(struct ath_hw *ah)
ath9k_cmn_debug_recv(sc->debug.debugfs_phy, &sc->debug.stats.rxstats);
ath9k_cmn_debug_phy_err(sc->debug.debugfs_phy, &sc->debug.stats.rxstats);

debugfs_create_u8("rx_chainmask", S_IRUSR, sc->debug.debugfs_phy,
debugfs_create_u8("rx_chainmask", 0400, sc->debug.debugfs_phy,
&ah->rxchainmask);
debugfs_create_u8("tx_chainmask", S_IRUSR, sc->debug.debugfs_phy,
debugfs_create_u8("tx_chainmask", 0400, sc->debug.debugfs_phy,
&ah->txchainmask);
debugfs_create_file("ani", S_IRUSR | S_IWUSR,
debugfs_create_file("ani", 0600,
sc->debug.debugfs_phy, sc, &fops_ani);
debugfs_create_bool("paprd", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
debugfs_create_bool("paprd", 0600, sc->debug.debugfs_phy,
&sc->sc_ah->config.enable_paprd);
debugfs_create_file("regidx", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
debugfs_create_file("regidx", 0600, sc->debug.debugfs_phy,
sc, &fops_regidx);
debugfs_create_file("regval", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
debugfs_create_file("regval", 0600, sc->debug.debugfs_phy,
sc, &fops_regval);
debugfs_create_bool("ignore_extcca", S_IRUSR | S_IWUSR,
debugfs_create_bool("ignore_extcca", 0600,
sc->debug.debugfs_phy,
&ah->config.cwm_ignore_extcca);
debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc,
debugfs_create_file("regdump", 0400, sc->debug.debugfs_phy, sc,
&fops_regdump);
debugfs_create_devm_seqfile(sc->dev, "dump_nfcal",
sc->debug.debugfs_phy,
Expand All @@ -1433,35 +1433,33 @@ int ath9k_init_debug(struct ath_hw *ah)
ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah);

debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR,
debugfs_create_u32("gpio_mask", 0600,
sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask);
debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR,
debugfs_create_u32("gpio_val", 0600,
sc->debug.debugfs_phy, &sc->sc_ah->gpio_val);
debugfs_create_file("antenna_diversity", S_IRUSR,
debugfs_create_file("antenna_diversity", 0400,
sc->debug.debugfs_phy, sc, &fops_antenna_diversity);
#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
debugfs_create_file("bt_ant_diversity", S_IRUSR | S_IWUSR,
debugfs_create_file("bt_ant_diversity", 0600,
sc->debug.debugfs_phy, sc, &fops_bt_ant_diversity);
debugfs_create_file("btcoex", S_IRUSR, sc->debug.debugfs_phy, sc,
debugfs_create_file("btcoex", 0400, sc->debug.debugfs_phy, sc,
&fops_btcoex);
#endif

#ifdef CONFIG_ATH9K_WOW
debugfs_create_file("wow", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy, sc, &fops_wow);
debugfs_create_file("wow", 0600, sc->debug.debugfs_phy, sc, &fops_wow);
#endif

#ifdef CONFIG_ATH9K_DYNACK
debugfs_create_file("ack_to", S_IRUSR, sc->debug.debugfs_phy,
debugfs_create_file("ack_to", 0400, sc->debug.debugfs_phy,
sc, &fops_ackto);
#endif
debugfs_create_file("tpc", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy, sc, &fops_tpc);
debugfs_create_file("tpc", 0600, sc->debug.debugfs_phy, sc, &fops_tpc);

debugfs_create_u16("airtime_flags", S_IRUSR | S_IWUSR,
debugfs_create_u16("airtime_flags", 0600,
sc->debug.debugfs_phy, &sc->airtime_flags);

debugfs_create_file("nf_override", S_IRUSR | S_IWUSR,
debugfs_create_file("nf_override", 0600,
sc->debug.debugfs_phy, sc, &fops_nf_override);

return 0;
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/wireless/ath/ath9k/debug_sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void ath9k_sta_add_debugfs(struct ieee80211_hw *hw,
{
struct ath_node *an = (struct ath_node *)sta->drv_priv;

debugfs_create_file("node_aggr", S_IRUGO, dir, an, &fops_node_aggr);
debugfs_create_file("node_recv", S_IRUGO, dir, an, &fops_node_recv);
debugfs_create_file("airtime", S_IRUGO, dir, an, &fops_airtime);
debugfs_create_file("node_aggr", 0444, dir, an, &fops_node_aggr);
debugfs_create_file("node_recv", 0444, dir, an, &fops_node_recv);
debugfs_create_file("airtime", 0444, dir, an, &fops_airtime);
}
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath9k/dfs_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ static const struct file_operations fops_dfs_stats = {

void ath9k_dfs_init_debug(struct ath_softc *sc)
{
debugfs_create_file("dfs_stats", S_IRUSR,
debugfs_create_file("dfs_stats", 0400,
sc->debug.debugfs_phy, sc, &fops_dfs_stats);
debugfs_create_file("dfs_simulate_radar", S_IWUSR,
debugfs_create_file("dfs_simulate_radar", 0200,
sc->debug.debugfs_phy, sc, &fops_simulate_radar);
}
16 changes: 8 additions & 8 deletions drivers/net/wireless/ath/ath9k/htc_drv_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,25 +496,25 @@ int ath9k_htc_init_debug(struct ath_hw *ah)

ath9k_cmn_spectral_init_debug(&priv->spec_priv, priv->debug.debugfs_phy);

debugfs_create_file("tgt_int_stats", S_IRUSR, priv->debug.debugfs_phy,
debugfs_create_file("tgt_int_stats", 0400, priv->debug.debugfs_phy,
priv, &fops_tgt_int_stats);
debugfs_create_file("tgt_tx_stats", S_IRUSR, priv->debug.debugfs_phy,
debugfs_create_file("tgt_tx_stats", 0400, priv->debug.debugfs_phy,
priv, &fops_tgt_tx_stats);
debugfs_create_file("tgt_rx_stats", S_IRUSR, priv->debug.debugfs_phy,
debugfs_create_file("tgt_rx_stats", 0400, priv->debug.debugfs_phy,
priv, &fops_tgt_rx_stats);
debugfs_create_file("xmit", S_IRUSR, priv->debug.debugfs_phy,
debugfs_create_file("xmit", 0400, priv->debug.debugfs_phy,
priv, &fops_xmit);
debugfs_create_file("skb_rx", S_IRUSR, priv->debug.debugfs_phy,
debugfs_create_file("skb_rx", 0400, priv->debug.debugfs_phy,
priv, &fops_skb_rx);

ath9k_cmn_debug_recv(priv->debug.debugfs_phy, &priv->debug.rx_stats);
ath9k_cmn_debug_phy_err(priv->debug.debugfs_phy, &priv->debug.rx_stats);

debugfs_create_file("slot", S_IRUSR, priv->debug.debugfs_phy,
debugfs_create_file("slot", 0400, priv->debug.debugfs_phy,
priv, &fops_slot);
debugfs_create_file("queue", S_IRUSR, priv->debug.debugfs_phy,
debugfs_create_file("queue", 0400, priv->debug.debugfs_phy,
priv, &fops_queue);
debugfs_create_file("debug", S_IRUSR | S_IWUSR, priv->debug.debugfs_phy,
debugfs_create_file("debug", 0600, priv->debug.debugfs_phy,
priv, &fops_debug);

ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah);
Expand Down
Loading

0 comments on commit 2ef00c5

Please sign in to comment.