Skip to contentSkip to conversation

Resend: [PATCH] rt2x00: Consolidate definition of CSR_OFFSET

PATCH NAK John Daiker 2 participants 2 messages Sep 19, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

Resend: Premature send to Linville only... this version copies linux-wireless and rt2400-devel.

This consolidates the definition of CSR_OFFSET when CONFIG_RT2X00_LIB_DEBUG is also set. The original definition appeared in 5 files, but was moved to a common
.h file instead.

Compile-tested only, as I don't have any rt2x00 HW in a working machine.

---

drivers/net/wireless/rt2x00/rt2400pci.c +0 -1
index 08cb9ee..ac4ae00 100644
@@ -188,7 +188,6 @@ static void rt2400pci_eepromregister_write(struct eeprom_93cx6 *eeprom)
 }
 
 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
-#define CSR_OFFSET(__word)	( CSR_REG_BASE + ((__word) * sizeof(u32)) )
 
 static void rt2400pci_read_csr(struct rt2x00_dev *rt2x00dev,
 			       const unsigned int word, u32 *data)
drivers/net/wireless/rt2x00/rt2500pci.c +0 -1
index ef42cc0..2efcfd3 100644
@@ -188,7 +188,6 @@ static void rt2500pci_eepromregister_write(struct eeprom_93cx6 *eeprom)
 }
 
 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
-#define CSR_OFFSET(__word)	( CSR_REG_BASE + ((__word) * sizeof(u32)) )
 
 static void rt2500pci_read_csr(struct rt2x00_dev *rt2x00dev,
 			       const unsigned int word, u32 *data)
drivers/net/wireless/rt2x00/rt2500usb.c +0 -1
index d3bf7bb..6883632 100644
@@ -245,7 +245,6 @@ rf_write:
 }
 
 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
-#define CSR_OFFSET(__word)	( CSR_REG_BASE + ((__word) * sizeof(u16)) )
 
 static void rt2500usb_read_csr(struct rt2x00_dev *rt2x00dev,
 			       const unsigned int word, u32 *data)
drivers/net/wireless/rt2x00/rt2x00.h +4 -0
index 1359a37..3d0ad2b 100644
@@ -67,6 +67,10 @@
 	do { } while (0)
 #endif /* CONFIG_RT2X00_DEBUG */
 
+#ifdef CONFIG_RT2X00_LIB_DEBUGFS
+#define CSR_OFFSET(__word)     (CSR_REG_BASE + ((__word) * sizeof(u32)))
+#endif /* CONFIG_RT2X00_LIB_DEBUGFS */
+
 /*
  * Various debug levels.
  * The debug levels PANIC and ERROR both indicate serious problems,
drivers/net/wireless/rt2x00/rt2x00queue.c +1 -1
index b7f4fe8..c0ec25a 100644
@@ -552,7 +552,7 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index)
 		queue->length++;
 	} else if (index == Q_INDEX_DONE) {
 		queue->length--;
-		queue->count ++;
+		queue->count++;
 	}
 
 	spin_unlock_irqrestore(&queue->lock, irqflags);
drivers/net/wireless/rt2x00/rt61pci.c +1 -2
index 2c36b91..2ce3f2c 100644
@@ -228,7 +228,6 @@ static void rt61pci_eepromregister_write(struct eeprom_93cx6 *eeprom)
 }
 
 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
-#define CSR_OFFSET(__word)	( CSR_REG_BASE + ((__word) * sizeof(u32)) )
 
 static void rt61pci_read_csr(struct rt2x00_dev *rt2x00dev,
 			     const unsigned int word, u32 *data)
@@ -1934,7 +1933,7 @@ static int rt61pci_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxd_w1)
 }
 
 static void rt61pci_fill_rxdone(struct queue_entry *entry,
-			        struct rxdone_entry_desc *rxdesc)
+				struct rxdone_entry_desc *rxdesc)
 {
 	struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
 	struct queue_entry_priv_pci *entry_priv = entry->priv_data;
drivers/net/wireless/rt2x00/rt73usb.c +1 -2
index 27dde3e..28a5cdf 100644
@@ -249,7 +249,6 @@ rf_write:
 }
 
 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
-#define CSR_OFFSET(__word)	( CSR_REG_BASE + ((__word) * sizeof(u32)) )
 
 static void rt73usb_read_csr(struct rt2x00_dev *rt2x00dev,
 			     const unsigned int word, u32 *data)
@@ -1685,7 +1684,7 @@ static int rt73usb_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxd_w1)
 }
 
 static void rt73usb_fill_rxdone(struct queue_entry *entry,
-			        struct rxdone_entry_desc *rxdesc)
+				struct rxdone_entry_desc *rxdesc)
 {
 	struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
 	struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
#1 lore raw
Quoted 2 lines · John Daiker

Resend: Premature send to Linville only... this version copies=20 linux-wireless and rt2400-devel.

I was in the BCC list, but here goes my official reply. :)

Quoted 3 lines

This consolidates the definition of CSR_OFFSET when=20 CONFIG_RT2X00_LIB_DEBUG is also set.
The original definition appeared in 5 files, but was moved to a commo=

n

Quoted 3 lines

.h file instead.
=20
Compile-tested only, as I don't have any rt2x00 HW in a working machi=

ne.

NACK
This patch does more then consolidating =A0the CRS_OFFSET definition si= nce it
changes several lines for adding/removing whitespaces as well. It completely breaks rt2500usb, and I really dislike using define names in rt2x00.h
while the define itself is declared in the register headers only (and is thus not really
visible in rt2x00.h, even though the compiler would accept it and it would work as
expected).

Ivo

Quoted 6 lines

=20
---
=20
=20
=20

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html