From ac96fad34ab7b4b5bc63c4aa317baa707955b9ec Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 10 Jul 2007 02:21:40 -0400 Subject: [PATCH] Make at76_match_mode() more readable Signed-off-by: Pavel Roskin --- at76_usb.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/at76_usb.c b/at76_usb.c index ffabc67..d0721de 100644 --- a/at76_usb.c +++ b/at76_usb.c @@ -4158,22 +4158,26 @@ static inline int at76_match_mode(struct at76_priv *priv, struct bss_info *ptr) static int at76_match_rates(struct at76_priv *priv, struct bss_info *ptr) { int i; - u8 *rate; - - for (i = 0, rate = ptr->rates; i < ptr->rates_len; i++, rate++) - if (*rate & 0x80) { - /* this is a basic rate we have to support - (see IEEE802.11, ch. 7.3.2.2) */ - if (*rate != (0x80 | hw_rates[0]) - && *rate != (0x80 | hw_rates[1]) - && *rate != (0x80 | hw_rates[2]) - && *rate != (0x80 | hw_rates[3])) { - at76_dbg(DBG_BSS_MATCH, - "%s: bss table entry %p: basic rate %02x not supported", - priv->netdev->name, ptr, *rate); - return 0; - } + + for (i = 0; i < ptr->rates_len; i++) { + u8 rate = ptr->rates[i]; + + if (!(rate & 0x80)) + continue; + + /* this is a basic rate we have to support + (see IEEE802.11, ch. 7.3.2.2) */ + if (rate != (0x80 | hw_rates[0]) + && rate != (0x80 | hw_rates[1]) + && rate != (0x80 | hw_rates[2]) + && rate != (0x80 | hw_rates[3])) { + at76_dbg(DBG_BSS_MATCH, + "%s: bss table entry %p: basic rate %02x not " + "supported", priv->netdev->name, ptr, rate); + return 0; } + } + /* if we use short preamble, the bss must support it */ if (priv->preamble_type == PREAMBLE_TYPE_SHORT && !(ptr->capa & WLAN_CAPABILITY_SHORT_PREAMBLE)) { -- cgit v1.2.3