Various coding style fixes.
Add space after "if" and "for" and "else".
Don't check for non-NULL before calling kfree().
Remove unneeded initializors.

Signed-off-by Ivo van Doorn <[EMAIL PROTECTED]>

diff -U 3 -H -w -E -d -r -N -- 
wireless-2.6-rt2x00/drivers/net/wireless/rt2x00/rt2400pci.c 
wireless-2.6-rt2x00code/drivers/net/wireless/rt2x00/rt2400pci.c
--- wireless-2.6-rt2x00/drivers/net/wireless/rt2x00/rt2400pci.c 2006-02-12 
12:51:28.000000000 +0100
+++ wireless-2.6-rt2x00code/drivers/net/wireless/rt2x00/rt2400pci.c     
2006-02-12 13:52:56.000000000 +0100
@@ -115,8 +115,8 @@
        const struct rt2x00_pci *rt2x00pci,
        const u8 reg_id, const u8 value)
 {
-       u32             reg = 0;
-       u8              counter = 0;
+       u32             reg;
+       u8              counter;
 
        for(counter = 0; counter < REGISTER_BUSY_COUNT; counter++){
                rt2x00_register_read(rt2x00pci, BBPCSR, &reg);
@@ -144,7 +144,7 @@
        const u8 reg_id, u8 *value)
 {
        u32             reg = 0;
-       u8              counter = 0;
+       u8              counter;
 
        /*
         * First request the register we wish to read from.
@@ -171,8 +171,8 @@
 static void
 rt2x00_rf_write(const struct rt2x00_pci *rt2x00pci, const u32 value)
 {
-       u32             reg = 0;
-       u8              counter = 0;
+       u32             reg;
+       u8              counter;
 
        for(counter = 0; counter < REGISTER_BUSY_COUNT; counter++){
                rt2x00_register_read(rt2x00pci, RFCSR, &reg);
@@ -224,7 +224,7 @@
        const struct rt2x00_pci *rt2x00pci,
        const u16 data, const u16 count)
 {
-       u32     flags = 0;
+       u32     flags;
        u32     mask =  1 << (count - 1);
 
        rt2x00_register_read(rt2x00pci, CSR21, &flags);
@@ -265,8 +265,8 @@
 static void
 rt2x00_eeprom_shift_in_bits(const struct rt2x00_pci *rt2x00pci, u16 *data)
 {
-       u32     flags = 0;
-       u8      counter = 0;
+       u32     flags;
+       u8      counter;
 
        rt2x00_register_read(rt2x00pci, CSR21, &flags);
 
@@ -309,7 +309,7 @@
        const struct rt2x00_pci *rt2x00pci,
        const u8 word, u16 *data)
 {
-       u32     flags = 0;
+       u32     flags;
 
        /*
         * Clear all flags, and enable chip select.
@@ -371,7 +371,7 @@
 static void
 rt2400pci_config_mode(struct rt2x00_pci *rt2x00pci, int mode)
 {
-       u32                     reg = 0;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, RXCSR0, &reg);
 
@@ -475,8 +475,8 @@
 static void
 rt2400pci_config_antenna(struct rt2x00_pci *rt2x00pci, int antenna)
 {
-       u8                      reg_rx = 0;
-       u8                      reg_tx = 0;
+       u8                      reg_rx;
+       u8                      reg_tx;
 
        rt2x00_bbp_read(rt2x00pci, 4, &reg_rx);
        rt2x00_bbp_read(rt2x00pci, 1, &reg_tx);
@@ -493,14 +493,12 @@
                /* Diversity. */
                reg_rx = (reg_rx & 0xf9) | 0x02;
                reg_tx = (reg_tx & 0xfc) | 0x01;
-       }
-       else if(antenna == 1){
+       } else if (antenna == 1) {
                /* RX: Antenna B */
                reg_rx = (reg_rx & 0xf9) | 0x04;
                /* TX: Antenna A */
                reg_tx = (reg_tx & 0xfc) | 0x00;
-       }
-       else if(antenna == 2){
+       } else if (antenna == 2) {
                /* RX: Antenna A */
                reg_rx = (reg_rx & 0xf9) | 0x00;
                /* TX: Antenna B */
@@ -531,8 +529,8 @@
 static void
 rt2400pci_config_duration(struct rt2x00_pci *rt2x00pci, int short_slot_time)
 {
-       u32                     reg = 0;
-       u32                     value = 0;
+       u32                     reg;
+       u32                     value;
 
        short_slot_time = short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME;
 
@@ -564,8 +562,8 @@
        struct ieee80211_conf   *conf = ieee80211_get_hw_conf(
                pci_get_drvdata(rt2x00pci->pci_dev));
        u32                     reg[4];
-       u32                     value = 0;
-       u32                     preamble = 0;
+       u32                     value;
+       u32                     preamble;
 
        preamble = DEVICE_RATE_FIELD(rate, PREAMBLE)
                ? SHORT_PREAMBLE : PREAMBLE;
@@ -606,12 +604,12 @@
 {
        struct ieee80211_hdr    *ieee80211hdr =
                (struct ieee80211_hdr*)skb->data;
-       u32                     length = 0;
-       u32                     residual = 0;
-       u16                     length_high = 0;
-       u16                     length_low = 0;
-       u16                     signal = 0;
-       u16                     service = 0;
+       u32                     length;
+       u32                     residual;
+       u16                     length_high;
+       u16                     length_low;
+       u16                     signal;
+       u16                     service;
 
        /*
         * Update rate control register.
@@ -679,11 +677,11 @@
        length_high = 0x8000 | 0x0700 | (length >> 8);
        length_low = 0x8000 | 0x0800 | (length & 0xff);
 
-       signal |= 0x8500 | DEVICE_RATE_FIELD(control->tx_rate, PLCP);
+       signal = 0x8500 | DEVICE_RATE_FIELD(control->tx_rate, PLCP);
        if(DEVICE_RATE_FIELD(control->tx_rate, PREAMBLE))
                signal |= 0x0008;
 
-       service |= 0x0600 | 0x0004;
+       service = 0x0600 | 0x0004;
        if(residual <= (8 % 11))
                service |= 0x0080;
 
@@ -707,7 +705,7 @@
        struct data_ring        *ring = (struct data_ring*)data;
        struct rt2x00_pci       *rt2x00pci = (struct rt2x00_pci*)ring->dev;
        struct net_device       *net_dev = pci_get_drvdata(rt2x00pci->pci_dev);
-       struct sk_buff          *skb = NULL;
+       struct sk_buff          *skb;
        struct ieee80211_tx_control     beacon;
 
        memset(&beacon, 0x00, sizeof(beacon));
@@ -730,10 +728,10 @@
        struct data_ring        *ring = (struct data_ring*)data;
        struct rt2x00_pci       *rt2x00pci = (struct rt2x00_pci*)ring->dev;
        struct net_device       *net_dev = pci_get_drvdata(rt2x00pci->pci_dev);
-       struct data_entry       *entry = NULL;
-       struct sk_buff          *skb = NULL;
-       struct rxd              *rxd = NULL;
-       u16                     size = 0;
+       struct data_entry       *entry;
+       struct sk_buff          *skb;
+       struct rxd              *rxd;
+       u16                     size;
 
        while(1){
                entry = rt2x00_get_data_entry(ring);
@@ -773,11 +771,11 @@
        struct data_ring        *ring = (struct data_ring*)data;
        struct rt2x00_pci       *rt2x00pci = (struct rt2x00_pci*)ring->dev;
        struct net_device       *net_dev = pci_get_drvdata(rt2x00pci->pci_dev);
-       struct data_entry       *entry = NULL;
-       struct skb_cb           *cb = NULL;
-       struct txd              *txd = NULL;
-       int                     tx_status = 0;
-       int                     ack = 0;
+       struct data_entry       *entry;
+       struct skb_cb           *cb;
+       struct txd              *txd;
+       int                     tx_status;
+       int                     ack;
 
        do{
                entry = rt2x00_get_data_entry_done(ring);
@@ -838,7 +836,7 @@
 rt2400pci_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
        struct rt2x00_pci       *rt2x00pci = (struct rt2x00_pci*)dev_instance;
-       u32                     reg = 0;
+       u32                     reg;
 
        /*
         * Get the interrupt sources & saved to local variable.
@@ -902,7 +900,7 @@
        const u16 desc_size)
 {
        struct data_entry       *entry = NULL;
-       u8                      counter = 0;
+       u8                      counter;
 
        /*
         *Set device structure.
@@ -974,7 +972,6 @@
                        ring->data_addr, ring->data_dma);
        ring->data_addr = NULL;
 
-       if(ring->entry)
                kfree(ring->entry);
        ring->entry = NULL;
 }
@@ -982,9 +979,9 @@
 static void
 rt2400pci_init_rxdesc(struct rt2x00_pci *rt2x00pci, struct data_ring *ring)
 {
-       struct data_entry       *entry = NULL;
-       struct rxd              *rxd = NULL;
-       u8                      counter = 0;
+       struct data_entry       *entry;
+       struct rxd              *rxd;
+       u8                      counter;
 
        memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
@@ -1005,9 +1002,9 @@
 static void
 rt2400pci_init_txdesc(struct rt2x00_pci *rt2x00pci, struct data_ring *ring)
 {
-       struct data_entry       *entry = NULL;
-       struct txd              *txd = NULL;
-       u8                      counter = 0;
+       struct data_entry       *entry;
+       struct txd              *txd;
+       u8                      counter;
 
        memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
@@ -1073,7 +1070,7 @@
 static int
 rt2400pci_init_ring(struct rt2x00_pci *rt2x00pci)
 {
-       u32             reg = 0;
+       u32             reg;
 
        reg = 0;
        rt2x00_set_field32(&reg, TXCSR2_TXD_SIZE, rt2x00pci->tx.desc_size);
@@ -1121,7 +1118,7 @@
 static int
 rt2400pci_init_registers(struct rt2x00_pci *rt2x00pci)
 {
-       u32             reg = 0;
+       u32             reg;
 
        rt2x00_register_write(rt2x00pci, PWRCSR0, cpu_to_le32(0x3f3b3100));
 
@@ -1215,9 +1212,9 @@
 static int
 rt2400pci_init_bbp(struct rt2x00_pci *rt2x00pci)
 {
-       u8              reg_id = 0;
-       u8              value = 0;
-       u8              counter = 0;
+       u8              reg_id;
+       u8              value;
+       u8              counter;
 
        for(counter = 0; counter < REGISTER_BUSY_COUNT; counter++){
                rt2x00_bbp_read(rt2x00pci, 0, &value);
@@ -1271,10 +1268,10 @@
        struct sk_buff *skb, struct ieee80211_tx_control *control)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       struct data_ring        *ring = NULL;
-       struct data_entry       *entry = NULL;
-       struct txd              *txd = NULL;
-       u32                     reg = 0;
+       struct data_ring        *ring;
+       struct data_entry       *entry;
+       struct txd              *txd;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, TXCSR0, &reg);
 
@@ -1321,7 +1318,7 @@
 rt2400pci_reset(struct net_device *net_dev)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        /*
         * Cancel RX and TX.
@@ -1363,7 +1360,7 @@
 rt2400pci_open(struct net_device *net_dev)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        /*
         * Allocate all data rings.
@@ -1420,7 +1417,7 @@
 rt2400pci_stop(struct net_device *net_dev)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        rt2x00_register_write(rt2x00pci, PWRCSR0, 0);
 
@@ -1502,7 +1499,7 @@
 {
        struct rt2x00_pci       *rt2x00pci = data;
        struct net_device       *net_dev = pci_get_drvdata(rt2x00pci->pci_dev);
-       struct skb_cb           *cb = NULL;
+       struct skb_cb           *cb;
 
        if(unlikely(!rt2x00pci->scan))
                return;
@@ -1598,7 +1595,7 @@
        struct ieee80211_low_level_stats *stats)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        /*
         * Update FCS error count from register.
@@ -1639,7 +1636,7 @@
        u32 short_retry, u32 long_retry)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, CSR11, &reg);
        rt2x00_set_field32(&reg, CSR11_LONG_RETRY, long_retry);
@@ -1654,7 +1651,7 @@
        int queue, const struct ieee80211_tx_queue_params *params)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       struct data_ring        *ring = NULL;
+       struct data_ring        *ring;
 
        if(queue == IEEE80211_TX_QUEUE_DATA0)
                ring = &rt2x00pci->prio;
@@ -1704,8 +1701,8 @@
 rt2400pci_get_tsf(struct net_device *net_dev)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u64                     tsf = 0;
-       u32                     reg = 0;
+       u64                     tsf;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, CSR17, &reg);
        tsf = (u64)rt2x00_get_field32(reg, CSR17_HIGH_TSFTIMER) << 32;
@@ -1741,7 +1738,7 @@
        struct sk_buff *skb, struct ieee80211_tx_control *control)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       struct data_entry       *entry = NULL;
+       struct data_entry       *entry;
 
        entry = rt2x00_get_data_entry(&rt2x00pci->beacon);
 
@@ -1762,7 +1759,7 @@
 rt2400pci_tx_last_beacon(struct net_device *net_dev)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, CSR15, &reg);
        return rt2x00_get_field32(reg, CSR15_BEACON_SENT);
@@ -1776,10 +1773,10 @@
 {
        struct ieee80211_conf   *conf = ieee80211_get_hw_conf(
                        pci_get_drvdata(rt2x00pci->pci_dev));
-       u32                     reg = 0;
-       u16                     value = 0;
-       u16                     eeprom  = 0;
-       int                     counter = 0;
+       u32                     reg;
+       u16                     value;
+       u16                     eeprom;
+       int                     counter;
 
        /*
         * 1 - Detect EEPROM width.
@@ -1846,7 +1843,7 @@
 {
        struct net_device       *net_dev = pci_get_drvdata(
                                                rt2x00pci->pci_dev);
-       u32                     reg[2] = { 0, 0 };
+       u32                     reg[2];
 
        rt2x00_register_multiread(rt2x00pci, CSR3, &reg[0], sizeof(reg));
 
@@ -1866,8 +1863,8 @@
 rt2400pci_init_hw_channels(struct rt2x00_pci *rt2x00pci,
        struct ieee80211_channel *channels)
 {
-       int                             counter = 0;
-       u16                             eeprom = 0;
+       int                             counter;
+       u16                             eeprom;
        u32 vals[] = {
                0x000c1fda, 0x000c1fee, 0x000c2002, 0x000c2016,
                0x000c202a, 0x000c203e, 0x000c2052, 0x000c2066,
@@ -2163,9 +2160,7 @@
        }
 
        if(likely(rt2x00pci->hw.modes)){
-               if(likely(rt2x00pci->hw.modes->channels))
                        kfree(rt2x00pci->hw.modes->channels);
-               if(likely(rt2x00pci->hw.modes->rates))
                        kfree(rt2x00pci->hw.modes->rates);
                kfree(rt2x00pci->hw.modes);
                rt2x00pci->hw.modes = NULL;
@@ -2178,9 +2173,9 @@
 static int
 rt2400pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
 {
-       struct net_device       *net_dev = NULL;
-       struct rt2x00_pci       *rt2x00pci = NULL;
-       int                     status = 0;
+       struct net_device       *net_dev;
+       struct rt2x00_pci       *rt2x00pci;
+       int                     status;
 
        if(unlikely(id->driver_data != RT2460)){
                ERROR("Detected device not supported.\n");
@@ -2271,7 +2266,6 @@
 }
 
 #ifdef CONFIG_PM
-static int rt2400pci_suspend(struct pci_dev *pci_dev, pm_message_t state);
 static int rt2400pci_resume(struct pci_dev *pci_dev);
 
 static int
@@ -2279,8 +2273,8 @@
 {
        struct net_device       *net_dev = pci_get_drvdata(pci_dev);
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       int                     counter = 0;
-       u32                     reg = 0;
+       int                     counter;
+       u32                     reg;
 
        NOTICE("Going to sleep.\n");
 
@@ -2330,7 +2324,7 @@
 {
        struct net_device       *net_dev = pci_get_drvdata(pci_dev);
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        NOTICE("Waking up.\n");
 
@@ -2356,7 +2350,7 @@
 static int
 rt2400pci_poll(struct rt2x00_pci *rt2x00pci)
 {
-       u32                     reg = 0;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, GPIOCSR, &reg);
        return rt2x00_get_field32(reg, GPIOCSR_BIT0);
@@ -2366,7 +2360,7 @@
 rt2400pci_poll_expire(unsigned long data)
 {
        struct rt2x00_pci       *rt2x00pci = (struct rt2x00_pci*)data;
-       u16                     status = 0;
+       u16                     status;
 
        status = rt2400pci_poll(rt2x00pci);
 
@@ -2415,6 +2409,9 @@
 #endif /* CONFIG_RT2400PCI_BUTTON */
 
 static struct pci_driver rt2400pci_driver = {
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 14)
+       .owner          = THIS_MODULE,
+#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 14) */
        .name           = DRV_NAME,
        .id_table       = rt2400pci_device_table,
        .probe          = rt2400pci_probe,
diff -U 3 -H -w -E -d -r -N -- 
wireless-2.6-rt2x00/drivers/net/wireless/rt2x00/rt2500pci.c 
wireless-2.6-rt2x00code/drivers/net/wireless/rt2x00/rt2500pci.c
--- wireless-2.6-rt2x00/drivers/net/wireless/rt2x00/rt2500pci.c 2006-02-12 
12:51:37.000000000 +0100
+++ wireless-2.6-rt2x00code/drivers/net/wireless/rt2x00/rt2500pci.c     
2006-02-12 13:53:40.000000000 +0100
@@ -114,8 +114,8 @@
        const struct rt2x00_pci *rt2x00pci,
        const u8 reg_id, const u8 value)
 {
-       u32             reg = 0;
-       u8              counter = 0;
+       u32             reg;
+       u8              counter;
 
        for(counter = 0; counter < REGISTER_BUSY_COUNT; counter++){
                rt2x00_register_read(rt2x00pci, BBPCSR, &reg);
@@ -143,7 +143,7 @@
        const u8 reg_id, u8 *value)
 {
        u32             reg = 0;
-       u8              counter = 0;
+       u8              counter;
 
        /*
         * First request the register we wish to read from.
@@ -170,8 +170,8 @@
 static void
 rt2x00_rf_write(const struct rt2x00_pci *rt2x00pci, const u32 value)
 {
-       u32             reg = 0;
-       u8              counter = 0;
+       u32             reg;
+       u8              counter;
 
        for(counter = 0; counter < REGISTER_BUSY_COUNT; counter++){
                rt2x00_register_read(rt2x00pci, RFCSR, &reg);
@@ -223,7 +223,7 @@
        const struct rt2x00_pci *rt2x00pci,
        const u16 data, const u16 count)
 {
-       u32     flags = 0;
+       u32     flags;
        u32     mask =  1 << (count - 1);
 
        rt2x00_register_read(rt2x00pci, CSR21, &flags);
@@ -264,8 +264,8 @@
 static void
 rt2x00_eeprom_shift_in_bits(const struct rt2x00_pci *rt2x00pci, u16 *data)
 {
-       u32     flags = 0;
-       u8      counter = 0;
+       u32     flags;
+       u8      counter;
 
        rt2x00_register_read(rt2x00pci, CSR21, &flags);
 
@@ -308,7 +308,7 @@
        const struct rt2x00_pci *rt2x00pci,
        const u8 word, u16 *data)
 {
-       u32     flags = 0;
+       u32     flags;
 
        /*
         * Clear all flags, and enable chip select.
@@ -370,7 +370,7 @@
 static void
 rt2500pci_config_mode(struct rt2x00_pci *rt2x00pci, int mode)
 {
-       u32                     reg = 0;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, RXCSR0, &reg);
 
@@ -497,8 +497,8 @@
 static void
 rt2500pci_config_antenna(struct rt2x00_pci *rt2x00pci, int antenna)
 {
-       u8                      reg_rx = 0;
-       u8                      reg_tx = 0;
+       u8                      reg_rx;
+       u8                      reg_tx;
 
        rt2x00_bbp_read(rt2x00pci, 14, &reg_rx);
        rt2x00_bbp_read(rt2x00pci, 2, &reg_tx);
@@ -515,14 +515,12 @@
                /* Diversity. */
                reg_rx = (reg_rx & 0xf9) | 0x02;
                reg_tx = (reg_tx & 0xfc) | 0x01;
-       }
-       else if(antenna == 1){
+       } else if (antenna == 1) {
                /* RX: Antenna B */
                reg_rx = (reg_rx & 0xf9) | 0x04;
                /* TX: Antenna A */
                reg_tx = (reg_tx & 0xfc) | 0x00;
-       }
-       else if(antenna == 2){
+       } else if (antenna == 2) {
                /* RX: Antenna A */
                reg_rx = (reg_rx & 0xf9) | 0x00;
                /* TX: Antenna B */
@@ -541,8 +539,8 @@
 static void
 rt2500pci_config_duration(struct rt2x00_pci *rt2x00pci, int short_slot_time)
 {
-       u32                     reg = 0;
-       u32                     value = 0;
+       u32                     reg;
+       u32                     value;
 
        short_slot_time = short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME;
 
@@ -574,8 +572,8 @@
        struct ieee80211_conf   *conf = ieee80211_get_hw_conf(
                pci_get_drvdata(rt2x00pci->pci_dev));
        u32                     reg[4];
-       u32                     value = 0;
-       u32                     preamble = 0;
+       u32                     value;
+       u32                     preamble;
 
        preamble = DEVICE_RATE_FIELD(rate, PREAMBLE)
                ? SHORT_PREAMBLE : PREAMBLE;
@@ -617,13 +615,13 @@
        struct ieee80211_hdr    *ieee80211hdr =
                (struct ieee80211_hdr*)skb->data;
        struct ieee80211_tx_queue_params        *params = NULL;
-       u32                     length = 0;
-       u32                     residual = 0;
-       u16                     length_high = 0;
-       u16                     length_low = 0;
-       u16                     signal = 0;
-       u16                     service = 0;
-       u8                      rate = 0;
+       u32                     length;
+       u32                     residual;
+       u16                     length_high;
+       u16                     length_low;
+       u16                     signal;
+       u16                     service;
+       u8                      rate;
 
        /*
         * Update rate control register.
@@ -687,9 +685,11 @@
         */
        if(DEVICE_RATE_FIELD(control->tx_rate, RATEMASK) & 0x0ff0){
                rt2x00_set_field32(&txd->word0, TXD_W0_OFDM, 1);
+
                /*
                 * Convert length to microseconds.
                 */
+               residual = 0;
                length_high = (length >> 6) & 0x3f;
                length_low = (length & 0x3f);
 
@@ -708,11 +708,11 @@
                length_low = length & 0xff;
        }
 
-       signal |= 0x8500 | DEVICE_RATE_FIELD(control->tx_rate, PLCP);
+       signal = 0x8500 | DEVICE_RATE_FIELD(control->tx_rate, PLCP);
        if(DEVICE_RATE_FIELD(control->tx_rate, PREAMBLE))
                signal |= 0x0008;
 
-       service |= 0x0600 | 0x0004;
+       service = 0x0600 | 0x0004;
        if(residual <= (8 % 11))
                service |= 0x0080;
 
@@ -736,7 +736,7 @@
        struct data_ring        *ring = (struct data_ring*)data;
        struct rt2x00_pci       *rt2x00pci = (struct rt2x00_pci*)ring->dev;
        struct net_device       *net_dev = pci_get_drvdata(rt2x00pci->pci_dev);
-       struct sk_buff          *skb = NULL;
+       struct sk_buff          *skb;
        struct ieee80211_tx_control     beacon;
 
        memset(&beacon, 0x00, sizeof(beacon));
@@ -759,10 +759,10 @@
        struct data_ring        *ring = (struct data_ring*)data;
        struct rt2x00_pci       *rt2x00pci = (struct rt2x00_pci*)ring->dev;
        struct net_device       *net_dev = pci_get_drvdata(rt2x00pci->pci_dev);
-       struct data_entry       *entry = NULL;
-       struct sk_buff          *skb = NULL;
-       struct rxd              *rxd = NULL;
-       u16                     size = 0;
+       struct data_entry       *entry;
+       struct sk_buff          *skb;
+       struct rxd              *rxd;
+       u16                     size;
 
        while(1){
                entry = rt2x00_get_data_entry(ring);
@@ -801,11 +801,11 @@
        struct data_ring        *ring = (struct data_ring*)data;
        struct rt2x00_pci       *rt2x00pci = (struct rt2x00_pci*)ring->dev;
        struct net_device       *net_dev = pci_get_drvdata(rt2x00pci->pci_dev);
-       struct data_entry       *entry = NULL;
-       struct skb_cb           *cb = NULL;
-       struct txd              *txd = NULL;
-       int                     tx_status = 0;
-       int                     ack = 0;
+       struct data_entry       *entry;
+       struct skb_cb           *cb;
+       struct txd              *txd;
+       int                     tx_status;
+       int                     ack;
 
        do{
                entry = rt2x00_get_data_entry_done(ring);
@@ -866,7 +866,7 @@
 rt2500pci_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
        struct rt2x00_pci       *rt2x00pci = (struct rt2x00_pci*)dev_instance;
-       u32                     reg = 0;
+       u32                     reg;
 
        /*
         * Get the interrupt sources & saved to local variable.
@@ -929,8 +929,8 @@
        const u16 data_size,
        const u16 desc_size)
 {
-       struct data_entry       *entry = NULL;
-       u8                      counter = 0;
+       struct data_entry       *entry;
+       u8                      counter;
 
        /*
         *Set device structure.
@@ -1003,7 +1003,6 @@
                        ring->data_addr, ring->data_dma);
        ring->data_addr = NULL;
 
-       if(ring->entry)
                kfree(ring->entry);
        ring->entry = NULL;
 }
@@ -1011,9 +1010,9 @@
 static void
 rt2500pci_init_rxdesc(struct rt2x00_pci *rt2x00pci, struct data_ring *ring)
 {
-       struct data_entry       *entry = NULL;
-       struct rxd              *rxd = NULL;
-       u8                      counter = 0;
+       struct data_entry       *entry;
+       struct rxd              *rxd;
+       u8                      counter;
 
        memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
@@ -1032,9 +1031,9 @@
 static void
 rt2500pci_init_txdesc(struct rt2x00_pci *rt2x00pci, struct data_ring *ring)
 {
-       struct data_entry       *entry = NULL;
-       struct txd              *txd = NULL;
-       u8                      counter = 0;
+       struct data_entry       *entry;
+       struct txd              *txd;
+       u8                      counter;
 
        memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
@@ -1098,7 +1097,7 @@
 static int
 rt2500pci_init_ring(struct rt2x00_pci *rt2x00pci)
 {
-       u32             reg = 0;
+       u32             reg;
 
        reg = 0;
        rt2x00_set_field32(&reg, TXCSR2_TXD_SIZE, rt2x00pci->tx.desc_size);
@@ -1146,7 +1145,7 @@
 static int
 rt2500pci_init_registers(struct rt2x00_pci *rt2x00pci)
 {
-       u32             reg = 0;
+       u32             reg;
 
        rt2x00_register_write(rt2x00pci, PWRCSR0, cpu_to_le32(0x3f3b3100));
 
@@ -1262,9 +1261,9 @@
 static int
 rt2500pci_init_bbp(struct rt2x00_pci *rt2x00pci)
 {
-       u8              reg_id = 0;
-       u8              value = 0;
-       u8              counter = 0;
+       u8              reg_id;
+       u8              value;
+       u8              counter;
 
        for(counter = 0; counter < REGISTER_BUSY_COUNT; counter++){
                rt2x00_bbp_read(rt2x00pci, 0, &value);
@@ -1334,10 +1333,10 @@
        struct sk_buff *skb, struct ieee80211_tx_control *control)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       struct data_ring        *ring = NULL;
-       struct data_entry       *entry = NULL;
-       struct txd              *txd = NULL;
-       u32                     reg = 0;
+       struct data_ring        *ring;
+       struct data_entry       *entry;
+       struct txd              *txd;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, TXCSR0, &reg);
 
@@ -1377,7 +1376,7 @@
 rt2500pci_reset(struct net_device *net_dev)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        /*
         * Cancel RX and TX.
@@ -1419,7 +1418,7 @@
 rt2500pci_open(struct net_device *net_dev)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        /*
         * Allocate all data rings.
@@ -1476,7 +1475,7 @@
 rt2500pci_stop(struct net_device *net_dev)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        rt2x00_register_write(rt2x00pci, PWRCSR0, 0);
 
@@ -1558,7 +1557,7 @@
 {
        struct rt2x00_pci       *rt2x00pci = data;
        struct net_device       *net_dev = pci_get_drvdata(rt2x00pci->pci_dev);
-       struct skb_cb           *cb = NULL;
+       struct skb_cb           *cb;
 
        if(unlikely(!rt2x00pci->scan))
                return;
@@ -1650,7 +1649,7 @@
        struct ieee80211_low_level_stats *stats)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        /*
         * Update FCS error count from register.
@@ -1691,7 +1690,7 @@
        u32 short_retry, u32 long_retry)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, CSR11, &reg);
        rt2x00_set_field32(&reg, CSR11_LONG_RETRY, long_retry);
@@ -1706,7 +1705,7 @@
        int queue, const struct ieee80211_tx_queue_params *params)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       struct data_ring        *ring = NULL;
+       struct data_ring        *ring;
 
        if(queue == IEEE80211_TX_QUEUE_DATA0)
                ring = &rt2x00pci->prio;
@@ -1755,8 +1754,8 @@
 rt2500pci_get_tsf(struct net_device *net_dev)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u64                     tsf = 0;
-       u32                     reg = 0;
+       u64                     tsf;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, CSR17, &reg);
        tsf = (u64)rt2x00_get_field32(reg, CSR17_HIGH_TSFTIMER) << 32;
@@ -1792,7 +1791,7 @@
        struct sk_buff *skb, struct ieee80211_tx_control *control)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       struct data_entry       *entry = NULL;
+       struct data_entry       *entry;
 
        entry = rt2x00_get_data_entry(&rt2x00pci->beacon);
 
@@ -1813,7 +1812,7 @@
 rt2500pci_tx_last_beacon(struct net_device *net_dev)
 {
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, CSR15, &reg);
        return rt2x00_get_field32(reg, CSR15_BEACON_SENT);
@@ -1827,10 +1826,10 @@
 {
        struct ieee80211_conf   *conf = ieee80211_get_hw_conf(
                        pci_get_drvdata(rt2x00pci->pci_dev));
-       u32                     reg = 0;
-       u16                     value = 0;
-       u16                     eeprom  = 0;
-       int                     counter = 0;
+       u32                     reg;
+       u16                     value;
+       u16                     eeprom;
+       int                     counter;
 
        /*
         * 1 - Detect EEPROM width.
@@ -1901,7 +1900,7 @@
 {
        struct net_device       *net_dev = pci_get_drvdata(
                                                rt2x00pci->pci_dev);
-       u32                     reg[2] = { 0, 0 };
+       u32                     reg[2];
 
        rt2x00_register_multiread(rt2x00pci, CSR3, &reg[0], sizeof(reg));
 
@@ -1921,9 +1920,9 @@
 rt2500pci_init_hw_channels(struct rt2x00_pci *rt2x00pci,
        struct ieee80211_channel *channels)
 {
-       int                             counter = 0;
-       u16                             eeprom = 0;
-       u32                             rf2_base = 0;
+       int                             counter;
+       u16                             eeprom;
+       u32                             rf2_base;
        struct {
                unsigned int chip;
                u32 val[3];
@@ -1975,6 +1974,7 @@
        /*
         * Set device specific value.
         */
+       rf2_base = 0;
        if(rt2x00_rf(&rt2x00pci->chip, RF2525)
        || rt2x00_rf(&rt2x00pci->chip, RF2525E))
                rf2_base = 0x00080000;
@@ -2402,11 +2402,9 @@
                rt2x00pci->workqueue = NULL;
        }
 
-       if(likely(rt2x00pci->hw.modes)){
                kfree(rt2x00pci->hw.modes);
                rt2x00pci->hw.modes = NULL;
        }
-}
 
 /*
  * PCI driver handlers.
@@ -2414,9 +2412,9 @@
 static int
 rt2500pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
 {
-       struct net_device       *net_dev = NULL;
-       struct rt2x00_pci       *rt2x00pci = NULL;
-       int                     status = 0;
+       struct net_device       *net_dev;
+       struct rt2x00_pci       *rt2x00pci;
+       int                     status;
 
        if(unlikely(id->driver_data != RT2560)){
                ERROR("Detected device not supported.\n");
@@ -2507,7 +2505,6 @@
 }
 
 #ifdef CONFIG_PM
-static int rt2500pci_suspend(struct pci_dev *pci_dev, pm_message_t state);
 static int rt2500pci_resume(struct pci_dev *pci_dev);
 
 static int
@@ -2515,8 +2512,8 @@
 {
        struct net_device       *net_dev = pci_get_drvdata(pci_dev);
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       int                     counter = 0;
-       u32                     reg = 0;
+       int                     counter;
+       u32                     reg;
 
        NOTICE("Going to sleep.\n");
 
@@ -2566,7 +2563,7 @@
 {
        struct net_device       *net_dev = pci_get_drvdata(pci_dev);
        struct rt2x00_pci       *rt2x00pci = ieee80211_dev_hw_data(net_dev);
-       u32                     reg = 0;
+       u32                     reg;
 
        NOTICE("Waking up.\n");
 
@@ -2592,7 +2589,7 @@
 static int
 rt2500pci_poll(struct rt2x00_pci *rt2x00pci)
 {
-       u32                     reg = 0;
+       u32                     reg;
 
        rt2x00_register_read(rt2x00pci, GPIOCSR, &reg);
        return rt2x00_get_field32(reg, GPIOCSR_BIT0);
@@ -2602,7 +2599,7 @@
 rt2500pci_poll_expire(unsigned long data)
 {
        struct rt2x00_pci       *rt2x00pci = (struct rt2x00_pci*)data;
-       u16                     status = 0;
+       u16                     status;
 
        status = rt2500pci_poll(rt2x00pci);
 
@@ -2651,6 +2648,9 @@
 #endif /* CONFIG_RT2500PCI_BUTTON */
 
 static struct pci_driver rt2500pci_driver = {
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 14)
+       .owner          = THIS_MODULE,
+#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 14) */
        .name           = DRV_NAME,
        .id_table       = rt2500pci_device_table,
        .probe          = rt2500pci_probe,
diff -U 3 -H -w -E -d -r -N -- 
wireless-2.6-rt2x00/drivers/net/wireless/rt2x00/rt2500usb.c 
wireless-2.6-rt2x00code/drivers/net/wireless/rt2x00/rt2500usb.c
--- wireless-2.6-rt2x00/drivers/net/wireless/rt2x00/rt2500usb.c 2006-02-12 
12:51:43.000000000 +0100
+++ wireless-2.6-rt2x00code/drivers/net/wireless/rt2x00/rt2500usb.c     
2006-02-12 13:54:06.000000000 +0100
@@ -79,9 +79,9 @@
 {
        struct usb_device       *usb_dev =
                interface_to_usbdev(rt2x00usb->usb_intf);
-       unsigned int            pipe = 0;
-       int                     status = 0;
-       u8                      counter = 0;
+       unsigned int            pipe;
+       int                     status;
+       u8                      counter;
 
        if(type == USB_VENDOR_REQUEST_IN)
                pipe = usb_rcvctrlpipe(usb_dev, 0);
@@ -145,10 +145,10 @@
        const struct rt2x00_usb *rt2x00usb,
        const u8 reg_id, const u8 value)
 {
-       u16             reg = 0;
-       u8              counter = 0;
+       u16             reg;
+       u8              counter;
 
-       for(counter = 0x00; counter < REGISTER_BUSY_COUNT; counter++){
+       for (counter = 0; counter < REGISTER_BUSY_COUNT; counter++) {
                rt2x00_register_read(rt2x00usb, PHY_CSR8, &reg);
                if(!rt2x00_get_field16_nb(reg, PHY_CSR8_BBP_BUSY))
                        goto bbp_write;
@@ -172,8 +172,8 @@
        const struct rt2x00_usb *rt2x00usb,
        const u8 reg_id, u8 *value)
 {
-       u16             reg = 0;
-       u8              counter = 0;
+       u16             reg;
+       u8              counter;
 
        /*
         * First request the register we wish to read from.
@@ -183,7 +183,7 @@
 
        rt2x00_register_write(rt2x00usb, PHY_CSR7, reg);
 
-       for(counter = 0x00; counter < REGISTER_BUSY_COUNT; counter++){
+       for (counter = 0; counter < REGISTER_BUSY_COUNT; counter++) {
                rt2x00_register_read(rt2x00usb, PHY_CSR8, &reg);
                if(!rt2x00_get_field16_nb(reg, PHY_CSR8_BBP_BUSY)){
                        rt2x00_register_read(rt2x00usb, PHY_CSR7, &reg);
@@ -200,10 +200,10 @@
 static void
 rt2x00_rf_write(const struct rt2x00_usb *rt2x00usb, const u32 value)
 {
-       u16             reg = 0;
-       u8              counter = 0;
+       u16             reg;
+       u8              counter;
 
-       for(counter = 0x00; counter < REGISTER_BUSY_COUNT; counter++){
+       for (counter = 0; counter < REGISTER_BUSY_COUNT; counter++) {
                rt2x00_register_read(rt2x00usb, PHY_CSR10, &reg);
                if(!rt2x00_get_field16_nb(reg, PHY_CSR10_RF_BUSY))
                        goto rf_write;
@@ -256,7 +256,7 @@
 static void
 rt2500usb_config_mode(struct rt2x00_usb *rt2x00usb, int mode)
 {
-       u16                     reg = 0;
+       u16                     reg;
 
        rt2x00_register_read(rt2x00usb, TXRX_CSR2, &reg);
 
@@ -352,10 +352,10 @@
 static void
 rt2500usb_config_antenna(struct rt2x00_usb *rt2x00usb, int antenna)
 {
-       u8                      reg_rx = 0;
-       u8                      reg_tx = 0;
-       u16                     csr5_reg = 0;
-       u16                     csr6_reg = 0;
+       u8                      reg_rx;
+       u8                      reg_tx;
+       u16                     csr5_reg;
+       u16                     csr6_reg;
 
        rt2x00_bbp_read(rt2x00usb, 2, &reg_tx);
        rt2x00_bbp_read(rt2x00usb, 14, &reg_rx);
@@ -378,16 +378,14 @@
                reg_tx |= 0x01;
                csr5_reg |= 0x0001;
                csr6_reg |= 0x0001;
-       }
-       else if(antenna == 1){
+       } else if (antenna == 1) {
                /* RX: Antenna B */
                reg_rx |= 0x02;
                /* TX: Antenna A */
                reg_tx |= 0x00;
                csr5_reg |= 0x0000;
                csr6_reg |= 0x0000;
-       }
-       else if(antenna == 2){
+       } else if (antenna == 2) {
                /* RX: Antenna A */
                reg_tx |= 0x02;
                csr5_reg |= 0x0002;
@@ -428,7 +426,7 @@
 static void
 rt2500usb_config_duration(struct rt2x00_usb *rt2x00usb, int short_slot_time)
 {
-       u16                     reg = 0;
+       u16                     reg;
 
        short_slot_time = short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME;
 
@@ -445,8 +443,8 @@
        struct ieee80211_conf   *conf = ieee80211_get_hw_conf(
                usb_get_intfdata(rt2x00usb->usb_intf));
        u16                     reg;
-       u16                     value = 0;
-       u16                     preamble = 0;
+       u16                     value;
+       u16                     preamble;
 
        preamble = DEVICE_RATE_FIELD(rate, PREAMBLE)
                ? SHORT_PREAMBLE : PREAMBLE;
@@ -482,13 +480,13 @@
        struct ieee80211_hdr    *ieee80211hdr =
                (struct ieee80211_hdr*)skb->data;
        struct ieee80211_tx_queue_params        *params = NULL;
-       u32                     length = 0;
-       u32                     residual = 0;
-       u8                      length_high = 0;
-       u8                      length_low = 0;
-       u8                      signal = 0;
-       u8                      service = 0;
-       u8                      rate = 0;
+       u32                     length;
+       u32                     residual;
+       u8                      length_high;
+       u8                      length_low;
+       u8                      signal;
+       u8                      service;
+       u8                      rate;
 
        /*
         * Update rate control register.
@@ -551,6 +549,7 @@
                /*
                 * Convert length to microseconds.
                 */
+               residual = 0;
                length_high = (length >> 6) & 0x3f;
                length_low = (length & 0x3f);
 
@@ -569,11 +568,11 @@
                length_low = length & 0xff;
        }
 
-       signal |= DEVICE_RATE_FIELD(control->tx_rate, PLCP);
+       signal = DEVICE_RATE_FIELD(control->tx_rate, PLCP);
        if(DEVICE_RATE_FIELD(control->tx_rate, PREAMBLE))
                signal |= 0x08;
 
-       service |= 0x04;
+       service = 0x04;
        if(residual <= (8 % 11))
                service |= 0x80;
 
@@ -593,7 +592,7 @@
        struct rt2x00_usb       *rt2x00usb = (struct rt2x00_usb*)ring->dev;
        struct net_device       *net_dev = usb_get_intfdata(
                                                rt2x00usb->usb_intf);
-       struct sk_buff          *skb = NULL;
+       struct sk_buff          *skb;
        struct ieee80211_tx_control     beacon;
 
        memset(&beacon, 0x00, sizeof(beacon));
@@ -617,10 +616,10 @@
        struct rt2x00_usb       *rt2x00usb = (struct rt2x00_usb*)ring->dev;
        struct net_device       *net_dev = usb_get_intfdata(
                                                rt2x00usb->usb_intf);
-       struct data_entry       *entry = NULL;
-       struct sk_buff          *skb = NULL;
-       struct rxd              *rxd = NULL;
-       u16                     size = 0;
+       struct data_entry       *entry;
+       struct sk_buff          *skb;
+       struct rxd              *rxd;
+       u16                     size;
 
        while(1){
                entry = rt2x00_get_data_entry(ring);
@@ -671,10 +670,10 @@
        struct rt2x00_usb       *rt2x00usb = (struct rt2x00_usb*)ring->dev;
        struct net_device       *net_dev = usb_get_intfdata(
                                                rt2x00usb->usb_intf);
-       struct data_entry       *entry = NULL;
-       struct skb_cb           *cb = NULL;
-       struct txd              *txd = NULL;
-       int                     ack = 0;
+       struct data_entry       *entry;
+       struct skb_cb           *cb;
+       struct txd              *txd;
+       int                     ack;
 
        do{
                entry = rt2x00_get_data_entry_done(ring);
@@ -741,8 +740,8 @@
        const u16 data_size,
        const u16 desc_size)
 {
-       struct data_entry       *entry = NULL;
-       u8                      counter = 0;
+       struct data_entry       *entry;
+       u8                      counter;
        int                     status = 0;
 
        /*
@@ -818,8 +817,8 @@
 static void
 rt2500usb_free_ring(struct rt2x00_usb *rt2x00usb, struct data_ring *ring)
 {
-       struct  data_entry      *entry = NULL;
-       u8                      counter = 0;
+       struct  data_entry      *entry;
+       u8                      counter;
 
        if(ring->entry)
                goto exit;
@@ -882,8 +881,8 @@
 {
        struct usb_device       *usb_dev =
                interface_to_usbdev(rt2x00usb->usb_intf);
-       struct data_entry       *entry = NULL;
-       u8                      counter = 0;
+       struct data_entry       *entry;
+       u8                      counter;
 
        /*
         * RX ring initialization.
@@ -980,7 +979,7 @@
 static int
 rt2500usb_init_registers(struct rt2x00_usb *rt2x00usb)
 {
-       u16                     reg = 0;
+       u16                     reg;
 
        rt2x00_vendor_request(rt2x00usb, USB_DEVICE_MODE,
                USB_VENDOR_REQUEST_OUT, USB_MODE_TEST, 0x00, NULL, 0);
@@ -1043,9 +1042,9 @@
 static int
 rt2500usb_init_bbp(struct rt2x00_usb *rt2x00usb)
 {
-       u8                      value = 0;
-       u8                      reg_id = 0;
-       u8                      counter = 0;
+       u8                      value;
+       u8                      reg_id;
+       u8                      counter;
 
        for(counter = 0; counter < REGISTER_BUSY_COUNT; counter++){
                rt2x00_bbp_read(rt2x00usb, 0, &value);
@@ -1116,9 +1115,9 @@
        struct sk_buff *skb, struct ieee80211_tx_control *control)
 {
        struct rt2x00_usb       *rt2x00usb = ieee80211_dev_hw_data(net_dev);
-       struct data_ring        *ring = NULL;
-       struct data_entry       *entry = NULL;
-       struct txd              *txd = NULL;
+       struct data_ring        *ring;
+       struct data_entry       *entry;
+       struct txd              *txd;
 
        if(control->queue == IEEE80211_TX_QUEUE_DATA0){
                ring = &rt2x00usb->prio;
@@ -1152,8 +1151,8 @@
 rt2500usb_reset(struct net_device *net_dev)
 {
        struct rt2x00_usb       *rt2x00usb = ieee80211_dev_hw_data(net_dev);
-       struct data_entry       *entry = NULL;
-       int                     counter = 0;
+       struct data_entry       *entry;
+       int                     counter;
        /*
         * Stop RX.
         */
@@ -1204,7 +1203,7 @@
 rt2500usb_open(struct net_device *net_dev)
 {
        struct rt2x00_usb       *rt2x00usb = ieee80211_dev_hw_data(net_dev);
-       u16                     reg = 0;
+       u16                     reg;
 
        /*
         * Allocate all data rings.
@@ -1242,9 +1241,9 @@
 rt2500usb_stop(struct net_device *net_dev)
 {
        struct rt2x00_usb       *rt2x00usb = ieee80211_dev_hw_data(net_dev);
-       struct data_entry       *entry = NULL;
-       int                     counter = 0;
-       u16                     reg = 0x0000;
+       struct data_entry       *entry;
+       int                     counter;
+       u16                     reg;
 
        /*
         * Cancel RX.
@@ -1318,7 +1317,7 @@
        struct rt2x00_usb       *rt2x00usb = data;
        struct net_device       *net_dev =
                usb_get_intfdata(rt2x00usb->usb_intf);
-       struct skb_cb           *cb = NULL;
+       struct skb_cb           *cb;
 
        if(unlikely(!rt2x00usb->scan))
                return;
@@ -1410,7 +1409,7 @@
        struct ieee80211_low_level_stats *stats)
 {
        struct rt2x00_usb       *rt2x00usb = ieee80211_dev_hw_data(net_dev);
-       u16                     reg = 0;
+       u16                     reg;
 
        /*
         * Update FCS error count from register.
@@ -1451,7 +1450,7 @@
        int queue, const struct ieee80211_tx_queue_params *params)
 {
        struct rt2x00_usb       *rt2x00usb = ieee80211_dev_hw_data(net_dev);
-       struct data_ring        *ring = NULL;
+       struct data_ring        *ring;
 
        if(queue == IEEE80211_TX_QUEUE_DATA0)
                ring = &rt2x00usb->prio;
@@ -1519,7 +1518,7 @@
        struct sk_buff *skb, struct ieee80211_tx_control *control)
 {
        struct rt2x00_usb       *rt2x00usb = ieee80211_dev_hw_data(net_dev);
-       struct data_entry       *entry = NULL;
+       struct data_entry       *entry;
 
        entry = rt2x00_get_data_entry(&rt2x00usb->beacon);
 
@@ -1546,7 +1545,7 @@
 {
        struct ieee80211_conf   *conf = ieee80211_get_hw_conf(
                        usb_get_intfdata(rt2x00usb->usb_intf));
-       u16                     eeprom = 0;
+       u16                     eeprom;
 
        /*
         * 1 - Read EEPROM word for configuration.
@@ -1589,7 +1588,7 @@
 {
        struct net_device       *net_dev = usb_get_intfdata(
                                                rt2x00usb->usb_intf);
-       u16                     reg[3] = { 0, 0, 0 };
+       u16                     reg[3];
 
        /*
         * Read MAC address from EEPROM.
@@ -1617,9 +1616,9 @@
 rt2500usb_init_hw_channels(struct rt2x00_usb *rt2x00usb,
        struct ieee80211_channel *channels)
 {
-       int                             counter = 0;
-       u16                             eeprom = 0;
-       u32                             rf2_base = 0;
+       int                             counter;
+       u16                             eeprom;
+       u32                             rf2_base;
        struct {
                unsigned int chip;
                u32 val[3];
@@ -1671,6 +1670,7 @@
        /*
         * Set device specific value.
         */
+       rf2_base = 0;
        if(rt2x00_rf(&rt2x00usb->chip, RF2525))
                rf2_base = 0x00080000;
 
@@ -2047,11 +2047,9 @@
                rt2x00usb->workqueue = NULL;
        }
 
-       if(likely(rt2x00usb->hw.modes)){
                kfree(rt2x00usb->hw.modes);
                rt2x00usb->hw.modes = NULL;
        }
-}
 
 /*
  * USB driver handlers.
@@ -2060,9 +2058,9 @@
 rt2500usb_probe(struct usb_interface *usb_intf, const struct usb_device_id *id)
 {
        struct usb_device       *usb_dev = interface_to_usbdev(usb_intf);
-       struct net_device       *net_dev = NULL;
-       struct rt2x00_usb       *rt2x00usb = NULL;
-       int                     status = 0;
+       struct net_device       *net_dev;
+       struct rt2x00_usb       *rt2x00usb;
+       int                     status;
 
        if(unlikely(id->driver_info != RT2570)){
                ERROR("Detected device not supported.\n");
@@ -2124,8 +2122,6 @@
 }
 
 #ifdef CONFIG_PM
-static int rt2500usb_suspend(
-       struct usb_interface *usb_intf, pm_message_t state);
 static int rt2500usb_resume(struct usb_interface *usb_intf);
 
 static int
@@ -2133,8 +2129,8 @@
 {
        struct net_device       *net_dev = usb_get_intfdata(usb_intf);
        struct rt2x00_usb       *rt2x00usb = ieee80211_dev_hw_data(net_dev);
-       int                     counter = 0;
-       u16                     reg = 0;
+       int                     counter;
+       u16                     reg;
 
        NOTICE("Going to sleep.\n");
 
@@ -2171,7 +2167,7 @@
 {
        struct net_device       *net_dev = usb_get_intfdata(usb_intf);
        struct rt2x00_usb       *rt2x00usb = ieee80211_dev_hw_data(net_dev);
-       u16                     reg = 0x0000;
+       u16                     reg;
 
        NOTICE("Waking up.\n");
 
@@ -2246,6 +2242,9 @@
 #endif /* CONFIG_RT2500USB_DEBUG */
 
 static struct usb_driver rt2500usb_driver = {
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 15)
+       .owner          = THIS_MODULE,
+#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 15) */
        .name           = DRV_NAME,
        .id_table       = rt2500usb_device_table,
        .probe          = rt2500usb_probe,
diff -U 3 -H -w -E -d -r -N -- 
wireless-2.6-rt2x00/drivers/net/wireless/rt2x00/rt2x00.h 
wireless-2.6-rt2x00code/drivers/net/wireless/rt2x00/rt2x00.h
--- wireless-2.6-rt2x00/drivers/net/wireless/rt2x00/rt2x00.h    2006-02-12 
12:51:28.000000000 +0100
+++ wireless-2.6-rt2x00code/drivers/net/wireless/rt2x00/rt2x00.h        
2006-02-12 13:52:56.000000000 +0100
@@ -506,7 +506,7 @@
 rt2x00_ring_index_inc(struct data_ring *ring)
 {
        ring->index++;
-       if(ring->index >= ring->stats.limit)
+       if (ring->index >= ring->stats.limit)
                ring->index = 0;
        ring->stats.len++;
 }
@@ -515,7 +515,7 @@
 rt2x00_ring_index_done_inc(struct data_ring *ring)
 {
        ring->index_done++;
-       if(ring->index_done >= ring->stats.limit)
+       if (ring->index_done >= ring->stats.limit)
                ring->index_done = 0;
        ring->stats.len--;
        ring->stats.count++;

Attachment: pgpHvlXxiwCXn.pgp
Description: PGP signature

Reply via email to