ath6kl: more checkpatch fixes
cover ath6kl: more checkpatch fixes
Few more checkpatch fixes and one fix for a regression from my previous checkpatch fixes.
---
Kalle Valo (4):
ath6kl: fix regression in ath6kl_upload_board_file()
ath6kl: replace strict_strtoul() with kstrtoul()
ath6kl: fix open parenthesis alignment in ath6kl_sdio_suspend()
ath6kl: use max_t() in ath6kl_cfg80211_connect()
drivers/net/wireless/ath/ath6kl/cfg80211.c | 4 ++-- drivers/net/wireless/ath/ath6kl/debug.c | 19 ++----------------- drivers/net/wireless/ath/ath6kl/init.c | 3 ++- drivers/net/wireless/ath/ath6kl/sdio.c | 9 +++++---- 4 files changed, 11 insertions(+), 24 deletions(-)
PATCH 1/4 ath6kl: fix regression in ath6kl_upload_board_file()
My patch 24fc32b3 ("ath6kl: add ath6kl_bmi_write_hi32()") caused a regression in ath6kl_upload_board_file() and the board_address variable was not properly initialised in some cases:
ath6kl/init.c:1068:6: warning: ‘board_address’ may be used uninitialized in this function
Most likely this broke ar6004 support but I can't test that right now.
--- drivers/net/wireless/ath/ath6kl/init.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath6kl/init.c +2 -1
@@ -1078,8 +1078,9 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)* writing board data. */ if (ar->hw.board_addr !=0 ) { + board_address = ar->hw.board_addr;ath6kl_bmi_write_hi32 (ar, hi_board_data, - ar->hw.board_addr); + board_address); }else {ath6kl_bmi_read_hi32 (ar, hi_board_data, &board_address); }
PATCH 2/4 ath6kl: replace strict_strtoul() with kstrtoul()
In reply to Kalle ValoRecommended by checkpatch.
--- drivers/net/wireless/ath/ath6kl/debug.c | 19 ++----------------- 1 files changed, 2 insertions(+), 17 deletions(-)
drivers/net/wireless/ath/ath6kl/debug.c +2 -17
@@ -856,17 +856,9 @@ static ssize_t ath6kl_regread_write(struct file *file, size_t count, loff_t *ppos) { struct ath6kl *ar = file->private_data; -u8 buf[50 ]; -unsigned int len;unsigned long reg_addr; - len =min (count,sizeof (buf) -1 ); -if (copy_from_user (buf, user_buf, len)) -return -EFAULT ; - - buf[len] ='\0' ; - -if (strict_strtoul (buf,0 , ®_addr)) +if (kstrtoul_from_user (user_buf, count,0 , ®_addr))return -EINVAL ;if ((reg_addr %4 ) !=0 )
@@ -980,15 +972,8 @@ static ssize_t ath6kl_lrssi_roam_write(struct file *file, {struct ath6kl *ar = file->private_data;unsigned long lrssi_roam_threshold; -char buf[32 ]; -ssize_t len; - len =min (count,sizeof (buf) -1 ); -if (copy_from_user (buf, user_buf, len)) -return -EFAULT ; - - buf[len] ='\0' ; -if (strict_strtoul (buf,0 , &lrssi_roam_threshold)) +if (kstrtoul_from_user (user_buf, count,0 , &lrssi_roam_threshold))return -EINVAL ; ar->lrssi_roam_threshold = lrssi_roam_threshold;
PATCH 3/4 ath6kl: fix open parenthesis alignment in ath6kl_sdio_suspend()
In reply to Kalle Valoath6kl/sdio.c:875: CHECK: Alignment should match open parenthesis
--- drivers/net/wireless/ath/ath6kl/sdio.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath6kl/sdio.c +5 -4
@@ -871,12 +871,13 @@ static int ath6kl_sdio_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow)if (ret && ret != -ENOTCONN )ath6kl_err ("wow suspend failed: %d\n" , ret); -if (ret && (!ar->wow_suspend_mode || - ar->wow_suspend_mode ==WLAN_POWER_STATE_DEEP_SLEEP )) - try_deepsleep = true; +if (ret && + (!ar->wow_suspend_mode || + ar->wow_suspend_mode ==WLAN_POWER_STATE_DEEP_SLEEP )) + try_deepsleep = true;else if (ret && ar->wow_suspend_mode ==WLAN_POWER_STATE_CUT_PWR ) - goto cut_pwr; + goto cut_pwr;if (!ret)return 0 ; }
PATCH 4/4 ath6kl: use max_t() in ath6kl_cfg80211_connect()
In reply to Kalle Valoath6kl/cfg80211.c:589: WARNING: max() should probably be max_t(u16, vif->listen_intvl_t, ATH6KL_MAX_WOW_LISTEN_INTL)
--- drivers/net/wireless/ath/ath6kl/cfg80211.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath6kl/cfg80211.c +2 -2
@@ -586,8 +586,8 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, vif->reconnect_flag =0 ;if (vif->nw_type ==INFRA_NETWORK ) { - interval =max (vif->listen_intvl_t, - (u16 )ATH6KL_MAX_WOW_LISTEN_INTL ); + interval =max_t (u16, vif->listen_intvl_t, +ATH6KL_MAX_WOW_LISTEN_INTL ); status =ath6kl_wmi_listeninterval_cmd (ar->wmi, vif->fw_vif_idx, interval,0 );
Kalle Valo
AppliedQuoted 2 lines · Kalle Valo
Few more checkpatch fixes and one fix for a regression from my previous checkpatch fixes.
Applied.
Kalle