aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2007-10-06 08:16:30 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:15 -0400
commit4f5af6eb3d17f8e343597ea99d97eb2f2905b2fb (patch)
tree7c35cacd6167c90a8846da2c04f64e56c8fd1f9f
parent5cbf830e137d1b6057cb6b553a8ebbb7d1b9343f (diff)
[PATCH] rt2x00: Small optimizations
Make some small optimizations by removing some simple if-statements. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c19
3 files changed, 13 insertions, 18 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index f536ff1b5c47..ef8dffbdffed 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -326,10 +326,8 @@ static void rt2500usb_config_rate(struct rt2x00_dev *rt2x00dev, const int rate)
326 rt2500usb_register_write(rt2x00dev, TXRX_CSR1, reg); 326 rt2500usb_register_write(rt2x00dev, TXRX_CSR1, reg);
327 327
328 rt2500usb_register_read(rt2x00dev, TXRX_CSR10, &reg); 328 rt2500usb_register_read(rt2x00dev, TXRX_CSR10, &reg);
329 if (preamble == SHORT_PREAMBLE) 329 rt2x00_set_field16(&reg, TXRX_CSR10_AUTORESPOND_PREAMBLE,
330 rt2x00_set_field16(&reg, TXRX_CSR10_AUTORESPOND_PREAMBLE, 1); 330 (preamble == SHORT_PREAMBLE));
331 else
332 rt2x00_set_field16(&reg, TXRX_CSR10_AUTORESPOND_PREAMBLE, 0);
333 rt2500usb_register_write(rt2x00dev, TXRX_CSR10, reg); 331 rt2500usb_register_write(rt2x00dev, TXRX_CSR10, reg);
334} 332}
335 333
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 8011523962a6..cd22817cced5 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -357,10 +357,8 @@ static void rt61pci_config_rate(struct rt2x00_dev *rt2x00dev, const int rate)
357 rt2x00pci_register_write(rt2x00dev, TXRX_CSR0, reg); 357 rt2x00pci_register_write(rt2x00dev, TXRX_CSR0, reg);
358 358
359 rt2x00pci_register_read(rt2x00dev, TXRX_CSR4, &reg); 359 rt2x00pci_register_read(rt2x00dev, TXRX_CSR4, &reg);
360 if (preamble == SHORT_PREAMBLE) 360 rt2x00_set_field32(&reg, TXRX_CSR4_AUTORESPOND_PREAMBLE,
361 rt2x00_set_field32(&reg, TXRX_CSR4_AUTORESPOND_PREAMBLE, 1); 361 (preamble == SHORT_PREAMBLE));
362 else
363 rt2x00_set_field32(&reg, TXRX_CSR4_AUTORESPOND_PREAMBLE, 0);
364 rt2x00pci_register_write(rt2x00dev, TXRX_CSR4, reg); 362 rt2x00pci_register_write(rt2x00dev, TXRX_CSR4, reg);
365} 363}
366 364
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4a78ca79c94a..9e1bf4d77e10 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -195,12 +195,13 @@ rf_write:
195 reg = 0; 195 reg = 0;
196 rt2x00_set_field32(&reg, PHY_CSR4_VALUE, value); 196 rt2x00_set_field32(&reg, PHY_CSR4_VALUE, value);
197 197
198 if (rt2x00_rf(&rt2x00dev->chip, RF5225) || 198 /*
199 rt2x00_rf(&rt2x00dev->chip, RF2527)) 199 * RF5225 and RF2527 contain 21 bits per RF register value,
200 rt2x00_set_field32(&reg, PHY_CSR4_NUMBER_OF_BITS, 21); 200 * all others contain 20 bits.
201 else 201 */
202 rt2x00_set_field32(&reg, PHY_CSR4_NUMBER_OF_BITS, 20); 202 rt2x00_set_field32(&reg, PHY_CSR4_NUMBER_OF_BITS,
203 203 20 + !!(rt2x00_rf(&rt2x00dev->chip, RF5225) ||
204 rt2x00_rf(&rt2x00dev->chip, RF2527)));
204 rt2x00_set_field32(&reg, PHY_CSR4_IF_SELECT, 0); 205 rt2x00_set_field32(&reg, PHY_CSR4_IF_SELECT, 0);
205 rt2x00_set_field32(&reg, PHY_CSR4_BUSY, 1); 206 rt2x00_set_field32(&reg, PHY_CSR4_BUSY, 1);
206 207
@@ -331,10 +332,8 @@ static void rt73usb_config_rate(struct rt2x00_dev *rt2x00dev, const int rate)
331 rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg); 332 rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg);
332 333
333 rt73usb_register_read(rt2x00dev, TXRX_CSR4, &reg); 334 rt73usb_register_read(rt2x00dev, TXRX_CSR4, &reg);
334 if (preamble == SHORT_PREAMBLE) 335 rt2x00_set_field32(&reg, TXRX_CSR4_AUTORESPOND_PREAMBLE,
335 rt2x00_set_field32(&reg, TXRX_CSR4_AUTORESPOND_PREAMBLE, 1); 336 (preamble == SHORT_PREAMBLE));
336 else
337 rt2x00_set_field32(&reg, TXRX_CSR4_AUTORESPOND_PREAMBLE, 0);
338 rt73usb_register_write(rt2x00dev, TXRX_CSR4, reg); 337 rt73usb_register_write(rt2x00dev, TXRX_CSR4, reg);
339} 338}
340 339