linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ath6kl: more checkpatch fixes
@ 2012-03-12 11:22 Kalle Valo
  2012-03-12 11:22 ` [PATCH 1/4] ath6kl: fix regression in ath6kl_upload_board_file() Kalle Valo
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Kalle Valo @ 2012-03-12 11:22 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl-devel, linux-wireless

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(-)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] ath6kl: fix regression in ath6kl_upload_board_file()
  2012-03-12 11:22 [PATCH 0/4] ath6kl: more checkpatch fixes Kalle Valo
@ 2012-03-12 11:22 ` Kalle Valo
  2012-03-12 11:23 ` [PATCH 2/4] ath6kl: replace strict_strtoul() with kstrtoul() Kalle Valo
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2012-03-12 11:22 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl-devel, linux-wireless

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.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/init.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 231675d..03cae14 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -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);
 	}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] ath6kl: replace strict_strtoul() with kstrtoul()
  2012-03-12 11:22 [PATCH 0/4] ath6kl: more checkpatch fixes Kalle Valo
  2012-03-12 11:22 ` [PATCH 1/4] ath6kl: fix regression in ath6kl_upload_board_file() Kalle Valo
@ 2012-03-12 11:23 ` Kalle Valo
  2012-03-12 11:23 ` [PATCH 3/4] ath6kl: fix open parenthesis alignment in ath6kl_sdio_suspend() Kalle Valo
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2012-03-12 11:23 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl-devel, linux-wireless

Recommended by checkpatch.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/debug.c |   19 ++-----------------
 1 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index 9170b05..552adb3 100755
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -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, &reg_addr))
+	if (kstrtoul_from_user(user_buf, count, 0, &reg_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;


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] ath6kl: fix open parenthesis alignment in ath6kl_sdio_suspend()
  2012-03-12 11:22 [PATCH 0/4] ath6kl: more checkpatch fixes Kalle Valo
  2012-03-12 11:22 ` [PATCH 1/4] ath6kl: fix regression in ath6kl_upload_board_file() Kalle Valo
  2012-03-12 11:23 ` [PATCH 2/4] ath6kl: replace strict_strtoul() with kstrtoul() Kalle Valo
@ 2012-03-12 11:23 ` Kalle Valo
  2012-03-12 11:23 ` [PATCH 4/4] ath6kl: use max_t() in ath6kl_cfg80211_connect() Kalle Valo
  2012-03-13 12:23 ` [PATCH 0/4] ath6kl: more checkpatch fixes Kalle Valo
  4 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2012-03-12 11:23 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl-devel, linux-wireless

ath6kl/sdio.c:875: CHECK: Alignment should match open parenthesis

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/sdio.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 5a03082..5352864 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -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;
 	}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] ath6kl: use max_t() in ath6kl_cfg80211_connect()
  2012-03-12 11:22 [PATCH 0/4] ath6kl: more checkpatch fixes Kalle Valo
                   ` (2 preceding siblings ...)
  2012-03-12 11:23 ` [PATCH 3/4] ath6kl: fix open parenthesis alignment in ath6kl_sdio_suspend() Kalle Valo
@ 2012-03-12 11:23 ` Kalle Valo
  2012-03-13 12:23 ` [PATCH 0/4] ath6kl: more checkpatch fixes Kalle Valo
  4 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2012-03-12 11:23 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl-devel, linux-wireless

ath6kl/cfg80211.c:589: WARNING: max() should probably be
max_t(u16, vif->listen_intvl_t, ATH6KL_MAX_WOW_LISTEN_INTL)

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 5ecc53a..00d3895 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -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);


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] ath6kl: more checkpatch fixes
  2012-03-12 11:22 [PATCH 0/4] ath6kl: more checkpatch fixes Kalle Valo
                   ` (3 preceding siblings ...)
  2012-03-12 11:23 ` [PATCH 4/4] ath6kl: use max_t() in ath6kl_cfg80211_connect() Kalle Valo
@ 2012-03-13 12:23 ` Kalle Valo
  4 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2012-03-13 12:23 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath6kl-devel, linux-wireless

On 03/12/2012 01:22 PM, Kalle Valo wrote:
> Few more checkpatch fixes and one fix for a regression from my previous
> checkpatch fixes.

Applied.

Kalle

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-13 12:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-12 11:22 [PATCH 0/4] ath6kl: more checkpatch fixes Kalle Valo
2012-03-12 11:22 ` [PATCH 1/4] ath6kl: fix regression in ath6kl_upload_board_file() Kalle Valo
2012-03-12 11:23 ` [PATCH 2/4] ath6kl: replace strict_strtoul() with kstrtoul() Kalle Valo
2012-03-12 11:23 ` [PATCH 3/4] ath6kl: fix open parenthesis alignment in ath6kl_sdio_suspend() Kalle Valo
2012-03-12 11:23 ` [PATCH 4/4] ath6kl: use max_t() in ath6kl_cfg80211_connect() Kalle Valo
2012-03-13 12:23 ` [PATCH 0/4] ath6kl: more checkpatch fixes Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).