diff options
author | Guido Guenther <agx@sigxcpu.org> | 2007-02-24 17:34:34 +0100 |
---|---|---|
committer | Guido Guenther <agx@bogon.sigxcpu.org> | 2007-02-24 17:34:34 +0100 |
commit | 904fc50bb39072b726a9bb31e09869b7ac255e61 (patch) | |
tree | 17a9a052110503d790dbddcadbc58ff4587bbc5c | |
parent | 83fed7745658c22985739aebabf3f099a408178b (diff) |
adjust if/while statements to CodingStyle
-rw-r--r-- | at76c503.c | 183 |
1 files changed, 92 insertions, 91 deletions
@@ -357,7 +357,7 @@ int dfu_download_block(struct dfu_ctx *ctx, u8 *buffer, dbg(DBG_DFU, "dfu_download_block(): buffer=%p, bytes=%d, block=%d", buffer, bytes, block); - if(tmpbuf == NULL) + if (tmpbuf == NULL) return -ENOMEM; memcpy(tmpbuf, buffer, bytes); @@ -426,7 +426,7 @@ struct dfu_ctx *dfu_alloc_ctx(struct usb_device *udev) struct dfu_ctx *ctx; ctx = kmalloc(sizeof(struct dfu_ctx) + DFU_PACKETSIZE, GFP_KERNEL|GFP_DMA); - if(ctx){ + if (ctx) { ctx->udev = udev; ctx->buf = (u8 *)&(ctx[1]); } @@ -458,7 +458,7 @@ static int usbdfu_download(struct usb_device *udev, u8 *dfu_buffer, } ctx = dfu_alloc_ctx(udev); - if(ctx == NULL) + if (ctx == NULL) return -ENOMEM; dfu_stat_buf = &ctx->dfu_status; @@ -490,11 +490,11 @@ static int usbdfu_download(struct usb_device *udev, u8 *dfu_buffer, dbg(DBG_DFU, "STATE_DFU_DOWNLOAD_BUSY"); need_dfu_state = 1; - if (dfu_timeout >= 0){ + if (dfu_timeout >= 0) { dbg(DBG_DFU, "DFU: Resetting device"); set_current_state( TASK_INTERRUPTIBLE ); schedule_timeout(1+dfu_timeout*HZ/1000); - }else + } else dbg(DBG_DFU, "DFU: In progress"); break; @@ -539,12 +539,12 @@ static int usbdfu_download(struct usb_device *udev, u8 *dfu_buffer, if (manifest_sync_timeout > 0) dfu_timeout = manifest_sync_timeout; - if (dfu_timeout >= 0){ + if (dfu_timeout >= 0) { dbg(DBG_DFU, "DFU: Waiting for manifest phase"); set_current_state( TASK_INTERRUPTIBLE ); schedule_timeout((dfu_timeout*HZ+999)/1000); - }else + } else dbg(DBG_DFU, "DFU: In progress"); } break; @@ -714,7 +714,7 @@ static int get_op_mode(struct usb_device *udev) 0x33, INTERFACE_VENDOR_REQUEST_IN, 0x01, 0, &op_mode, 1, USB_CTRL_GET_TIMEOUT); - if(ret < 0) + if (ret < 0) return ret; return op_mode; } @@ -878,13 +878,13 @@ static int download_external_fw(struct usb_device *udev, u8 *buf, int size) dbg(DBG_DEVSTART, "downloading external firmware"); - while(size > 0){ + while (size > 0) { int bsize = size > EXT_FW_BLOCK_SIZE ? EXT_FW_BLOCK_SIZE : size; memcpy(block, buf, bsize); dbg(DBG_DEVSTART, "ext fw, size left = %5d, bsize = %4d, i = %2d", size, bsize, i); - if((ret = load_ext_fw_block(udev, i, block, bsize)) < 0){ + if ((ret = load_ext_fw_block(udev, i, block, bsize)) < 0) { err("load_ext_fw_block failed: %d, i = %d", ret, i); goto exit; } @@ -895,7 +895,7 @@ static int download_external_fw(struct usb_device *udev, u8 *buf, int size) /* for fw >= 0.100, the device needs an extra empty block: */ - if((ret = load_ext_fw_block(udev, i, block, 0)) < 0){ + if ((ret = load_ext_fw_block(udev, i, block, 0)) < 0) { err("load_ext_fw_block failed: %d, i = %d", ret, i); goto exit; } @@ -914,11 +914,11 @@ static int set_card_command(struct usb_device *udev, int cmd, sizeof(struct at76c503_command) + buf_size, GFP_KERNEL); - if(cmd_buf){ + if (cmd_buf) { cmd_buf->cmd = cmd; cmd_buf->reserved = 0; cmd_buf->size = cpu_to_le16(buf_size); - if(buf_size > 0) + if (buf_size > 0) memcpy(&(cmd_buf[1]), buf, buf_size); ret = usb_control_msg(udev, usb_sndctrlpipe(udev,0), 0x0e, DEVICE_VENDOR_REQUEST_OUT, @@ -960,9 +960,9 @@ static int wait_completion(struct at76c503 *dev, int cmd) struct net_device *netdev = dev->netdev; int ret = 0; - do{ + do { ret = get_cmd_status(dev->udev, cmd, cmd_status); - if(ret < 0){ + if (ret < 0) { err("%s: get_cmd_status failed: %d", netdev->name, ret); break; } @@ -970,12 +970,13 @@ static int wait_completion(struct at76c503 *dev, int cmd) dbg(DBG_WAIT_COMPLETE, "%s: Waiting on cmd %d, cmd_status[5] = %d (%s)", dev->netdev->name, cmd, cmd_status[5], get_cmd_status_string(cmd_status[5])); - if(cmd_status[5] == CMD_STATUS_IN_PROGRESS || + if (cmd_status[5] == CMD_STATUS_IN_PROGRESS || cmd_status[5] == CMD_STATUS_IDLE){ set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(HZ/10); /* 100 ms */ - }else break; - }while(1); + } else + break; + } while (1); if (ret >= 0) /* if get_cmd_status did not fail, return the status @@ -994,7 +995,7 @@ static int set_mib(struct at76c503 *dev, struct set_mib_buffer *buf) sizeof(struct at76c503_command) + buf->size + 4, GFP_KERNEL); - if(cmd_buf){ + if (cmd_buf) { cmd_buf->cmd = CMD_SET_MIB; cmd_buf->reserved = 0; cmd_buf->size = cpu_to_le16(buf->size + 4); @@ -1024,9 +1025,9 @@ static int set_radio(struct at76c503 *dev, int on_off) { int ret; - if(dev->radio_on != on_off){ + if (dev->radio_on != on_off) { ret = set_card_command(dev->udev, CMD_RADIO, NULL, 0); - if(ret < 0){ + if (ret < 0) { err("%s: set_card_command(CMD_RADIO) failed: %d", dev->netdev->name, ret); } else ret = 1; @@ -1051,7 +1052,7 @@ static int set_pm_mode(struct at76c503 *dev, u8 mode) dev->mib_buf.data[0] = mode; ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (pm_mode) failed: %d", dev->netdev->name, ret); } return ret; @@ -1072,7 +1073,7 @@ static int set_associd(struct at76c503 *dev, u16 id) dev->mib_buf.data[1] = id >> 8; ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (associd) failed: %d", dev->netdev->name, ret); } return ret; @@ -1094,7 +1095,7 @@ static int set_listen_interval(struct at76c503 *dev, u16 interval) dev->mib_buf.data[1] = interval >> 8; ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (listen_interval) failed: %d", dev->netdev->name, ret); } @@ -1111,7 +1112,7 @@ static int set_preamble(struct at76c503 *dev, u8 type) dev->mib_buf.index = PREAMBLE_TYPE_OFFSET; dev->mib_buf.data[0] = type; ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (preamble) failed: %d", dev->netdev->name, ret); } return ret; @@ -1127,7 +1128,7 @@ static int set_frag(struct at76c503 *dev, u16 size) dev->mib_buf.index = FRAGMENTATION_OFFSET; *(__le16*)dev->mib_buf.data = cpu_to_le16(size); ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (frag threshold) failed: %d", dev->netdev->name, ret); } return ret; @@ -1143,7 +1144,7 @@ static int set_rts(struct at76c503 *dev, u16 size) dev->mib_buf.index = RTS_OFFSET; *(__le16*)dev->mib_buf.data = cpu_to_le16(size); ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (rts) failed: %d", dev->netdev->name, ret); } return ret; @@ -1159,7 +1160,7 @@ static int set_autorate_fallback(struct at76c503 *dev, int onoff) dev->mib_buf.index = TX_AUTORATE_FALLBACK_OFFSET; dev->mib_buf.data[0] = onoff; ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (autorate fallback) failed: %d", dev->netdev->name, ret); } return ret; @@ -1175,7 +1176,7 @@ static int set_mac_address(struct at76c503 *dev, void *addr) dev->mib_buf.index = offsetof(struct mib_mac_addr, mac_addr); memcpy(dev->mib_buf.data, addr, ETH_ALEN); ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (MAC_ADDR, mac_addr) failed: %d", dev->netdev->name, ret); } @@ -1195,7 +1196,7 @@ static int set_group_address(struct at76c503 *dev, u8 *addr, int n) dev->mib_buf.index = offsetof(struct mib_mac_addr, group_addr) + n*ETH_ALEN; memcpy(dev->mib_buf.data, addr, ETH_ALEN); ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (MIB_MAC_ADD, group_addr) failed: %d", dev->netdev->name, ret); } @@ -1208,7 +1209,7 @@ static int set_group_address(struct at76c503 *dev, u8 *addr, int n) dev->mib_buf.index = offsetof(struct mib_mac_addr, group_addr_status) + n; dev->mib_buf.data[0] = 1; ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (MIB_MAC_ADD, group_addr_status) failed: %d", dev->netdev->name, ret); } @@ -1227,7 +1228,7 @@ static int set_promisc(struct at76c503 *dev, int onoff) dev->mib_buf.index = offsetof(struct mib_local, promiscuous_mode); dev->mib_buf.data[0] = onoff ? 1 : 0; ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (promiscuous_mode) failed: %d", dev->netdev->name, ret); } return ret; @@ -1239,14 +1240,14 @@ static int dump_mib_mac_addr(struct at76c503 *dev) struct mib_mac_addr *mac_addr = kmalloc(sizeof(struct mib_mac_addr), GFP_KERNEL); - if(!mac_addr){ + if (!mac_addr) { ret = -ENOMEM; goto exit; } ret = get_mib(dev->udev, MIB_MAC_ADD, (u8*)mac_addr, sizeof(struct mib_mac_addr)); - if(ret < 0){ + if (ret < 0) { err("%s: get_mib (MAC_ADDR) failed: %d", dev->netdev->name, ret); goto err; } @@ -1271,14 +1272,14 @@ static int dump_mib_mac_wep(struct at76c503 *dev) struct mib_mac_wep *mac_wep = kmalloc(sizeof(struct mib_mac_wep), GFP_KERNEL); - if(!mac_wep){ + if (!mac_wep) { ret = -ENOMEM; goto exit; } ret = get_mib(dev->udev, MIB_MAC_WEP, (u8*)mac_wep, sizeof(struct mib_mac_wep)); - if(ret < 0){ + if (ret < 0) { err("%s: get_mib (MAC_WEP) failed: %d", dev->netdev->name, ret); goto err; } @@ -1310,14 +1311,14 @@ static int dump_mib_mac_mgmt(struct at76c503 *dev) kmalloc(sizeof(struct mib_mac_mgmt), GFP_KERNEL); char country_string[4]; - if(!mac_mgmt){ + if (!mac_mgmt) { ret = -ENOMEM; goto exit; } ret = get_mib(dev->udev, MIB_MAC_MGMT, (u8*)mac_mgmt, sizeof(struct mib_mac_mgmt)); - if(ret < 0){ + if (ret < 0) { err("%s: get_mib failed: %d", dev->netdev->name, ret); goto err; } @@ -1365,14 +1366,14 @@ static int dump_mib_mac(struct at76c503 *dev) struct mib_mac *mac = kmalloc(sizeof(struct mib_mac), GFP_KERNEL); - if(!mac){ + if (!mac) { ret = -ENOMEM; goto exit; } ret = get_mib(dev->udev, MIB_MAC, (u8*)mac, sizeof(struct mib_mac)); - if(ret < 0){ + if (ret < 0) { err("%s: get_mib failed: %d", dev->netdev->name, ret); goto err; } @@ -1415,14 +1416,14 @@ static int dump_mib_phy(struct at76c503 *dev) struct mib_phy *phy = kmalloc(sizeof(struct mib_phy), GFP_KERNEL); - if(!phy){ + if (!phy) { ret = -ENOMEM; goto exit; } ret = get_mib(dev->udev, MIB_PHY, (u8*)phy, sizeof(struct mib_phy)); - if(ret < 0){ + if (ret < 0) { err("%s: get_mib failed: %d", dev->netdev->name, ret); goto err; } @@ -1458,14 +1459,14 @@ static int dump_mib_local(struct at76c503 *dev) struct mib_local *local = kmalloc(sizeof(struct mib_phy), GFP_KERNEL); - if(!local){ + if (!local) { ret = -ENOMEM; goto exit; } ret = get_mib(dev->udev, MIB_LOCAL, (u8*)local, sizeof(struct mib_local)); - if(ret < 0){ + if (ret < 0) { err("%s: get_mib failed: %d", dev->netdev->name, ret); goto err; } @@ -1491,14 +1492,14 @@ static int get_mib_mdomain(struct at76c503 *dev, struct mib_mdomain *val) struct mib_mdomain *mdomain = kmalloc(sizeof(struct mib_mdomain), GFP_KERNEL); - if(!mdomain){ + if (!mdomain) { ret = -ENOMEM; goto exit; } ret = get_mib(dev->udev, MIB_MDOMAIN, (u8*)mdomain, sizeof(struct mib_mdomain)); - if(ret < 0){ + if (ret < 0) { err("%s: get_mib failed: %d", dev->netdev->name, ret); goto err; } @@ -1538,14 +1539,14 @@ int get_current_bssid(struct at76c503 *dev) struct mib_mac_mgmt *mac_mgmt = kmalloc(sizeof(struct mib_mac_mgmt), GFP_KERNEL); - if(!mac_mgmt){ + if (!mac_mgmt) { ret = -ENOMEM; goto exit; } ret = get_mib(dev->udev, MIB_MAC_MGMT, (u8*)mac_mgmt, sizeof(struct mib_mac_mgmt)); - if(ret < 0){ + if (ret < 0) { err("%s: get_mib failed: %d", dev->netdev->name, ret); goto err; } @@ -1563,13 +1564,13 @@ static int get_current_channel(struct at76c503 *dev) struct mib_phy *phy = kmalloc(sizeof(struct mib_phy), GFP_KERNEL); - if(!phy){ + if (!phy) { ret = -ENOMEM; goto exit; } ret = get_mib(dev->udev, MIB_PHY, (u8*)phy, sizeof(struct mib_phy)); - if(ret < 0){ + if (ret < 0) { err("%s: get_mib(MIB_PHY) failed: %d", dev->netdev->name, ret); goto err; } @@ -2342,25 +2343,25 @@ static void kevent(struct work_struct *work) down(&dev->sem); - if(test_bit(KEVENT_CTRL_HALT, &dev->kevent_flags)){ + if (test_bit(KEVENT_CTRL_HALT, &dev->kevent_flags)) { /* this never worked... but it seems that it's rarely necessary, if at all (oku) */ ret = usb_clear_halt(dev->udev, usb_sndctrlpipe (dev->udev, 0)); - if(ret < 0) + if (ret < 0) err("usb_clear_halt() failed: %d", ret); else{ clear_bit(KEVENT_CTRL_HALT, &dev->kevent_flags); info("usb_clear_halt() successful"); } } - if(test_bit(KEVENT_NEW_BSS, &dev->kevent_flags)){ + if (test_bit(KEVENT_NEW_BSS, &dev->kevent_flags)) { struct net_device *netdev = dev->netdev; struct mib_mac_mgmt *mac_mgmt = kmalloc(sizeof(struct mib_mac_mgmt), GFP_KERNEL); ret = get_mib(dev->udev, MIB_MAC_MGMT, (u8*)mac_mgmt, sizeof(struct mib_mac_mgmt)); - if(ret < 0){ + if (ret < 0) { err("%s: get_mib failed: %d", netdev->name, ret); goto new_bss_clean; } @@ -2376,7 +2377,7 @@ static void kevent(struct work_struct *work) dev->mib_buf.size = 1; dev->mib_buf.index = IBSS_CHANGE_OK_OFFSET; ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (ibss change ok) failed: %d", netdev->name, ret); goto new_bss_clean; } @@ -2385,7 +2386,7 @@ static void kevent(struct work_struct *work) kfree(mac_mgmt); } - if(test_bit(KEVENT_SET_PROMISC, &dev->kevent_flags)){ + if (test_bit(KEVENT_SET_PROMISC, &dev->kevent_flags)) { info("%s: KEVENT_SET_PROMISC", dev->netdev->name); set_promisc(dev, dev->promisc); @@ -2399,7 +2400,7 @@ static void kevent(struct work_struct *work) assert(dev->istate == STARTIBSS); UNLOCK_ISTATE() ret = start_ibss(dev); - if(ret < 0){ + if (ret < 0) { err("%s: start_ibss failed: %d", dev->netdev->name, ret); goto end_startibss; } @@ -2412,10 +2413,10 @@ static void kevent(struct work_struct *work) } ret = get_current_bssid(dev); - if(ret < 0) goto end_startibss; + if (ret < 0) goto end_startibss; ret = get_current_channel(dev); - if(ret < 0) goto end_startibss; + if (ret < 0) goto end_startibss; /* not sure what this is good for ??? */ memset(&dev->mib_buf, 0, sizeof(struct set_mib_buffer)); @@ -2423,7 +2424,7 @@ static void kevent(struct work_struct *work) dev->mib_buf.size = 1; dev->mib_buf.index = IBSS_CHANGE_OK_OFFSET; ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (ibss change ok) failed: %d", dev->netdev->name, ret); goto end_startibss; } @@ -2437,7 +2438,7 @@ end_startibss: if (test_bit(KEVENT_JOIN, &dev->kevent_flags)) { clear_bit(KEVENT_JOIN, &dev->kevent_flags); LOCK_ISTATE() - if (dev->istate == INIT){ + if (dev->istate == INIT) { UNLOCK_ISTATE() goto end_join; } @@ -2510,7 +2511,7 @@ end_startibss: } /* if (test_bit(KEVENT_JOIN, &dev->kevent_flags)) */ end_join: - if(test_bit(KEVENT_MGMT_TIMEOUT, &dev->kevent_flags)){ + if (test_bit(KEVENT_MGMT_TIMEOUT, &dev->kevent_flags)) { clear_bit(KEVENT_MGMT_TIMEOUT, &dev->kevent_flags); handle_mgmt_timeout(dev); } @@ -2522,7 +2523,7 @@ end_join: /* only clear the bss list when a scan is actively initiated, * otherwise simply rely on bss_list_timeout */ - if( dev->site_survey_state == SITE_SURVEY_IN_PROGRESS) + if ( dev->site_survey_state == SITE_SURVEY_IN_PROGRESS) free_bss_list(dev); UNLOCK_ISTATE() @@ -3359,7 +3360,7 @@ static void calc_level(struct at76c503 *dev, struct at76c503_rx_buffer *buf, str /* calc the link quality from a given rx_buffer */ static void calc_qual(struct at76c503 *dev, struct at76c503_rx_buffer *buf, struct iw_quality* qual) { - if((dev->board_type == BOARDTYPE_503_INTERSIL_3861) || + if ((dev->board_type == BOARDTYPE_503_INTERSIL_3861) || (dev->board_type == BOARDTYPE_503_INTERSIL_3863)) { qual->qual=buf->link_quality; } else { @@ -4155,7 +4156,7 @@ static void rx_tasklet(unsigned long param) } - if(!urb || !dev->rx_skb || !netdev || !dev->rx_skb->data) return; + if (!urb || !dev->rx_skb || !netdev || !dev->rx_skb->data) return; buf = (struct at76c503_rx_buffer *)dev->rx_skb->data; @@ -4166,7 +4167,7 @@ static void rx_tasklet(unsigned long param) frame_ctl = le16_to_cpu(i802_11_hdr->frame_ctl); - if(urb->status != 0){ + if (urb->status != 0) { if ((urb->status != -ENOENT) && (urb->status != -ECONNRESET)) { dbg(DBG_URB,"%s %s: - nonzero read bulk status received: %d", @@ -4193,7 +4194,7 @@ static void rx_tasklet(unsigned long param) UNLOCK_ISTATE() /* there is a new bssid around, accept it: */ - if(buf->newbss && dev->iw_mode == IW_MODE_ADHOC) { + if (buf->newbss && dev->iw_mode == IW_MODE_ADHOC) { dbg(DBG_PROGRESS, "%s: rx newbss", netdev->name); defer_kevent(dev, KEVENT_NEW_BSS); } @@ -4236,15 +4237,15 @@ static void at76c503_write_bulk_callback (struct urb *urb) struct at76c503_tx_buffer *mgmt_buf; int ret; - if(urb->status != 0){ - if((urb->status != -ENOENT) && + if (urb->status != 0) { + if ((urb->status != -ENOENT) && (urb->status != -ECONNRESET)) { dbg(DBG_URB, "%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); - }else + } else return; /* urb has been unlinked */ stats->tx_errors++; - }else + } else stats->tx_packets++; spin_lock_irqsave(&dev->mgmt_spinlock, flags); @@ -4381,11 +4382,11 @@ static int at76c503_tx(struct sk_buff *skb, struct net_device *netdev) (dev->wep_enabled ? IEEE80211_FCTL_PROTECTED : 0) | (dev->iw_mode == IW_MODE_INFRA ? IEEE80211_FCTL_TODS : 0)); - if(dev->iw_mode == IW_MODE_ADHOC){ + if (dev->iw_mode == IW_MODE_ADHOC) { memcpy(i802_11_hdr->addr1, skb->data, ETH_ALEN); /* destination */ memcpy(i802_11_hdr->addr2, skb->data+ETH_ALEN, ETH_ALEN); /* source */ memcpy(i802_11_hdr->addr3, dev->bssid, ETH_ALEN); - }else if(dev->iw_mode == IW_MODE_INFRA){ + } else if (dev->iw_mode == IW_MODE_INFRA) { memcpy(i802_11_hdr->addr1, dev->bssid, ETH_ALEN); memcpy(i802_11_hdr->addr2, skb->data+ETH_ALEN, ETH_ALEN); /* source */ memcpy(i802_11_hdr->addr3, skb->data, ETH_ALEN); /* destination */ @@ -4431,7 +4432,7 @@ static int at76c503_tx(struct sk_buff *skb, struct net_device *netdev) tx_buffer, submit_len, (usb_complete_t)at76c503_write_bulk_callback, dev); ret = usb_submit_urb(dev->write_urb, GFP_ATOMIC); - if(ret){ + if (ret) { stats->tx_errors++; err("%s: error in tx submit urb: %d", netdev->name, ret); if (ret == -EINVAL) @@ -4545,7 +4546,7 @@ static int startup_device(struct at76c503 *dev) ret = set_card_command(dev->udev, CMD_STARTUP, (unsigned char *)&dev->card_config, sizeof(struct at76c503_card_config)); - if(ret < 0){ + if (ret < 0) { err("%s: set_card_command failed: %d", dev->netdev->name, ret); return ret; } @@ -4596,7 +4597,7 @@ static int at76c503_open(struct net_device *netdev) dbg(DBG_PROC_ENTRY, "at76c503_open entry"); - if(down_interruptible(&dev->sem)) + if (down_interruptible(&dev->sem)) return -EINTR; /* if netdev->dev_addr != dev->mac_addr we must @@ -4615,7 +4616,7 @@ static int at76c503_open(struct net_device *netdev) dev->last_survey = jiffies; dev->nr_submit_rx_tries = NR_SUBMIT_RX_TRIES; /* init counter */ - if((ret=submit_rx_urb(dev)) < 0){ + if ((ret=submit_rx_urb(dev)) < 0) { err("%s: open: submit_rx_urb failed: %d", netdev->name, ret); goto err; } @@ -4701,7 +4702,7 @@ static void at76c503_set_multicast(struct net_device *netdev) int promisc; promisc = ((netdev->flags & IFF_PROMISC) != 0); - if(promisc != dev->promisc){ + if (promisc != dev->promisc) { /* grmbl. This gets called in interrupt. */ dev->promisc = promisc; defer_kevent(dev, KEVENT_SET_PROMISC); @@ -5317,7 +5318,7 @@ static int at76c503_iw_handler_get_scan(struct net_device *netdev, iwe->u.qual.level = (curr_bss->rssi * 100 / 42); if (iwe->u.qual.level > 100) iwe->u.qual.level = 100; - if((dev->board_type == BOARDTYPE_503_INTERSIL_3861) || + if ((dev->board_type == BOARDTYPE_503_INTERSIL_3861) || (dev->board_type == BOARDTYPE_503_INTERSIL_3863)) { iwe->u.qual.qual=curr_bss->link_qual; } else { @@ -5565,7 +5566,7 @@ static int at76c503_iw_handler_set_frag(struct net_device *netdev, netdev->name, frag->value, (frag->disabled) ? "true" : "false"); - if(frag->disabled) + if (frag->disabled) fthr = MAX_FRAG_THRESHOLD; if ((fthr < MIN_FRAG_THRESHOLD) || (fthr > MAX_FRAG_THRESHOLD)) { @@ -5624,7 +5625,7 @@ static int at76c503_iw_handler_set_retry(struct net_device *netdev, dbg(DBG_IOCTL, "%s: SIOCSIWRETRY disabled %d flags x%x val %d", netdev->name, retry->disabled, retry->flags, retry->value); - if(!retry->disabled && (retry->flags & IW_RETRY_LIMIT)) { + if (!retry->disabled && (retry->flags & IW_RETRY_LIMIT)) { if ((retry->flags & IW_RETRY_MIN) || !(retry->flags & IW_RETRY_MAX)) { dev->short_retry_limit = retry->value; @@ -5967,7 +5968,7 @@ static int set_iroaming(struct at76c503 *dev, int onoff) dev->mib_buf.index = IROAMING_OFFSET; dev->mib_buf.data[0] = (dev->international_roaming ? 1 : 0); ret = set_mib(dev, &dev->mib_buf); - if(ret < 0){ + if (ret < 0) { err("%s: set_mib (intl_roaming_enable) failed: %d", dev->netdev->name, ret); } @@ -6192,27 +6193,27 @@ static void at76c503_delete_device(struct at76c503 *dev) /* assuming we used keventd, it must quiesce too */ flush_scheduled_work (); - if(dev->bulk_out_buffer != NULL) + if (dev->bulk_out_buffer != NULL) kfree(dev->bulk_out_buffer); kfree(dev->ctrl_buffer); - if(dev->write_urb != NULL) { + if (dev->write_urb != NULL) { usb_kill_urb(dev->write_urb); usb_free_urb(dev->write_urb); } - if(dev->read_urb != NULL) { + if (dev->read_urb != NULL) { usb_kill_urb(dev->read_urb); usb_free_urb(dev->read_urb); } - if(dev->ctrl_buffer != NULL) { + if (dev->ctrl_buffer != NULL) { usb_kill_urb(dev->ctrl_urb); usb_free_urb(dev->ctrl_urb); } dbg(DBG_PROC_ENTRY,"%s: unlinked urbs",__FUNCTION__); - if(dev->rx_skb != NULL) + if (dev->rx_skb != NULL) kfree_skb(dev->rx_skb); free_bss_list(dev); @@ -6410,15 +6411,15 @@ static int init_new_device(struct at76c503 *dev) ipaq_init_led (); #endif - if(at76c503_alloc_urbs(dev) < 0) + if (at76c503_alloc_urbs(dev) < 0) goto error; /* get firmware version */ ret = get_mib(dev->udev, MIB_FW_VERSION, (u8*)&dev->fw_version, sizeof(dev->fw_version)); - if((ret < 0) || ((dev->fw_version.major == 0) && + if ((ret < 0) || ((dev->fw_version.major == 0) && (dev->fw_version.minor == 0) && (dev->fw_version.patch == 0) && - (dev->fw_version.build == 0))){ + (dev->fw_version.build == 0))) { err("getting firmware failed with %d, or version is 0", ret); err("this probably means that the ext. fw was not loaded correctly"); goto error; @@ -6437,7 +6438,7 @@ static int init_new_device(struct at76c503 *dev) /* MAC address */ ret = get_hw_config(dev); - if(ret < 0){ + if (ret < 0) { err("could not get MAC address"); goto error; } |