Thread (7 messages) read the whole thread 7 messages, 2 authors, 2011-08-31

Re: [PATCH 3/4] ath6kl: cleanup diagnose window read and write functions

From: Vasanthakumar Thiagarajan <hidden>
Date: 2011-08-30 15:00:24

On Tue, Aug 30, 2011 at 04:44:50PM +0300, Kalle Valo wrote:
Just to make them a bit easier to read and unify naming. 32 suffix
in the function name means that it will be a 32 bit transfer. If there's
no number a buffer is transfered instead.

Use void pointers to get rid of ugly casts.

Don't provide target address as a pointer, pass it by value. Same for
the value used in write32().

Signed-off-by: Kalle Valo <redacted>
---
 drivers/net/wireless/ath/ath6kl/core.h |    6 +-
 drivers/net/wireless/ath/ath6kl/init.c |   16 ++---
 drivers/net/wireless/ath/ath6kl/main.c |   94 ++++++++++++++++++--------------
 3 files changed, 61 insertions(+), 55 deletions(-)
<--snip-->
+int ath6kl_diag_write(struct ath6kl *ar, u32 address, void *data, u32 length)
+{
+	u32 count, *buf = data;
+	int ret;
+
+	if (WARN_ON(length % 4))
+		return -EINVAL;
+
+	for (count = 0; count < length / 4; count++, address += 4) {
+		ret = ath6kl_diag_write32(ar, address, buf[count]);
+		if (ret)
+			return ret;
 	}
 
-	return status;
+	return ret;
drivers/net/wireless/ath/ath6kl/main.c: In function ‘ath6kl_diag_write’:
drivers/net/wireless/ath/ath6kl/main.c:297: warning: ‘ret’ may be
used uninitialized in this function

Vasanth
quoted hunk ↗ jump to hunk
 }
 
 /* FIXME: move to a better place, target.h? */
@@ -327,7 +337,7 @@ static void ath6kl_reset_device(struct ath6kl *ar, u32 target_type,
 		break;
 	}
 
-	status = ath6kl_write_reg_diag(ar, &address, &data);
+	status = ath6kl_diag_write32(ar, address, data);
 
 	if (status)
 		ath6kl_err("failed to reset target\n");

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help