From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:10
|
These patches are applied after the set of 34 submitted by Jim earlier today. There are remining sparse errors and warnings, but they will be addressed later. Signed-off-by: Larry Finger <Lar...@lw...> Larry Finger (10): Remove trailing whitescace from common.c Remove trailing whitespace from debugfs.c Remove trailing whitespace from pci.c Remove trailing whitespace from usb.c and usb.h Remove trailing whitespace from mem.c, mem.h, and mem-inlines.h Remove trailing whitespace from merge.c Fix x86_64 warnings correctly Remove remaining warnings on x86_64 Fix several sparse errors. Fix sparse warnings Part 1 common.c | 56 ++++++++-------- debugfs.c | 4 +- inlines.h | 28 ++++---- mem-inlines.h | 20 +++--- mem.c | 59 +++++++++-------- mem.h | 2 +- merge.c | 206 +++++++++++++++++++++++++++++---------------------------- pci.c | 16 ++--- usb.c | 37 +++++------ usb.h | 1 - 10 files changed, 215 insertions(+), 214 deletions(-) -- 1.7.9.2 |
From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:12
|
Signed-off-by: Larry Finger <Lar...@lw...> --- pci.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pci.c b/pci.c index 3b4abca..ee44ae1 100644 --- a/pci.c +++ b/pci.c @@ -222,7 +222,7 @@ int acxpci_upload_fw(acx_device_t *adev) if (OK == res) { res = acx_validate_fw(adev, fw_image, 0); log(L_DEBUG | L_INIT, "acx_validate_fw " - "(main/combined): %d\n", res); + "(main/combined): %d\n", res); } if (OK == res) { @@ -282,7 +282,7 @@ acxpci_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd, if (!(adev->dev_state_mask & ACX_STATE_FW_LOADED)) { pr_acx("%s: %s: firmware is not loaded yet, " - "cannot execute commands!\n", + "cannot execute commands!\n", __func__, devname); goto bad; } @@ -318,7 +318,7 @@ acxpci_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd, goto bad; } else if (counter < 190) { /* if waited >10ms... */ log(L_CTL | L_DEBUG, "%s: waited for IDLE %dms. " - "Please report\n", + "Please report\n", __func__, 199 - counter); } @@ -390,7 +390,7 @@ acxpci_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd, log(L_ANY, "%s: %s: timed out %s for CMD_COMPLETE. " "irq bits:0x%04X irq_status:0x%04X timeout:%dms " "cmd_status:%d (%s)\n", - __func__, devname, + __func__, devname, (adev->irqs_active) ? "waiting" : "polling", irqtype, adev->irq_status, cmd_timeout, cmd_status, acx_cmd_status_str(cmd_status)); @@ -438,7 +438,7 @@ acxpci_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd, bad: /* Give enough info so that callers can avoid printing their - * own diagnostic messages */ + * own diagnostic messages */ logf1(L_ANY, "%s: cmd=%s, buflen=%u, timeout=%ums, type=0x%04X, status=%s: FAILED\n", devname, cmdstr, buflen, cmd_timeout, @@ -447,7 +447,7 @@ acxpci_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd, ); /* dump_stack(); */ FN_EXIT1(NOT_OK); - + return NOT_OK; } @@ -1294,7 +1294,7 @@ acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* PCI setup is finished, now start initializing the card */ /* ----- */ - + acx_init_task_scheduler(adev); /* Mac80211 Tx_queue */ @@ -1411,7 +1411,7 @@ fail_iomap2: fail_iomap1: pci_iounmap(pdev, mem1); - /* err = pci_request_region(pdev, mem_region2, "acx_2"); */ + /* err = pci_request_region(pdev, mem_region2, "acx_2"); */ fail_request_mem_region2: pci_release_region(pdev, mem_region2); -- 1.7.9.2 |
From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:14
|
Signed-off-by: Larry Finger <Lar...@lw...> --- usb.c | 37 ++++++++++++++++++------------------- usb.h | 1 - 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/usb.c b/usb.c index 9fc9bb4..0ab156c 100644 --- a/usb.c +++ b/usb.c @@ -69,9 +69,9 @@ */ /* ACX100 (TNETW1100) USB device: D-Link DWL-120+ */ -#define ACX100_VENDOR_ID 0x2001 -#define ACX100_PRODUCT_ID_UNBOOTED 0x3B01 -#define ACX100_PRODUCT_ID_BOOTED 0x3B00 +#define ACX100_VENDOR_ID 0x2001 +#define ACX100_PRODUCT_ID_UNBOOTED 0x3B01 +#define ACX100_PRODUCT_ID_BOOTED 0x3B00 /* TNETW1450 USB devices */ #define VENDOR_ID_DLINK 0x07b8 /* D-Link Corp. */ @@ -148,7 +148,7 @@ MODULE_DEVICE_TABLE(usb, acxusb_ids); * BOM Data Access * ================================================== */ - + /* * BOM Firmware, EEPROM, Phy * ================================================== @@ -984,25 +984,25 @@ static void acxusb_complete_rx(struct urb *urb) tx = (usb_tx_t*) (adev->usb_tx + stat->hostdata); skb = tx->skb; - txstatus = IEEE80211_SKB_CB(skb); + txstatus = IEEE80211_SKB_CB(skb); if (!(txstatus->flags & IEEE80211_TX_CTL_NO_ACK)) - txstatus->flags |= IEEE80211_TX_STAT_ACK; + txstatus->flags |= IEEE80211_TX_STAT_ACK; - txstatus->status.rates[0].count = stat->ack_failures + 1; + txstatus->status.rates[0].count = stat->ack_failures + 1; - // report upstream - ieee80211_tx_status(adev->ieee, skb); + // report upstream + ieee80211_tx_status(adev->ieee, skb); - tx->busy = 0; - adev->tx_free++; + tx->busy = 0; + adev->tx_free++; - if ((adev->tx_free >= TX_START_QUEUE) && acx_queue_stopped(adev->ieee)) { - log(L_BUF, "tx: wake queue (avail. Tx desc %u)\n", - adev->tx_free); - acx_wake_queue(adev->ieee, NULL); - ieee80211_queue_work(adev->ieee, &adev->tx_work); - } + if ((adev->tx_free >= TX_START_QUEUE) && acx_queue_stopped(adev->ieee)) { + log(L_BUF, "tx: wake queue (avail. Tx desc %u)\n", + adev->tx_free); + acx_wake_queue(adev->ieee, NULL); + ieee80211_queue_work(adev->ieee, &adev->tx_work); + } goto next; } @@ -1567,7 +1567,7 @@ acxusb_probe(struct usb_interface *intf, const struct usb_device_id *devID) Ideally we would figure out how to do a USB request to get the radio type of ACX100 cards and query this on second .probe(). */ - + static int radio_type; /* this one needs to be more precise in case there appears * a TNETW1450 from the same vendor */ @@ -1923,4 +1923,3 @@ void __exit acxusb_cleanup_module(void) usb_deregister(&acxusb_driver); log(L_INIT, "USB module unloaded\n"); } - diff --git a/usb.h b/usb.h index 7e73564..0c32913 100644 --- a/usb.h +++ b/usb.h @@ -117,4 +117,3 @@ static inline void __exit acxusb_cleanup_module(void) {} #endif - -- 1.7.9.2 |
From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:16
|
Signed-off-by: Larry Finger <Lar...@lw...> --- debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debugfs.c b/debugfs.c index 7e97ea0..8ad57b4 100644 --- a/debugfs.c +++ b/debugfs.c @@ -53,13 +53,13 @@ static const char *const dbgfs_files[] = { [DEBUG] = "debug", [SENSITIVITY] = "sensitivity", [TX_LEVEL] = "tx_level", - [ANTENNA] = "antenna", + [ANTENNA] = "antenna", [REG_DOMAIN] = "reg_domain", }; static int acx_dbgfs_open(struct inode *inode, struct file *file) { - int fidx = (int) inode->i_private; + int fidx = (int) inode->i_private; struct acx_device *adev = (struct acx_device *) file->f_path.dentry->d_parent->d_inode->i_private; -- 1.7.9.2 |
From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:16
|
Signed-off-by: Larry Finger <Lar...@lw...> --- common.c | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/common.c b/common.c index 59de25b..824e595 100644 --- a/common.c +++ b/common.c @@ -663,10 +663,10 @@ const u8 acx_bitpos2rate100[] = { [2] = RATE100_5, [3] = RATE100_2, /* should not happen */ [4] = RATE100_2, /* should not happen */ - [5] = RATE100_11, + [5] = RATE100_11, [6] = RATE100_2, /* should not happen */ [7] = RATE100_2, /* should not happen */ - [8] = RATE100_22, + [8] = RATE100_22, [9] = RATE100_2, /* should not happen */ [10] = RATE100_2, /* should not happen */ [11] = RATE100_2, /* should not happen */ @@ -989,7 +989,7 @@ static int acx100_init_memory_pools(acx_device_t *adev, MemoryBlockSize.size = cpu_to_le16(adev->memblocksize); /* Then we alert the card to our decision of block size */ - if (OK != acx_configure(adev, &MemoryBlockSize, ACX100_IE_BLOCK_SIZE)) + if (OK != acx_configure(adev, &MemoryBlockSize, ACX100_IE_BLOCK_SIZE)) goto bad; /* We figure out how many total blocks we can create, using @@ -1219,7 +1219,7 @@ static int acx111_create_dma_regions(acx_device_t *adev) /* the number of STAs (STA contexts) to support ** NB: was set to 1 and everything seemed to work nevertheless... */ memconf.no_of_stations = 1; //cpu_to_le16(ARRAY_SIZE(adev->sta_list)); - + /* specify the memory block size. Default is 256 */ memconf.memory_block_size = cpu_to_le16(adev->memblocksize); /* let's use 50%/50% for tx/rx (specify percentage, units of 5%) */ @@ -1464,7 +1464,7 @@ void acx_display_hardware_details(acx_device_t *adev) * * Loads a firmware image * Returns: - * 0: unable to load file + * 0: unable to load file * pointer to firmware: success */ firmware_image_t *acx_read_fw(struct device *dev, const char *file, @@ -1736,7 +1736,7 @@ int acx_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, return acxpci_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr); if (IS_USB(adev)) - return acxusb_issue_cmd_timeo_debug(adev, cmd, param, len, + return acxusb_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr); if (IS_MEM(adev)) return acxmem_issue_cmd_timeo_debug(adev, cmd, param, len, @@ -3283,7 +3283,7 @@ static int acx_update_rx_config(acx_device_t *adev) log(L_INIT, "Updating RXconfig to mode=0x%04X," "rx_config_1:2=%04X:%04X\n", adev->mode, adev->rx_config_1, adev->rx_config_2); - + cfg.rx_cfg1 = cpu_to_le16(adev->rx_config_1); cfg.rx_cfg2 = cpu_to_le16(adev->rx_config_2); res = acx_configure(adev, &cfg, ACX1xx_IE_RXCONFIG); @@ -4330,7 +4330,7 @@ static int acx_proc_show_diag(struct seq_file *file, void *v) part_str, dma->rx_dma_req, dma->rx_dma_err, dma->tx_dma_req, dma->tx_dma_err); - + part_str = "IRQ"; if (st == st_end) @@ -4404,7 +4404,7 @@ static int acx_proc_show_diag(struct seq_file *file, void *v) wep->dot11_def_key_mib, wep->wep_key_not_found, wep->wep_decrypt_fail, temp1, temp2); - + part_str = "power"; if (st == st_end) @@ -4448,9 +4448,9 @@ static int acx_proc_show_diag(struct seq_file *file, void *v) "%s:\n" " mic_rx_pkts %u, mic_calc_fail %u\n", part_str, mic->mic_rx_pkts, mic->mic_calc_fail); - + part_str = "AES"; - + if (st == st_end) goto fw_stats_end; @@ -4620,7 +4620,7 @@ static int acx_proc_show_acx(struct seq_file *file, void *v) adev->form_factor, adev->eeprom_version, adev->firmware_version, adev->firmware_numver); - + acx_sem_unlock(adev); FN_EXIT0; return 0; @@ -4741,7 +4741,7 @@ static int acx_proc_show_sensitivity(struct seq_file *file, void *v) static ssize_t acx_proc_write_sensitivity(struct file *file, const char __user *buf, size_t count, loff_t *ppos) - + { acx_device_t *adev = (acx_device_t *) PDE(file->f_path.dentry->d_inode)->data; @@ -5049,7 +5049,7 @@ void acx_process_rxbuf(acx_device_t *adev, rxbuffer_t *rxbuf) /* For debugging */ if (((IEEE80211_FCTL_STYPE & fc) != IEEE80211_STYPE_BEACON) && (acx_debug & (L_XFER|L_DATA))) { - + printk_ratelimited( "acx: rx: %s time:%u len:%u signal:%u,raw=%u" "SNR:%u,raw=%u macstat:%02X " @@ -5132,7 +5132,7 @@ static void acx_rx(acx_device_t *adev, rxbuffer_t *rxbuf) /* FIXME cleanup ?: noise = acx_signal_to_winlevel(rxbuf->phy_snr); */ /* status->signal = acx_signal_determine_quality(level, noise); - * TODO OW 20100619 On ACX100 seem to be always zero (seen during hx4700 tests ?!) + * TODO OW 20100619 On ACX100 seem to be always zero (seen during hx4700 tests ?!) */ status->signal = level; @@ -5352,7 +5352,7 @@ void acx_wake_queue(struct ieee80211_hw *hw, const char *msg) /* * OW Included skb->len to check required blocks upfront in * acx_l_alloc_tx This should perhaps also go into pci and usb ? - */ + */ tx_t* acx_alloc_tx(acx_device_t *adev, unsigned int len) { if (IS_PCI(adev)) @@ -5421,7 +5421,7 @@ u16 acx111_tx_build_rateset(acx_device_t *adev, txdesc_t *txdesc, if (debug) { #if defined(CONFIG_ACX_MAC80211_PCI) || \ - defined(CONFIG_ACX_MAC80211_MEM) + defined(CONFIG_ACX_MAC80211_MEM) i = ((u8*) txdesc - (u8*) adev->tx.desc_start) / adev->tx.desc_size; sprintf(tmpstr, "txdesc=%i: rates in info" @@ -5444,7 +5444,7 @@ u16 acx111_tx_build_rateset(acx_device_t *adev, txdesc_t *txdesc, i, tmpbitrate->bitrate, tmpbitrate->hw_value, tmpcount, (i < IEEE80211_TX_MAX_RATES - 1) - ? ", " : ""); + ? ", " : ""); } if (debug) logf1(L_ANY, "%s: rateset=0x%04X\n", tmpstr, rateset); @@ -5883,7 +5883,7 @@ int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm, * dwrq->flags, dwrq->length, extra ? "set" : "No key"); */ -/* acx_sem_lock(adev); */ +/* acx_sem_lock(adev); */ /* index = (dwrq->flags & IW_ENCODE_INDEX) - 1; */ if (key->keylen > 0) { @@ -5952,7 +5952,7 @@ int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm, adev->wep_restricted = 1; } */ -/* adev->auth_alg = algorithm; */ +/* adev->auth_alg = algorithm; */ /* set flag to make sure the card WEP settings get updated */ /* OW @@ -5977,7 +5977,7 @@ int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm, */ result = -EINPROGRESS; -/* acx_sem_unlock(adev); */ +/* acx_sem_unlock(adev); */ FN_EXIT1(result); return result; @@ -6269,14 +6269,14 @@ int acx_op_add_interface(struct ieee80211_hw *ieee, default: logf1(L_ANY, "Unknown adev->vif_type=%d\n", adev->vif_type); - + goto out_unlock; break; } /* Reconfigure mac-address globally, affecting all vifs */ if (!mac_is_equal(mac_vif, adev->dev_addr)) { - + acx1xx_set_station_id(adev, mac_vif); SET_IEEE80211_PERM_ADDR(adev->ieee, adev->dev_addr); } @@ -6324,8 +6324,8 @@ void acx_op_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) FN_EXIT0; } -/* FUNCTION_GREP_RESET - * The function_grep script can get confused with multiple "{"" opening braces +/* FUNCTION_GREP_RESET + * The function_grep script can get confused with multiple "{"" opening braces * due e.g. due to #ifdefs. This tag reset the parser state of the script. */ @@ -6575,7 +6575,7 @@ int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, err = 0; break; */ } - + out_unlock: acx_unlock(adev, flags); @@ -6625,7 +6625,7 @@ int acx_conf_tx(struct ieee80211_hw *hw, u16 queue, FN_ENTER; acx_sem_lock(adev); /* TODO */ - acx_sem_unlock(adev); + acx_sem_unlock(adev); FN_EXIT0; return 0; } -- 1.7.9.2 |
From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:17
|
Signed-off-by: Larry Finger <Lar...@lw...> --- merge.c | 58 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/merge.c b/merge.c index 4541b2a..649cfab 100644 --- a/merge.c +++ b/merge.c @@ -219,10 +219,10 @@ static int acx_allocate(acx_device_t *adev, struct desc_info *di, */ di->phy = (dma_addr_t) NULL; } - + if (ptr) { log(L_DEBUG, "%s sz=%u adr=0x%p phy=0x%08llx\n", msg, - di->size, ptr, (unsigned long long)di->phy); + di->size, ptr, (unsigned long long)di->phy); memset(ptr, 0, di->size); di->start = ptr; return 0; @@ -562,7 +562,7 @@ static void acx_create_tx_desc_queue(acx_device_t *adev, u32 tx_queue_start) : (txdesc_t *) tx_queue_start; log(L_DEBUG, "adev->iobase2=%p\n" - "tx_queue_start=%08X\n" + "tx_queue_start=%08X\n" "adev->tx.desc_start=%p\n", adev->iobase2, tx_queue_start, adev->tx.desc_start); @@ -597,7 +597,7 @@ static void acx_create_tx_desc_queue(acx_device_t *adev, u32 tx_queue_start) if (IS_PCI(adev)) memset(adev->tx.desc_start, 0, TX_CNT * sizeof(*txdesc)); - else { + else { /* adev->tx.desc_start refers to device memory, so we can't write directly to it. */ clr = (ulong) adev->tx.desc_start; @@ -617,7 +617,7 @@ static void acx_create_tx_desc_queue(acx_device_t *adev, u32 tx_queue_start) /* pointer to hostdesc memory */ txdesc->HostMemPtr = ptr2acx(hostmemptr); /* initialise ctl */ - txdesc->Ctl_8 = (DESC_CTL_HOSTOWN + txdesc->Ctl_8 = (DESC_CTL_HOSTOWN | DESC_CTL_RECLAIM | DESC_CTL_AUTODMA | DESC_CTL_FIRSTFRAG); @@ -943,7 +943,7 @@ int acx_write_eeprom(acx_device_t *adev, u32 addr, u32 len, data_verify = kmalloc(len, GFP_KERNEL); if (!data_verify) goto end; - + for (i = 0; i < len; i++) { write_reg32(adev, IO_ACX_EEPROM_CFG, 0); write_reg32(adev, IO_ACX_EEPROM_ADDR, addr + i); @@ -997,7 +997,7 @@ static inline void acx_read_eeprom_area(acx_device_t *adev) * (usb|x). Messing with rx/tx disabling and enabling here * (write_reg32(adev, IO_ACX_ENABLE, 0b000000xx)) kills traffic */ -int _acx_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf) +int _acx_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf) { int result = NOT_OK; int count; @@ -1204,7 +1204,7 @@ int acx_write_fw(acx_device_t *adev, const firmware_image_t *fw_image, * OK success */ int acx_validate_fw(acx_device_t *adev, const firmware_image_t *fw_image, - u32 offset) + u32 offset) { u32 sum, v32, w32; int len, size; @@ -1496,7 +1496,7 @@ static inline void acx_show_card_eeprom_id(acx_device_t *adev) {} * ================================================== */ -#if 1 // +#if 1 // u32 acx_read_cmd_type_status(acx_device_t *adev) { u32 cmd_type, cmd_status; @@ -1512,7 +1512,7 @@ u32 acx_read_cmd_type_status(acx_device_t *adev) log(L_DEBUG, "cmd_type:%04X cmd_status:%04X [%s]\n", cmd_type, cmd_status, acx_cmd_status_str(cmd_status)); - + FN_EXIT1(cmd_status); return cmd_status; } @@ -1627,7 +1627,7 @@ int acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, counter = 199; /* in ms */ /* from pci.c */ timeout = HZ / 5; - counter = (timeout * 1000 / HZ) - 1; + counter = (timeout * 1000 / HZ) - 1; timeout += jiffies; do { @@ -1747,7 +1747,7 @@ int acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, logf1(L_CTL, "%s: cmd=%s, buflen=%u, timeout=%ums, type=0x%04X: %s\n", devname, cmdstr, buflen, cmd_timeout, - (buffer + (buffer ? le16_to_cpu(((acx_ie_generic_t *) buffer)->type) : -1), acx_cmd_status_str(cmd_status) @@ -1960,7 +1960,7 @@ int acx_reset_dev(acx_device_t *adev) mdelay (10); tmp = read_reg32(adev, REG_ACX_VENDOR_ID); } - + /* end what Windows driver does */ acxmem_reset_mac(adev); @@ -1989,7 +1989,7 @@ int acx_reset_dev(acx_device_t *adev) /* scan, if any, is stopped now, setting corresponding IRQ bit */ (IS_MEM(adev)) ? adev->irq_status |= HOST_INT_SCAN_COMPLETE - : SET_BIT(adev->irq_status, HOST_INT_SCAN_COMPLETE); + : SET_BIT(adev->irq_status, HOST_INT_SCAN_COMPLETE); /* need to know radio type before fw load */ /* Need to wait for arrival of this information in a loop, @@ -2017,7 +2017,7 @@ int acx_reset_dev(acx_device_t *adev) result = (IS_MEM(adev)) ? acxmem_upload_fw(adev) : acxpci_upload_fw(adev); - if (OK != result) + if (OK != result) goto end_fail; acxmem_lock(); @@ -2100,7 +2100,7 @@ int acx_verify_init(acx_device_t *adev) acxmem_lock(); irqstat = read_reg32(adev, IO_ACX_IRQ_STATUS_NON_DES); - if ((irqstat != 0xFFFFFFFF) + if ((irqstat != 0xFFFFFFFF) && (irqstat & HOST_INT_FCS_THRESHOLD)) { result = OK; write_reg32(adev, IO_ACX_IRQ_ACK, @@ -2109,7 +2109,7 @@ int acx_verify_init(acx_device_t *adev) break; } acxmem_unlock(); - + if (time_after(jiffies, timeout)) break; /* Init may take up to ~0.5 sec total */ @@ -2366,7 +2366,7 @@ int acxmem_proc_diag_output(struct seq_file *file, txd.ack_failures, txd.rts_failures, txd.rts_ok, txd.u.r1.rate, txd.u.r1.queue_ctrl, txd.queue_info); - + tmp = read_slavemem32(adev, (ulong) & (txdesc->AcxMemPtr)); seq_printf(file, " %04x: ", tmp); @@ -3102,7 +3102,7 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, /* Get rate for acx100, single rate only for acx100 */ rateset = ieee80211_get_tx_rate(adev->ieee, info)->hw_value; logf1(L_BUFT, "rateset=%u\n", rateset); - + (IS_PCI(adev)) ? txdesc->u.r1.rate = (u8) rateset : write_slavemem8(adev, (ulong) &(txdesc->u.r1.rate), @@ -3420,7 +3420,7 @@ unsigned int acx_tx_clean_txdesc(acx_device_t *adev) finger, txstatus); /* And finally report upstream */ - + if (IS_MEM(adev)) ieee80211_tx_status_irqsafe(adev->ieee, hostdesc->skb); else { @@ -3672,25 +3672,25 @@ void acx_irq_work(struct work_struct *work) * removed, because if was creating a race, * sequencing problem in AP mode during WPA * association with different STAs. - * + * * The result were many WPA assoc retries of * the STA, until assoc finally succeeded. It * happens sporadically, but still often. I * oberserved this with a ath5k and acx STA. - * + * * It manifested as followed: * 1) STA authenticates and associates - * 2) And then hostapd reported reception of a + * 2) And then hostapd reported reception of a * Data/PS-poll frame of an unassociated STA * 3) hostapd sends disassoc frame - * 4) And then it was looping in retrying this seq, + * 4) And then it was looping in retrying this seq, * until it succeed 'by accident' * * Removing the TX_START_CLEAN check and * always report directly on the tx status * resolved this problem. Now WPA assoc * succeeds directly and robust. - */ + */ acx_tx_clean_txdesc(adev); /* Restart queue if stopped and enough tx-descr free */ @@ -4019,9 +4019,9 @@ static irqreturn_t acxmem_interrupt(int irq, void *dev_id) /* OW 20091129 TODO Currently breaks mem.c ... * If sleeping is required like for update card settings, this is usefull * For now I replaced sleeping for command handling by mdelays. - * if (adev->after_interrupt_jobs){ - * acx_e_after_interrupt_task(adev); - * } + * if (adev->after_interrupt_jobs){ + * acx_e_after_interrupt_task(adev); + * } */ @@ -5027,7 +5027,7 @@ static struct platform_driver acxmem_driver = { }, .probe = acxmem_probe, .remove = __devexit_p(acxmem_remove), - + #ifdef CONFIG_PM .suspend = acxmem_e_suspend, .resume = acxmem_e_resume -- 1.7.9.2 |
From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:19
|
In commit 6f35bd1, I incorrectly used casts of pointers from (u32) to (ulong) to fix gcc warnings. That cast is not correct and I should have used (uintptr_t), which is correct for both 32- and 64-bit systems. Reported-by: Stefan Weil <sw...@we...> Signed-off-by: Larry Finger <Lar...@lw...> --- mem.c | 43 +++++++++++++-------------- merge.c | 100 +++++++++++++++++++++++++++++++-------------------------------- 2 files changed, 72 insertions(+), 71 deletions(-) diff --git a/mem.c b/mem.c index d936d0a..6438385 100644 --- a/mem.c +++ b/mem.c @@ -189,7 +189,7 @@ void acxmem_copy_from_slavemem(acx_device_t *adev, u8 *destination, * Right now I'm making the assumption that the destination is * aligned, but I'd better check. */ - if ((ulong) destination & 3) { + if ((uintptr_t) destination & 3) { pr_acx("copy_from_slavemem: warning! destination not word-aligned!\n"); } @@ -306,7 +306,7 @@ void acxmem_chaincopy_to_slavemem(acx_device_t *adev, u32 destination, pr_err("chaincopy_to_slavemem overflow!\n"); count = sizeof aligned_source; } - if ((ulong) source & 3) { + if ((uintptr_t) source & 3) { memcpy(aligned_source, source, count); data = (u32 *) aligned_source; } @@ -371,7 +371,7 @@ void acxmem_chaincopy_from_slavemem(acx_device_t *adev, u8 *destination, pr_acx("chaincopy: source block 0x%04x not aligned!\n", source); acxmem_dump_mem(adev, 0, 0x10000); } - if ((ulong) destination & 3) { + if ((uintptr_t) destination & 3) { /* printk ("acx chaincopy: data destination not word aligned!\n"); */ data = (u32 *) aligned_destination; if (count > sizeof aligned_destination) { @@ -414,7 +414,7 @@ void acxmem_chaincopy_from_slavemem(acx_device_t *adev, u8 *destination, * If the destination wasn't aligned, we would have saved it * in the aligned buffer, so copy it where it should go. */ - if ((ulong) destination & 3) { + if ((uintptr_t) destination & 3) { memcpy(destination, aligned_destination, saved_count); } } @@ -533,7 +533,7 @@ acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, /* * slave memory version */ - acxmem_copy_to_slavemem(adev, (ulong) (adev->cmd_area + 4), buffer, (cmd + acxmem_copy_to_slavemem(adev, (uintptr_t) (adev->cmd_area + 4), buffer, (cmd == ACX1xx_CMD_INTERROGATE) ? 4 : buflen); } /* now write the actual command type */ @@ -641,7 +641,7 @@ acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, /* read in result parameters if needed */ if (buffer && buflen && (cmd == ACX1xx_CMD_INTERROGATE)) { - acxmem_copy_from_slavemem(adev, buffer, (ulong) (adev->cmd_area + 4), buflen); + acxmem_copy_from_slavemem(adev, buffer, (uintptr_t) (adev->cmd_area + 4), buflen); if (acx_debug & L_DEBUG) { log(L_ANY, "%s: output buffer (len=%u): ", __func__, buflen); acx_dump_bytes(buffer, buflen); @@ -697,7 +697,7 @@ STATick int acxmem_complete_hw_reset(acx_device_t *adev) if (IS_ACX100(adev)) { /* ACX100: configopt struct in cmd mailbox - directly * after reset */ - acxmem_copy_from_slavemem(adev, (u8*) &co, (ulong) adev->cmd_area, sizeof(co)); + acxmem_copy_from_slavemem(adev, (u8*) &co, (uintptr_t) adev->cmd_area, sizeof(co)); } acxmem_unlock(); @@ -861,7 +861,7 @@ int acxmem_proc_diag_output(struct seq_file *file, if (rxdesc) for (i = 0; i < RX_CNT; i++) { rtl = (i == adev->rx.tail) ? " [tail]" : ""; - Ctl_8 = read_slavemem8(adev, (ulong) + Ctl_8 = read_slavemem8(adev, (uintptr_t) &(rxdesc->Ctl_8)); if (Ctl_8 & DESC_CTL_HOSTOWN) seq_printf(file, "%02u (%02x) FULL %-10s", @@ -873,10 +873,10 @@ int acxmem_proc_diag_output(struct seq_file *file, /* seq_printf(file, "\n"); */ acxmem_copy_from_slavemem(adev, (u8 *) &rxd, - (ulong) rxdesc, sizeof(rxd)); + (uintptr_t) rxdesc, sizeof(rxd)); seq_printf(file, "%0lx: %04x %04x %04x %04x %04x %04x %04x Ctl_8=%04x %04x %04x %04x %04x %04x %04x %04x\n", - (ulong) rxdesc, + (uintptr_t) rxdesc, rxd.pNextDesc.v, rxd.HostMemPtr.v, rxd.ACXMemPtr.v, @@ -910,9 +910,9 @@ int acxmem_proc_diag_output(struct seq_file *file, thd = (i == adev->tx_head) ? " [head]" : ""; ttl = (i == adev->tx.tail) ? " [tail]" : ""; acxmem_copy_from_slavemem(adev, (u8 *) &txd, - (ulong) txdesc, sizeof(txd)); + (uintptr_t) txdesc, sizeof(txd)); - Ctl_8 = read_slavemem8(adev, (ulong) &(txdesc->Ctl_8)); + Ctl_8 = read_slavemem8(adev, (uintptr_t) &(txdesc->Ctl_8)); if (Ctl_8 & DESC_CTL_ACXDONE) seq_printf(file, "%02u ready to free (%02X)%-7s%-7s", i, Ctl_8, thd, ttl); @@ -925,7 +925,7 @@ int acxmem_proc_diag_output(struct seq_file *file, seq_printf(file, "%0lx: %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %02x %02x %02x %02x " - "%02x %02x %02x %02x %04x: ", (ulong) txdesc, + "%02x %02x %02x %02x %04x: ", (uintptr_t) txdesc, txd.pNextDesc.v, txd.HostMemPtr.v, txd.AcxMemPtr.v, txd.tx_time, txd.total_length, txd.Reserved, @@ -936,7 +936,7 @@ int acxmem_proc_diag_output(struct seq_file *file, txd.u.r1.queue_ctrl, txd.queue_info); tmp = read_slavemem32(adev, - (ulong) & (txdesc->AcxMemPtr)); + (uintptr_t) & (txdesc->AcxMemPtr)); seq_printf(file, " %04x: ", tmp); /* Output allocated tx-buffer chain */ @@ -1067,7 +1067,7 @@ STATick void acxmem_process_rxdesc(acx_device_t *adev) * rx descriptor on the ACX, which should be * 0x11000000 if we should process it. */ - Ctl_8 = hostdesc->hd.Ctl_16 = read_slavemem8(adev, (ulong) &(rxdesc->Ctl_8)); + Ctl_8 = hostdesc->hd.Ctl_16 = read_slavemem8(adev, (uintptr_t) &(rxdesc->Ctl_8)); if ((Ctl_8 & DESC_CTL_HOSTOWN) && (Ctl_8 & DESC_CTL_ACXDONE)) break; /* found it! */ @@ -1089,7 +1089,7 @@ STATick void acxmem_process_rxdesc(acx_device_t *adev) * slave interface - pull data now */ hostdesc->hd.length = read_slavemem16(adev, - (ulong) &(rxdesc->total_length)); + (uintptr_t) &(rxdesc->total_length)); /* * hostdesc->data is an rxbuffer_t, which @@ -1098,7 +1098,7 @@ STATick void acxmem_process_rxdesc(acx_device_t *adev) * information takes up an additional 12 * bytes, so add that to the length we copy. */ - addr = read_slavemem32(adev, (ulong) &(rxdesc->ACXMemPtr)); + addr = read_slavemem32(adev, (uintptr_t) &(rxdesc->ACXMemPtr)); if (addr) { /* * How can &(rxdesc->ACXMemPtr) above @@ -1107,12 +1107,13 @@ STATick void acxmem_process_rxdesc(acx_device_t *adev) * for debug. */ if (addr & 0xffff0000) { - log(L_ANY, "%s: rxdesc 0x%08lx\n", __func__, (ulong) rxdesc); + log(L_ANY, "%s: rxdesc 0x%08lx\n", + __func__, (uintptr_t) rxdesc); acxmem_dump_mem(adev, 0, 0x10000); panic("Bad access!"); } acxmem_chaincopy_from_slavemem(adev, (u8 *) hostdesc->data, addr, - hostdesc->hd.length + (ulong) &((rxbuffer_t *) 0)->hdr_a3); + hostdesc->hd.length + (uintptr_t) &((rxbuffer_t *) 0)->hdr_a3); acx_process_rxbuf(adev, hostdesc->data); } @@ -1128,7 +1129,7 @@ STATick void acxmem_process_rxdesc(acx_device_t *adev) CLEAR_BIT (Ctl_8, DESC_CTL_HOSTOWN); SET_BIT (Ctl_8, DESC_CTL_HOSTDONE); SET_BIT (Ctl_8, DESC_CTL_RECLAIM); - write_slavemem8(adev, (ulong) &rxdesc->Ctl_8, Ctl_8); + write_slavemem8(adev, (uintptr_t) &rxdesc->Ctl_8, Ctl_8); /* * Now tell the ACX we've finished with the receive @@ -1140,7 +1141,7 @@ STATick void acxmem_process_rxdesc(acx_device_t *adev) hostdesc = &adev->rx.host.rxstart[tail]; rxdesc = &adev->rx.desc_start[tail]; - Ctl_8 = hostdesc->hd.Ctl_16 = read_slavemem8(adev, (ulong) &(rxdesc->Ctl_8)); + Ctl_8 = hostdesc->hd.Ctl_16 = read_slavemem8(adev, (uintptr_t) &(rxdesc->Ctl_8)); /* if next descriptor is empty, then bail out */ if (!(Ctl_8 & DESC_CTL_HOSTOWN) || !(Ctl_8 & DESC_CTL_ACXDONE)) diff --git a/merge.c b/merge.c index 649cfab..bab9f51 100644 --- a/merge.c +++ b/merge.c @@ -494,8 +494,8 @@ static void acx_create_rx_desc_queue(acx_device_t * adev, u32 rx_queue_start) memset(adev->rx.desc_start, 0, RX_CNT * sizeof(*rxdesc)); else { // IS_MEM - mem_offs = (ulong) adev->rx.desc_start; - while (mem_offs < (ulong) adev->rx.desc_start + mem_offs = (uintptr_t) adev->rx.desc_start; + while (mem_offs < (uintptr_t) adev->rx.desc_start + (RX_CNT * sizeof(*rxdesc))) { write_slavemem32(adev, mem_offs, 0); mem_offs += 4; @@ -515,7 +515,7 @@ static void acx_create_rx_desc_queue(acx_device_t * adev, u32 rx_queue_start) else // IS_MEM { write_slavemem32(adev, - (ulong) &(rxdesc->pNextDesc), + (uintptr_t) &(rxdesc->pNextDesc), (u32) cpu_to_le32 ((u8 *) rxdesc + sizeof(*rxdesc))); } @@ -532,8 +532,8 @@ static void acx_create_rx_desc_queue(acx_device_t * adev, u32 rx_queue_start) if (IS_PCI(adev)) rxdesc->pNextDesc = cpu2acx(rx_queue_start); else // IS_MEM - write_slavemem32(adev, (ulong) &(rxdesc->pNextDesc), - (ulong) cpu_to_le32 (rx_queue_start)); + write_slavemem32(adev, (uintptr_t) &(rxdesc->pNextDesc), + (uintptr_t) cpu_to_le32 (rx_queue_start)); } FN_EXIT0; @@ -600,8 +600,8 @@ static void acx_create_tx_desc_queue(acx_device_t *adev, u32 tx_queue_start) else { /* adev->tx.desc_start refers to device memory, so we can't write directly to it. */ - clr = (ulong) adev->tx.desc_start; - while (clr < (ulong) adev->tx.desc_start + clr = (uintptr_t) adev->tx.desc_start; + while (clr < (uintptr_t) adev->tx.desc_start + (TX_CNT * sizeof(*txdesc))) { write_slavemem32(adev, clr, 0); clr += 4; @@ -637,14 +637,14 @@ static void acx_create_tx_desc_queue(acx_device_t *adev, u32 tx_queue_start) } else { /* initialise ctl */ /* No auto DMA here */ - write_slavemem8(adev, (ulong) &(txdesc->Ctl_8), + write_slavemem8(adev, (uintptr_t) &(txdesc->Ctl_8), (u8) (DESC_CTL_HOSTOWN | DESC_CTL_FIRSTFRAG)); /* done by memset(0): txdesc->Ctl2_8 = 0; */ /* point to next txdesc */ - write_slavemem32(adev, (ulong) &(txdesc->pNextDesc), + write_slavemem32(adev, (uintptr_t) &(txdesc->pNextDesc), (u32) cpu_to_le32 ((u8 *) txdesc + adev->tx.desc_size)); @@ -659,7 +659,7 @@ static void acx_create_tx_desc_queue(acx_device_t *adev, u32 tx_queue_start) if (IS_PCI(adev)) txdesc->pNextDesc = cpu2acx(tx_queue_start); else - write_slavemem32(adev, (ulong) &(txdesc->pNextDesc), + write_slavemem32(adev, (uintptr_t) &(txdesc->pNextDesc), (u32) cpu_to_le32 (tx_queue_start)); } FN_EXIT0; @@ -682,7 +682,7 @@ void acx_create_desc_queues(acx_device_t *adev, u32 tx_queue_start, p = (u32 *) adev->acx_queue_indicator; for (i = 0; i < 4; i++) { - write_slavemem32(adev, (ulong) p, 0); + write_slavemem32(adev, (uintptr_t) p, 0); p++; } out: @@ -799,7 +799,7 @@ void acx_log_txbuffer(acx_device_t *adev) pr_acx("tx: desc->Ctl8's: "); for (i = 0; i < TX_CNT; i++) { Ctl_8 = (IS_MEM(adev)) - ? read_slavemem8(adev, (ulong) &(txdesc->Ctl_8)) + ? read_slavemem8(adev, (uintptr_t) &(txdesc->Ctl_8)) : txdesc->Ctl_8; printk("%02X ", Ctl_8); txdesc = acx_advance_txdesc(adev, txdesc, 1); @@ -1504,7 +1504,7 @@ u32 acx_read_cmd_type_status(acx_device_t *adev) FN_ENTER; cmd_type = (IS_MEM(adev)) - ? read_slavemem32(adev, (ulong) adev->cmd_area) + ? read_slavemem32(adev, (uintptr_t) adev->cmd_area) : acx_readl(adev->cmd_area); cmd_status = (cmd_type >> 16); cmd_type = (u16) cmd_type; @@ -1524,7 +1524,7 @@ void acx_write_cmd_type_status(acx_device_t *adev, u16 type, u16 status) FN_ENTER; if (IS_MEM(adev)) - write_slavemem32(adev, (ulong) adev->cmd_area, + write_slavemem32(adev, (uintptr_t) adev->cmd_area, type | (status << 16)); else acx_writel(type | (status << 16), adev->cmd_area); @@ -2516,7 +2516,7 @@ void acx_process_rxdesc(acx_device_t *adev) * 0x11000000 if we should process it. */ Ctl_8 = hostdesc->hd.Ctl_16 - = read_slavemem8(adev, (ulong) &(rxdesc->Ctl_8)); + = read_slavemem8(adev, (uintptr_t) &(rxdesc->Ctl_8)); if ((Ctl_8 & DESC_CTL_HOSTOWN) && (Ctl_8 & DESC_CTL_ACXDONE)) break; /* found it! */ @@ -2567,7 +2567,7 @@ void acx_process_rxdesc(acx_device_t *adev) /* slave interface - pull data now */ hostdesc->hd.length = read_slavemem16(adev, - (ulong) &(rxdesc->total_length)); + (uintptr_t) &(rxdesc->total_length)); /* * hostdesc->data is an rxbuffer_t, which * includes header information, but the length @@ -2576,7 +2576,7 @@ void acx_process_rxdesc(acx_device_t *adev) * bytes, so add that to the length we copy. */ addr = read_slavemem32(adev, - (ulong) &(rxdesc->ACXMemPtr)); + (uintptr_t) &(rxdesc->ACXMemPtr)); if (addr) { /* * How can &(rxdesc->ACXMemPtr) above @@ -2586,14 +2586,14 @@ void acx_process_rxdesc(acx_device_t *adev) */ if (addr & 0xffff0000) { log(L_ANY, "%s: rxdesc 0x%08lx\n", - __func__, (ulong) rxdesc); + __func__, (uintptr_t) rxdesc); acxmem_dump_mem(adev, 0, 0x10000); panic("Bad access!"); } acxmem_chaincopy_from_slavemem(adev, (u8 *) hostdesc->data, addr, hostdesc->hd.length - + (ulong) &((rxbuffer_t *) 0)->hdr_a3); + + (uintptr_t) &((rxbuffer_t *) 0)->hdr_a3); acx_process_rxbuf(adev, hostdesc->data); } @@ -2608,7 +2608,7 @@ void acx_process_rxdesc(acx_device_t *adev) CLEAR_BIT (Ctl_8, DESC_CTL_HOSTOWN); SET_BIT (Ctl_8, DESC_CTL_HOSTDONE); SET_BIT (Ctl_8, DESC_CTL_RECLAIM); - write_slavemem8(adev, (ulong) &rxdesc->Ctl_8, Ctl_8); + write_slavemem8(adev, (uintptr_t) &rxdesc->Ctl_8, Ctl_8); /* * Now tell the ACX we've finished with the receive buffer so @@ -2621,7 +2621,7 @@ void acx_process_rxdesc(acx_device_t *adev) rxdesc = &adev->rx.desc_start[tail]; Ctl_8 = hostdesc->hd.Ctl_16 - = read_slavemem8(adev, (ulong) &(rxdesc->Ctl_8)); + = read_slavemem8(adev, (uintptr_t) &(rxdesc->Ctl_8)); /* if next descriptor is empty, then bail out */ if (!(Ctl_8 & DESC_CTL_HOSTOWN) || !(Ctl_8 & DESC_CTL_ACXDONE)) @@ -2747,7 +2747,7 @@ tx_t *acxmem_alloc_tx(acx_device_t *adev, unsigned int len) { * txdesc points to ACX memory */ txdesc = acx_get_txdesc(adev, head); - ctl8 = read_slavemem8(adev, (ulong) &(txdesc->Ctl_8)); + ctl8 = read_slavemem8(adev, (uintptr_t) &(txdesc->Ctl_8)); /* * If we don't own the buffer (HOSTOWN) it is certainly not @@ -2771,7 +2771,7 @@ tx_t *acxmem_alloc_tx(acx_device_t *adev, unsigned int len) { } /* Needed in case txdesc won't be eventually submitted for tx */ - write_slavemem8(adev, (ulong) &(txdesc->Ctl_8), DESC_CTL_ACXDONE_HOSTOWN); + write_slavemem8(adev, (uintptr_t) &(txdesc->Ctl_8), DESC_CTL_ACXDONE_HOSTOWN); adev->tx_free--; log(L_BUFT, "%s: tx: got desc %u, %u remain\n", @@ -2818,7 +2818,7 @@ void acxmem_dealloc_tx(acx_device_t *adev, tx_t *tx_opaque) { /* * Clear out all of the transmit descriptor except for the next pointer */ - acxmem_copy_to_slavemem(adev, (ulong) &(txdesc->HostMemPtr), + acxmem_copy_to_slavemem(adev, (uintptr_t) &(txdesc->HostMemPtr), (u8 *) &(tmptxdesc.HostMemPtr), sizeof(tmptxdesc) - sizeof(tmptxdesc.pNextDesc)); @@ -3042,7 +3042,7 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, * it back in one big swoop later (also in order to have less * device memory accesses) */ Ctl_8 = (IS_MEM(adev)) - ? read_slavemem8(adev, (ulong) &(txdesc->Ctl_8)) + ? read_slavemem8(adev, (uintptr_t) &(txdesc->Ctl_8)) : txdesc->Ctl_8; Ctl2_8 = 0; /* really need to init it to 0, not txdesc->Ctl2_8, it seems */ @@ -3051,7 +3051,7 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, (IS_PCI(adev)) ? txdesc->total_length = cpu_to_le16(len) - : write_slavemem16(adev, (ulong) &(txdesc->total_length), + : write_slavemem16(adev, (uintptr_t) &(txdesc->total_length), cpu_to_le16(len)); hostdesc2->hd.length = cpu_to_le16(len - wlhdr_len); @@ -3105,7 +3105,7 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, (IS_PCI(adev)) ? txdesc->u.r1.rate = (u8) rateset - : write_slavemem8(adev, (ulong) &(txdesc->u.r1.rate), + : write_slavemem8(adev, (uintptr_t) &(txdesc->u.r1.rate), (u8) rateset); #ifdef TODO_FIGURE_OUT_WHEN_TO_SET_THIS @@ -3167,8 +3167,8 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, pr_info("Bummer. Not enough room in the txbuf_space.\n"); hostdesc1->hd.length = 0; hostdesc2->hd.length = 0; - write_slavemem16(adev, (ulong) &(txdesc->total_length), 0); - write_slavemem8(adev, (ulong) &(txdesc->Ctl_8), DESC_CTL_HOSTOWN + write_slavemem16(adev, (uintptr_t) &(txdesc->total_length), 0); + write_slavemem8(adev, (uintptr_t) &(txdesc->Ctl_8), DESC_CTL_HOSTOWN | DESC_CTL_FIRSTFRAG); adev->tx_head = ((u8*) txdesc - (u8*) adev->tx.desc_start) / adev->tx.desc_size; @@ -3178,7 +3178,7 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, /* * Tell the ACX where the packet is. */ - write_slavemem32(adev, (ulong) &(txdesc->AcxMemPtr), addr); + write_slavemem32(adev, (uintptr_t) &(txdesc->AcxMemPtr), addr); } @@ -3201,8 +3201,8 @@ is_pci_branch: /* At this point Ctl_8 should just be FIRSTFRAG */ CLEAR_BIT(Ctl2_8, DESC_CTL2_WEP); if (IS_MEM(adev)) { - write_slavemem8(adev, (ulong) &(txdesc->Ctl2_8), Ctl2_8); - write_slavemem8(adev, (ulong) &(txdesc->Ctl_8), Ctl_8); + write_slavemem8(adev, (uintptr_t) &(txdesc->Ctl2_8), Ctl2_8); + write_slavemem8(adev, (uintptr_t) &(txdesc->Ctl_8), Ctl_8); } else { txdesc->Ctl2_8 = Ctl2_8; txdesc->Ctl_8 = Ctl_8; @@ -3246,7 +3246,7 @@ end_of_chain: pr_acx("tx: pkt (%s): len %d rate %03u%s status %u\n", acx_get_packet_type_string(fc), len, read_slavemem8(adev, - (ulong) &(txdesc->u.r1.rate)), + (uintptr_t) &(txdesc->u.r1.rate)), (Ctl_8 & DESC_CTL_SHORT_PREAMBLE) ? "(SPr)" : "", adev->status); @@ -3324,7 +3324,7 @@ unsigned int acx_tx_clean_txdesc(acx_device_t *adev) /* stop if not marked as "tx finished" and "host owned" */ Ctl_8 = (IS_MEM(adev)) - ? read_slavemem8(adev, (ulong) &(txdesc->Ctl_8)) + ? read_slavemem8(adev, (uintptr_t) &(txdesc->Ctl_8)) : txdesc->Ctl_8; /* OW FIXME Check against pci.c */ @@ -3340,17 +3340,17 @@ unsigned int acx_tx_clean_txdesc(acx_device_t *adev) /* remember desc values... */ if (IS_MEM(adev)) { - error = read_slavemem8(adev, (ulong) &(txdesc->error)); + error = read_slavemem8(adev, (uintptr_t) &(txdesc->error)); ack_failures = read_slavemem8(adev, - (ulong) &(txdesc->ack_failures)); + (uintptr_t) &(txdesc->ack_failures)); rts_failures = read_slavemem8(adev, - (ulong) &(txdesc->rts_failures)); - rts_ok = read_slavemem8(adev, (ulong) &(txdesc->rts_ok)); + (uintptr_t) &(txdesc->rts_failures)); + rts_ok = read_slavemem8(adev, (uintptr_t) &(txdesc->rts_ok)); /* OW FIXME does this also require le16_to_cpu()? */ r100 = read_slavemem8(adev, - (ulong) &(txdesc->u.r1.rate)); + (uintptr_t) &(txdesc->u.r1.rate)); r111 = le16_to_cpu(read_slavemem16(adev, - (ulong)&(txdesc->u.r2.rate111))); + (uintptr_t)&(txdesc->u.r2.rate111))); } else { error = txdesc->error; ack_failures = txdesc->ack_failures; @@ -3388,14 +3388,14 @@ unsigned int acx_tx_clean_txdesc(acx_device_t *adev) /* Free up the transmit data buffers */ if (IS_MEM(adev)) { acxmem = read_slavemem32(adev, - (ulong) &(txdesc->AcxMemPtr)); + (uintptr_t) &(txdesc->AcxMemPtr)); if (acxmem) acxmem_reclaim_acx_txbuf_space(adev, acxmem); /* ...and free the desc by clearing all the fields except the next pointer */ acxmem_copy_to_slavemem(adev, - (ulong) &(txdesc->HostMemPtr), + (uintptr_t) &(txdesc->HostMemPtr), (u8 *) &(tmptxdesc.HostMemPtr), ( sizeof(tmptxdesc) - sizeof(tmptxdesc.pNextDesc))); @@ -3463,11 +3463,11 @@ void acx_clean_txdesc_emergency(acx_device_t *adev) txd->Ctl_8 = DESC_CTL_HOSTOWN; continue; } else { - write_slavemem8(adev, (ulong) &(txd->ack_failures), 0); - write_slavemem8(adev, (ulong) &(txd->rts_failures), 0); - write_slavemem8(adev, (ulong) &(txd->rts_ok), 0); - write_slavemem8(adev, (ulong) &(txd->error), 0); - write_slavemem8(adev, (ulong) &(txd->Ctl_8), + write_slavemem8(adev, (uintptr_t) &(txd->ack_failures), 0); + write_slavemem8(adev, (uintptr_t) &(txd->rts_failures), 0); + write_slavemem8(adev, (uintptr_t) &(txd->rts_ok), 0); + write_slavemem8(adev, (uintptr_t) &(txd->error), 0); + write_slavemem8(adev, (uintptr_t) &(txd->Ctl_8), DESC_CTL_HOSTOWN); } #if 0 @@ -3480,7 +3480,7 @@ void acx_clean_txdesc_emergency(acx_device_t *adev) if (acxmem) acxmem_reclaim_acx_txbuf_space(adev, acxmem); #endif - write_slavemem32(adev, (ulong) &(txd->AcxMemPtr), 0); + write_slavemem32(adev, (uintptr_t) &(txd->AcxMemPtr), 0); } adev->tx_free = TX_CNT; @@ -3829,7 +3829,7 @@ void acx_handle_info_irq(acx_device_t *adev) u32 info_type, info_status; info_type = (IS_MEM(adev)) - ? read_slavemem32(adev, (ulong) adev->info_area) + ? read_slavemem32(adev, (uintptr_t) adev->info_area) : acx_readl(adev->info_area); info_status = (info_type >> 16); @@ -3837,7 +3837,7 @@ void acx_handle_info_irq(acx_device_t *adev) /* inform fw that we have read this info message */ (IS_MEM(adev)) - ? write_slavemem32(adev, (ulong) adev->info_area, info_type | 0x00010000) + ? write_slavemem32(adev, (uintptr_t) adev->info_area, info_type | 0x00010000) : acx_writel(info_type | 0x00010000, adev->info_area); write_reg16(adev, IO_ACX_INT_TRIG, INT_TRIG_INFOACK); write_flush(adev); -- 1.7.9.2 |
From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:20
|
The previous patch left some warnings on 64-bit systems that are now removed. Signed-off-by: Larry Finger <Lar...@lw...> --- common.c | 2 +- debugfs.c | 8 ++++---- merge.c | 38 +++++++++++++++++++------------------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/common.c b/common.c index 824e595..9e03c5a 100644 --- a/common.c +++ b/common.c @@ -1155,7 +1155,7 @@ static int acx100_create_dma_regions(acx_device_t * adev) /* sets the beginning of the rx descriptor queue, * after the tx descrs */ adev->acx_queue_indicator = (queueindicator_t *) - le32_to_cpu (queueconf.QueueEnd); + (uintptr_t)le32_to_cpu (queueconf.QueueEnd); if (OK != acx_create_hostdesc_queues(adev)) goto fail; diff --git a/debugfs.c b/debugfs.c index 8ad57b4..e76eee2 100644 --- a/debugfs.c +++ b/debugfs.c @@ -59,7 +59,7 @@ static const char *const dbgfs_files[] = { static int acx_dbgfs_open(struct inode *inode, struct file *file) { - int fidx = (int) inode->i_private; + int fidx = (uintptr_t)inode->i_private; struct acx_device *adev = (struct acx_device *) file->f_path.dentry->d_parent->d_inode->i_private; @@ -84,10 +84,10 @@ static int acx_dbgfs_open(struct inode *inode, struct file *file) return single_open(file, acx_proc_show_funcs[fidx], adev); } -static int acx_dbgfs_write(struct file *file, const char __user *buf, +static ssize_t acx_dbgfs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { - int fidx = (int) file->f_path.dentry->d_inode->i_private; + int fidx = (uintptr_t) file->f_path.dentry->d_inode->i_private; struct acx_device *adev = (struct acx_device *) file->f_path.dentry->d_parent->d_inode->i_private; @@ -123,7 +123,7 @@ static struct dentry *acx_dbgfs_dir; int acx_debugfs_add_adev(struct acx_device *adev) { - int i; + long i; fmode_t fmode; struct dentry *file; const char *devname = wiphy_name(adev->ieee->wiphy); diff --git a/merge.c b/merge.c index bab9f51..5b2ccb8 100644 --- a/merge.c +++ b/merge.c @@ -462,7 +462,7 @@ static void acx_create_rx_desc_queue(acx_device_t * adev, u32 rx_queue_start) ((u8 *) adev->iobase2 + rx_queue_start); else adev->rx.desc_start = (rxdesc_t *) - ((u8 *) rx_queue_start); + ((u8 *) (uintptr_t)rx_queue_start); rxdesc = adev->rx.desc_start; @@ -471,11 +471,11 @@ static void acx_create_rx_desc_queue(acx_device_t * adev, u32 rx_queue_start) if (IS_PCI(adev)) adev->rx.desc_start = (rxdesc_t *) - ((u8 *) adev->iobase2 + ((u8 *)(uintptr_t)adev->iobase2 + acx2cpu(rxdesc->pNextDesc)); else adev->rx.desc_start = (rxdesc_t *) - ((u8 *) acx2cpu(rxdesc->pNextDesc)); + ((u8 *)(ulong)acx2cpu(rxdesc->pNextDesc)); rxdesc = adev->rx.desc_start; } @@ -516,7 +516,7 @@ static void acx_create_rx_desc_queue(acx_device_t * adev, u32 rx_queue_start) { write_slavemem32(adev, (uintptr_t) &(rxdesc->pNextDesc), - (u32) cpu_to_le32 ((u8 *) rxdesc + (u32) cpu_to_le32 ((uintptr_t)(u8 *) rxdesc + sizeof(*rxdesc))); } @@ -559,7 +559,7 @@ static void acx_create_tx_desc_queue(acx_device_t *adev, u32 tx_queue_start) /* This refers to an ACX address, not one of ours */ adev->tx.desc_start = (IS_PCI(adev)) ? (txdesc_t *) (adev->iobase2 + tx_queue_start) - : (txdesc_t *) tx_queue_start; + : (txdesc_t *) (uintptr_t)tx_queue_start; log(L_DEBUG, "adev->iobase2=%p\n" "tx_queue_start=%08X\n" @@ -645,8 +645,8 @@ static void acx_create_tx_desc_queue(acx_device_t *adev, u32 tx_queue_start) /* point to next txdesc */ write_slavemem32(adev, (uintptr_t) &(txdesc->pNextDesc), - (u32) cpu_to_le32 ((u8 *) txdesc - + adev->tx.desc_size)); + (u32)cpu_to_le32((uintptr_t)(u8 *)txdesc + + adev->tx.desc_size)); /* go to the next one */ /* ++ is safe here (we are acx100) */ @@ -1537,7 +1537,7 @@ void acx_write_cmd_type_status(acx_device_t *adev, u16 type, u16 status) /* static inline */ void acx_init_mboxes(acx_device_t *adev) { - u32 cmd_offs, info_offs; + uintptr_t cmd_offs, info_offs; FN_ENTER; @@ -1553,10 +1553,10 @@ void acx_init_mboxes(acx_device_t *adev) adev->info_area = (u8 *) adev->iobase2 + info_offs; } /* OW iobase2 not used in mem.c, in pci.c it is */ - log(L_DEBUG, "iobase2=%p cmd_mbox_offset=%X cmd_area=%p" - "info_mbox_offset=%X info_area=%p\n", - adev->iobase2, cmd_offs, adev->cmd_area, - info_offs, adev->info_area); + log(L_DEBUG, + "iobase2=%p cmd_mbox_offset=%lX cmd_area=%pinfo_mbox_offset=%lX info_area=%p\n", + adev->iobase2, cmd_offs, adev->cmd_area, + info_offs, adev->info_area); FN_EXIT0; } @@ -2304,10 +2304,10 @@ int acxmem_proc_diag_output(struct seq_file *file, /* seq_printf(file, "\n"); */ acxmem_copy_from_slavemem(adev, (u8 *) &rxd, - (u32) rxdesc, sizeof(rxd)); + (uintptr_t) rxdesc, sizeof(rxd)); seq_printf(file, - "%04x: %04x %04x %04x %04x %04x %04x %04x Ctl_8=%04x %04x %04x %04x %04x %04x %04x %04x\n", - (uint) rxdesc, + "%04lx: %04x %04x %04x %04x %04x %04x %04x Ctl_8=%04x %04x %04x %04x %04x %04x %04x %04x\n", + (uintptr_t) rxdesc, rxd.pNextDesc.v, rxd.HostMemPtr.v, rxd.ACXMemPtr.v, @@ -2341,9 +2341,9 @@ int acxmem_proc_diag_output(struct seq_file *file, thd = (i == adev->tx_head) ? " [head]" : ""; ttl = (i == adev->tx.tail) ? " [tail]" : ""; acxmem_copy_from_slavemem(adev, (u8 *) &txd, - (u32) txdesc, sizeof(txd)); + (uintptr_t) txdesc, sizeof(txd)); - Ctl_8 = read_slavemem8(adev, (u32) &(txdesc->Ctl_8)); + Ctl_8 = read_slavemem8(adev, (uintptr_t) &(txdesc->Ctl_8)); if (Ctl_8 & DESC_CTL_ACXDONE) seq_printf(file, "%02u ready to free (%02X)%-7s%-7s", i, Ctl_8, thd, ttl); @@ -2355,9 +2355,9 @@ int acxmem_proc_diag_output(struct seq_file *file, i, Ctl_8, thd, ttl); seq_printf(file, - "%04x: %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %02x %02x %02x %02x " + "%04lx: %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %02x %02x %02x %02x " "%02x %02x %02x %02x %04x: ", - (uint) txdesc, + (uintptr_t) txdesc, txd.pNextDesc.v, txd.HostMemPtr.v, txd.AcxMemPtr.v, txd.tx_time, txd.total_length, txd.Reserved, -- 1.7.9.2 |
From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:21
|
A "make C=2 common.o" command produces the following sparse errors: common.c:6287:1: error: directive in argument list common.c:6289:1: error: directive in argument list common.c:6291:1: error: directive in argument list common.c:6341:1: error: directive in argument list common.c:6343:1: error: directive in argument list common.c:6345:1: error: directive in argument list common.c:4523:22: error: subtraction of different types can't work (different address spaces) common.c:4695:29: error: subtraction of different types can't work (different address spaces) common.c:4744:22: error: subtraction of different types can't work (different address spaces) common.c:4794:22: error: subtraction of different types can't work (different address spaces) common.c:4843:22: error: subtraction of different types can't work (different address spaces) common.c:4894:22: error: subtraction of different types can't work (different address spaces) The first 6 occur because sparse does not like splitting a statement with #ifdef. These are of no consequence, but fix them anyway. The remaining 6 will be fixed later. The command "make C=2 merge.o" produces the following errors: merge.c:3060:17: error: incompatible types in conditional expression (different base types) merge.c:3114:25: error: incompatible types in conditional expression (different base types) These 2 are "fixed" by changing from "(condition) ? a : b;" to if (condition) a; else b; It seems obvious that these two are a sparse bug, and I will report them as such. Signed-off-by: Larry Finger <Lar...@lw...> --- merge.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/merge.c b/merge.c index 5b2ccb8..e952dae 100644 --- a/merge.c +++ b/merge.c @@ -3049,9 +3049,10 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, hostdesc2 = hostdesc1 + 1; - (IS_PCI(adev)) - ? txdesc->total_length = cpu_to_le16(len) - : write_slavemem16(adev, (uintptr_t) &(txdesc->total_length), + if (IS_PCI(adev)) + txdesc->total_length = cpu_to_le16(len); + else + write_slavemem16(adev, (uintptr_t)&(txdesc->total_length), cpu_to_le16(len)); hostdesc2->hd.length = cpu_to_le16(len - wlhdr_len); @@ -3103,9 +3104,10 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, rateset = ieee80211_get_tx_rate(adev->ieee, info)->hw_value; logf1(L_BUFT, "rateset=%u\n", rateset); - (IS_PCI(adev)) - ? txdesc->u.r1.rate = (u8) rateset - : write_slavemem8(adev, (uintptr_t) &(txdesc->u.r1.rate), + if (IS_PCI(adev)) + txdesc->u.r1.rate = (u8) rateset; + else + write_slavemem8(adev, (uintptr_t)&(txdesc->u.r1.rate), (u8) rateset); #ifdef TODO_FIGURE_OUT_WHEN_TO_SET_THIS -- 1.7.9.2 |
From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:22
|
Signed-off-by: Larry Finger <Lar...@lw...> --- mem-inlines.h | 20 ++++++++++---------- mem.c | 16 ++++++++-------- mem.h | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/mem-inlines.h b/mem-inlines.h index a1ac7d6..cdcec3f 100644 --- a/mem-inlines.h +++ b/mem-inlines.h @@ -16,7 +16,7 @@ * Locking in mem is more complex as for pci, because the different * data-access functions below need to be protected against incoming * interrupts. - * + * * Data-access on the mem device is always going in serveral, * none-atomic steps, involving 2 or more register writes * (e.g. ACX_SLV_REG_ADDR, ACX_SLV_REG_DATA). @@ -25,41 +25,41 @@ * ongoing, this may give access interference with by the involved * operations, since the irq routine is also using the same * data-access functions. - * + * * In case of interference, this often manifests during driver * operations as failure of device cmds and subsequent hanging of the * device. It especially appeared during sw-scans while a connection * was up. - * + * * For this reason, irqs shall be off while data access functions are * executed, and for this we'll use the acx-spinlock. * * In pci we don't have this problem, because all data-access * functions are atomic enough and we use dma (and the sw-scan problem * is also not observed in pci, which indicates confirmation). - * + * * Apart from this, the pure acx-sem locking is already coordinating * accesses well enough, that simple driver operation without * inbetween scans work without problems. * * Different locking approaches a possible to solves this (e.g. fine * vs coarse-grained). - * + * * The chosen approach is: - * + * * 1) Mem.c data-access functions contain all a check to insure, they * are executed under the acx-spinlock. => This is the red line that * tells, if something needs coverage. - * + * * 2) The scope of acx-spinlocking is local, in this case here only to * mem.c. All common.c functions are already protected by the sem. * * 3) In order to consolidate locking calls and also to account for * the logic of the various write_flush() calls around, locking in mem * should be: - * + * * a) as coarse-grained as possible, and ... - * + * * b) ... as fine-grained as required. Basically that means, that * before functions, that sleep, unlocking needs to be done. And * locking is taken up again inside the sleeping @@ -102,7 +102,7 @@ do { \ #endif typedef enum { - ACX_SOFT_RESET = 0x0000, + ACX_SOFT_RESET = 0x0000, ACX_SLV_REG_ADDR = 0x0004, ACX_SLV_REG_DATA = 0x0008, ACX_SLV_REG_ADATA = 0x000c, diff --git a/mem.c b/mem.c index a6abe99..d936d0a 100644 --- a/mem.c +++ b/mem.c @@ -166,8 +166,8 @@ void acxmem_dump_mem(acx_device_t *adev, u32 start, int length) /* * BOM Data Access - * - * => See locking comment above + * + * => See locking comment above * ================================================== */ @@ -922,7 +922,7 @@ int acxmem_proc_diag_output(struct seq_file *file, else seq_printf(file, "%02u busy (%02X)%-7s%-7s", i, Ctl_8, thd, ttl); - + seq_printf(file, "%0lx: %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %02x %02x %02x %02x " "%02x %02x %02x %02x %04x: ", (ulong) txdesc, @@ -934,7 +934,7 @@ int acxmem_proc_diag_output(struct seq_file *file, txd.ack_failures, txd.rts_failures, txd.rts_ok, txd.u.r1.rate, txd.u.r1.queue_ctrl, txd.queue_info); - + tmp = read_slavemem32(adev, (ulong) & (txdesc->AcxMemPtr)); seq_printf(file, " %04x: ", tmp); @@ -1702,9 +1702,9 @@ STATick irqreturn_t acxmem_interrupt(int irq, void *dev_id) /* OW 20091129 TODO Currently breaks mem.c ... * If sleeping is required like for update card settings, this is usefull * For now I replaced sleeping for command handling by mdelays. - * if (adev->after_interrupt_jobs){ - * acx_e_after_interrupt_task(adev); - * } + * if (adev->after_interrupt_jobs){ + * acx_e_after_interrupt_task(adev); + * } */ @@ -2628,7 +2628,7 @@ STATick struct platform_driver acxmem_driver = { }, .probe = acxmem_probe, .remove = __devexit_p(acxmem_remove), - + #ifdef CONFIG_PM .suspend = acxmem_e_suspend, .resume = acxmem_e_resume diff --git a/mem.h b/mem.h index 4dbe303..f61d7ff 100644 --- a/mem.h +++ b/mem.h @@ -77,7 +77,7 @@ static inline void acxmem_chaincopy_from_slavemem(acx_device_t *adev, //static inline int acxmem_write_fw(acx_device_t *adev, // const firmware_image_t *fw_image, u32 offset) //{ return 0; } - + static inline void acxmem_reset_mac(acx_device_t *adev) { } -- 1.7.9.2 |
From: Larry F. <Lar...@lw...> - 2012-05-13 02:07:24
|
A "make C=2" build shows a number of sparse warnings. Not all of them are easily fixed; however, those that are are fixed here. Several of the routines got a warning that they were "defined but not used", and were not used after being converted to static. Those can eventually be deleted, but for the moment, they are inside #if 0 .. #endif directives. The remaining warnings are: CHECK /home/finger/acx-mac80211/common.c /home/finger/acx-mac80211/common.c:4522:30: warning: incorrect type in argument 1 (different address spaces) /home/finger/acx-mac80211/common.c:4522:30: expected char const *<noident> /home/finger/acx-mac80211/common.c:4522:30: got char const [noderef] <asn:1>*buf /home/finger/acx-mac80211/common.c:4523:22: error: subtraction of different types can't work (different address spaces) /home/finger/acx-mac80211/common.c:4695:29: error: subtraction of different types can't work (different address spaces) /home/finger/acx-mac80211/common.c:4744:22: error: subtraction of different types can't work (different address spaces) /home/finger/acx-mac80211/common.c:4794:22: error: subtraction of different types can't work (different address spaces) /home/finger/acx-mac80211/common.c:4843:22: error: subtraction of different types can't work (different address spaces) /home/finger/acx-mac80211/common.c:4894:22: error: subtraction of different types can't work (different address spaces) CHECK /home/finger/acx-mac80211/mem.c /home/finger/acx-mac80211/mem.c:2524:26: warning: cast removes address space of expression /home/finger/acx-mac80211/mem.c:2524:26: warning: incorrect type in argument 1 (different address spaces) /home/finger/acx-mac80211/mem.c:2524:26: expected void volatile [noderef] <asn:2>*addr /home/finger/acx-mac80211/mem.c:2524:26: got void *<noident> /home/finger/acx-mac80211/mem.c:783:9: warning: context imbalance in 'acxmem_issue_cmd_timeo_debug' - different lock contexts for basic block /home/finger/acx-mac80211/mem.c:791:12: warning: context imbalance in 'acxmem_complete_hw_reset' - different lock contexts for basic block /home/finger/acx-mac80211/mem.c:1121:9: warning: context imbalance in 'acxmem_proc_diag_output' - different lock contexts for basic block /home/finger/acx-mac80211/mem.c:2433:9: warning: context imbalance in 'acxmem_probe' - different lock contexts for basic block /home/finger/acx-mac80211/mem.c:2615:9: warning: context imbalance in 'acxmem_remove' - different lock contexts for basic block CC [M] /home/finger/acx-mac80211/mem.o CHECK /home/finger/acx-mac80211/merge.c /home/finger/acx-mac80211/merge.c:469:35: warning: cast removes address space of expression /home/finger/acx-mac80211/merge.c:481:43: warning: cast removes address space of expression /home/finger/acx-mac80211/merge.c:568:20: warning: cast removes address space of expression /home/finger/acx-mac80211/merge.c:1561:32: warning: incorrect type in assignment (different address spaces) /home/finger/acx-mac80211/merge.c:1561:32: expected unsigned char [noderef] [usertype] <asn:2>*[usertype] cmd_area /home/finger/acx-mac80211/merge.c:1561:32: got unsigned char [usertype] *<noident> /home/finger/acx-mac80211/merge.c:1562:33: warning: incorrect type in assignment (different address spaces) /home/finger/acx-mac80211/merge.c:1562:33: expected unsigned char [noderef] [usertype] <asn:2>*[usertype] info_area /home/finger/acx-mac80211/merge.c:1562:33: got unsigned char [usertype] *<noident> /home/finger/acx-mac80211/merge.c:1566:35: warning: cast removes address space of expression /home/finger/acx-mac80211/merge.c:1566:32: warning: incorrect type in assignment (different address spaces) /home/finger/acx-mac80211/merge.c:1566:32: expected unsigned char [noderef] [usertype] <asn:2>*[usertype] cmd_area /home/finger/acx-mac80211/merge.c:1566:32: got unsigned char [usertype] * /home/finger/acx-mac80211/merge.c:1567:36: warning: cast removes address space of expression /home/finger/acx-mac80211/merge.c:1567:33: warning: incorrect type in assignment (different address spaces) /home/finger/acx-mac80211/merge.c:1567:33: expected unsigned char [noderef] [usertype] <asn:2>*[usertype] info_area /home/finger/acx-mac80211/merge.c:1567:33: got unsigned char [usertype] * /home/finger/acx-mac80211/merge.c:160:17: warning: context imbalance in 'acx_upload_radio' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:696:9: warning: context imbalance in 'acx_create_desc_queues' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:887:9: warning: context imbalance in 'acx_proc_eeprom_output' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:1047:9: warning: context imbalance in '_acx_read_phy_reg' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:1092:9: warning: context imbalance in '_acx_write_phy_reg' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:1352:17: warning: context imbalance in '_acx_upload_fw' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:1899:9: warning: context imbalance in 'acx_up' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:2081:9: warning: context imbalance in 'acx_reset_dev' - unexpected unlock /home/finger/acx-mac80211/merge.c:2134:9: warning: context imbalance in 'acx_verify_init' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:2793:9: warning: context imbalance in 'acxmem_alloc_tx' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:2841:9: warning: context imbalance in 'acxmem_dealloc_tx' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:3271:9: warning: context imbalance in '_acx_tx_data' - different lock contexts for basic block /home/finger/acx-mac80211/merge.c:3769:9: warning: context imbalance in 'acx_irq_work' - different lock contexts for basic block /home/finger/acx-mac80211/interrupt-masks.h:33:26: warning: cast truncates bits from constant value (ffff10fc becomes 10fc) /home/finger/acx-mac80211/merge.c:4107:9: warning: context imbalance in 'acx_op_stop' - different lock contexts for basic block Signed-off-by: Larry Finger <Lar...@lw...> --- debugfs.c | 8 ++++---- inlines.h | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/debugfs.c b/debugfs.c index e76eee2..8ad57b4 100644 --- a/debugfs.c +++ b/debugfs.c @@ -59,7 +59,7 @@ static const char *const dbgfs_files[] = { static int acx_dbgfs_open(struct inode *inode, struct file *file) { - int fidx = (uintptr_t)inode->i_private; + int fidx = (int) inode->i_private; struct acx_device *adev = (struct acx_device *) file->f_path.dentry->d_parent->d_inode->i_private; @@ -84,10 +84,10 @@ static int acx_dbgfs_open(struct inode *inode, struct file *file) return single_open(file, acx_proc_show_funcs[fidx], adev); } -static ssize_t acx_dbgfs_write(struct file *file, const char __user *buf, +static int acx_dbgfs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { - int fidx = (uintptr_t) file->f_path.dentry->d_inode->i_private; + int fidx = (int) file->f_path.dentry->d_inode->i_private; struct acx_device *adev = (struct acx_device *) file->f_path.dentry->d_parent->d_inode->i_private; @@ -123,7 +123,7 @@ static struct dentry *acx_dbgfs_dir; int acx_debugfs_add_adev(struct acx_device *adev) { - long i; + int i; fmode_t fmode; struct dentry *file; const char *devname = wiphy_name(adev->ieee->wiphy); diff --git a/inlines.h b/inlines.h index f70dd9d..7093aa1 100644 --- a/inlines.h +++ b/inlines.h @@ -132,7 +132,7 @@ INLINE_IO u32 read_id_register(acx_device_t *adev) /* note the buried return */ #define ret_addr_lt20_rd_(adev, addr, _lwb) \ if (addr < 0x20) \ - return acx_read##_lwb(((u8 *) adev->iobase) + addr); + return acx_read##_lwb(adev->iobase + addr); #define ret_addr_lt20_rdl(adev, addr) ret_addr_lt20_rd_(adev, addr, l) #define ret_addr_lt20_rdw(adev, addr) ret_addr_lt20_rd_(adev, addr, w) @@ -141,7 +141,7 @@ INLINE_IO u32 read_id_register(acx_device_t *adev) /* note the buried return */ #define ret_addr_lt20_wr_(adev, addr, _lwb, val) \ if (addr < 0x20) { \ - acx_write##_lwb(val, ((u8 *) adev->iobase) + addr); \ + acx_write##_lwb(val, adev->iobase + addr); \ return; \ } @@ -159,10 +159,10 @@ INLINE_IO u32 read_reg32(acx_device_t *adev, unsigned int offset) if (IS_PCI(adev)) { #if ACX_IO_WIDTH == 32 - return acx_readl((u8 *) adev->iobase + adev->io[offset]); + return acx_readl(adev->iobase + adev->io[offset]); #else - return acx_readw((u8 *) adev->iobase + adev->io[offset]) - + (acx_readw((u8 *) adev->iobase + + return acx_readw(adev->iobase + adev->io[offset]) + + (acx_readw(adev->iobase + adev->io[offset] + 2) << 16); #endif } @@ -184,7 +184,7 @@ INLINE_IO u16 read_reg16(acx_device_t *adev, unsigned int offset) u32 addr; if (IS_PCI(adev)) - return acx_readw((u8 *) adev->iobase + adev->io[offset]); + return acx_readw(adev->iobase + adev->io[offset]); /* else IS_MEM */ @@ -193,7 +193,7 @@ INLINE_IO u16 read_reg16(acx_device_t *adev, unsigned int offset) ret_addr_lt20_rdw(adev, addr); acx_writel(addr, adev->iobase + ACX_SLV_REG_ADDR); - lo = acx_readw((u16 *) (adev->iobase + ACX_SLV_REG_DATA)); + lo = acx_readw(adev->iobase + ACX_SLV_REG_DATA); return lo; } @@ -204,7 +204,7 @@ INLINE_IO u8 read_reg8(acx_device_t *adev, unsigned int offset) u32 addr; if (IS_PCI(adev)) - return readb((u8 *) adev->iobase + adev->io[offset]); + return readb(adev->iobase + adev->io[offset]); /* else IS_MEM */ @@ -213,7 +213,7 @@ INLINE_IO u8 read_reg8(acx_device_t *adev, unsigned int offset) ret_addr_lt20_rdb(adev, addr); acx_writel(addr, adev->iobase + ACX_SLV_REG_ADDR); - lo = acx_readw((u8 *) (adev->iobase + ACX_SLV_REG_DATA)); + lo = acx_readw(adev->iobase + ACX_SLV_REG_DATA); return (u8) lo; } @@ -225,7 +225,7 @@ INLINE_IO void write_reg32(acx_device_t *adev, unsigned int offset, if (IS_PCI(adev)) { #if ACX_IO_WIDTH == 32 - acx_writel(val, (u8 *) adev->iobase + adev->io[offset]); + acx_writel(val, adev->iobase + adev->io[offset]); #else acx_writew(val & 0xffff, (u8 *) adev->iobase + adev->io[offset]); @@ -249,7 +249,7 @@ INLINE_IO void write_reg16(acx_device_t *adev, unsigned int offset, u32 addr; if (IS_PCI(adev)) { - acx_writew(val, (u8 *) adev->iobase + adev->io[offset]); + acx_writew(val, adev->iobase + adev->io[offset]); return; } /* else IS_MEM */ @@ -259,7 +259,7 @@ INLINE_IO void write_reg16(acx_device_t *adev, unsigned int offset, ret_addr_lt20_wrw(adev, addr, val); acx_writel(addr, adev->iobase + ACX_SLV_REG_ADDR); - acx_writew(val, (u16 *) (adev->iobase + ACX_SLV_REG_DATA)); + acx_writew(val, adev->iobase + ACX_SLV_REG_DATA); } INLINE_IO void write_reg8(acx_device_t *adev, unsigned int offset, u8 val) @@ -267,7 +267,7 @@ INLINE_IO void write_reg8(acx_device_t *adev, unsigned int offset, u8 val) u32 addr; if (IS_PCI(adev)) { - writeb(val, (u8 *) adev->iobase + adev->io[offset]); + writeb(val, adev->iobase + adev->io[offset]); return; } /* else IS_MEM */ @@ -277,7 +277,7 @@ INLINE_IO void write_reg8(acx_device_t *adev, unsigned int offset, u8 val) ret_addr_lt20_wrb(adev, addr, val); acx_writel(addr, adev->iobase + ACX_SLV_REG_ADDR); - writeb(val, (u8 *) (adev->iobase + ACX_SLV_REG_DATA)); + writeb(val, adev->iobase + ACX_SLV_REG_DATA); } -- 1.7.9.2 |