Subject: [PATCH 1/6] rt2x00 update: Remove casts from void* pointers

From: Ivo van Doorn <[email-masked]>
Date: Fri, 28 Apr 2006 16:52:25 +0200

From: Ivo van Doorn <[email-masked]>

Remove unneeded casts when working with a void* pointer.

Signed-off-by: Ivo van Doorn <[email-masked]>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 15:09:53.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 15:13:49.000000000 +0200
@@ -917,7 +917,7 @@ rt2400pci_write_tx_desc(
 static void
 rt2400pci_beacondone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct sk_buff		*skb;
@@ -938,7 +938,7 @@ rt2400pci_beacondone(void *data)
 static void
 rt2400pci_rxdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -995,7 +995,7 @@ rt2400pci_rxdone(void *data)
 static void
 rt2400pci_txdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -1067,7 +1067,7 @@ rt2400pci_txdone(void *data)
 static irqreturn_t
 rt2400pci_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
-	struct rt2x00_pci	*rt2x00pci = (struct rt2x00_pci*)dev_instance;
+	struct rt2x00_pci	*rt2x00pci = dev_instance;
 	u32			reg;
 
 	/*
@@ -1187,7 +1187,7 @@ rt2400pci_alloc_ring(
 	 * Initialize all ring entries to contain valid
 	 * addresses.
 	 */
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		entry[counter].skb = NULL;
 		entry[counter].desc_addr = ring->data_addr
@@ -1275,7 +1275,7 @@ rt2400pci_init_rxdesc(struct rt2x00_pci 
 
 	memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		rxd = entry[counter].desc_addr;
 
@@ -1298,7 +1298,7 @@ rt2400pci_init_txdesc(struct rt2x00_pci 
 
 	memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		txd = entry[counter].desc_addr;
 
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 15:09:53.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 15:12:23.000000000 +0200
@@ -994,7 +994,7 @@ rt2500pci_write_tx_desc(
 static void
 rt2500pci_beacondone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct sk_buff		*skb;
@@ -1015,7 +1015,7 @@ rt2500pci_beacondone(void *data)
 static void
 rt2500pci_rxdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -1083,7 +1083,7 @@ rt2500pci_rxdone(void *data)
 static void
 rt2500pci_txdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -1155,7 +1155,7 @@ rt2500pci_txdone(void *data)
 static irqreturn_t
 rt2500pci_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
-	struct rt2x00_pci	*rt2x00pci = (struct rt2x00_pci*)dev_instance;
+	struct rt2x00_pci	*rt2x00pci = dev_instance;
 	u32			reg;
 
 	/*
@@ -1276,7 +1276,7 @@ rt2500pci_alloc_ring(
 	 * Initialize all ring entries to contain valid
 	 * addresses.
 	 */
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		entry[counter].skb = NULL;
 		entry[counter].desc_addr = ring->data_addr
@@ -1364,7 +1364,7 @@ rt2500pci_init_rxdesc(struct rt2x00_pci 
 
 	memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		rxd = entry[counter].desc_addr;
 
@@ -1385,7 +1385,7 @@ rt2500pci_init_txdesc(struct rt2x00_pci 
 
 	memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		txd = entry[counter].desc_addr;
 
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 15:09:53.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 15:13:01.000000000 +0200
@@ -818,7 +818,7 @@ rt2500usb_write_tx_desc(
 static void
 rt2500usb_beacondone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_usb	*rt2x00usb =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct sk_buff		*skb;
@@ -839,7 +839,7 @@ rt2500usb_beacondone(void *data)
 static void
 rt2500usb_rxdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_usb	*rt2x00usb =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -924,7 +924,7 @@ rt2500usb_rxdone(void *data)
 static void
 rt2500usb_txdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_usb	*rt2x00usb =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -1069,7 +1069,7 @@ rt2500usb_alloc_ring(
 	 * addresses.
 	 */
 	status = 0;
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		entry[counter].ring = ring;
 		if (!status)
@@ -1099,7 +1099,7 @@ rt2500usb_free_ring(struct rt2x00_usb *r
 	if (!ring->entry)
 		goto exit;
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		usb_kill_urb(entry[counter].urb);
 		usb_free_urb(entry[counter].urb);
@@ -1175,7 +1175,7 @@ rt2500usb_init_rxring(struct rt2x00_usb 
 	struct data_entry	*entry;
 	u8			counter;
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		entry[counter].urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 		entry[counter].urb->transfer_dma = entry[counter].data_dma;
@@ -1198,7 +1198,7 @@ rt2500usb_init_txring(struct rt2x00_usb 
 	struct data_entry	*entry;
 	u8			counter;
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		entry[counter].urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 		entry[counter].urb->transfer_dma = entry[counter].data_dma;
@@ -1410,7 +1410,7 @@ rt2500usb_reset_ring(struct data_ring *r
 	struct data_entry	*entry;
 	int			counter;
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++)
 		usb_kill_urb(entry[counter].urb);
 }