Re: [PATCH v2] Staging: android: Mark local functions in binder.c as static
On Mon, Sep 02, 2013 at 08:18:40AM +0200, Bojan Prtvar wrote: > This fixes the following sparse warnings > drivers/staging/android/binder.c:1703:5: warning: symbol > 'binder_thread_write' was not declared. Should it be static? > drivers/staging/android/binder.c:2058:6: warning: symbol 'binder_stat_br' was > not declared. Should it be static? > > Signed-off-by: Bojan Prtvar > --- > v2: Fixed indentig as suggested by Dan Carpenter. Thanks. :) regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] drivers: staging: android: Kconfig: add depends on MMU for ANDROID_BINDER_IPC
ANDROID_BINDER_IPC used the functions which need depend on MMU, so need let it depend on MMU too, or compiling fails. The related error: drivers/built-in.o: In function `binder_update_page_range': drivers/staging/android/binder.c:599: undefined reference to `map_vm_area' drivers/staging/android/binder.c:626: undefined reference to `zap_page_range' drivers/built-in.o: In function `binder_mmap': drivers/staging/android/binder.c:2744: undefined reference to `get_vm_area' Signed-off-by: Chen Gang --- drivers/staging/android/Kconfig |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig index c0c95be..85fc94b 100644 --- a/drivers/staging/android/Kconfig +++ b/drivers/staging/android/Kconfig @@ -10,6 +10,7 @@ if ANDROID config ANDROID_BINDER_IPC bool "Android Binder IPC Driver" + depends on MMU default n ---help--- Binder is used in Android for both communication between processes, -- 1.7.7.6 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: Fix dependencies for drivers misclassified as PCI
On 2013-09-01 20:42, Ben Hutchings wrote: The Fastwel UNIOxx-5 is a PCI/104 board so put COMEDI_UNIOXX5 under COMEDI_ISA_DRIVERS. ITYM a PC/104 board. The PCI-20001C is, surprisingly, an ISA card, so also put COMEDI_II_PCI20KC under COMEDI_ISA_DRIVERS. COMEDI_II_PCI20KC has already been moved in Greg's staging-next, so the patch won't apply cleanly there. The DIL/Net-PC 1486 is a 486 system, so put COMEDI_SSV_DNP under COMEDI_MISC_DRIVERS and add a dependency on X86_32 || COMPILE_TEST. Yes, COMEDI_MISC_DRIVERS will do. Signed-off-by: Ben Hutchings -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] mmc: rtsx: change phase searching method
From: Micky Ching The new phase searching method is more concise, and makes the code easier to understand. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 107 +++-- 1 file changed, 30 insertions(+), 77 deletions(-) diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c index f981f7d..299a27c 100644 --- a/drivers/mmc/host/rtsx_pci_sdmmc.c +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c @@ -32,15 +32,6 @@ #include #include -/* SD Tuning Data Structure - * Record continuous timing phase path - */ -struct timing_phase_path { - int start; - int end; - int mid; - int len; -}; struct realtek_pci_sdmmc { struct platform_device *pdev; @@ -497,85 +488,47 @@ static int sd_change_phase(struct realtek_pci_sdmmc *host, u8 sample_point) return 0; } -static u8 sd_search_final_phase(struct realtek_pci_sdmmc *host, u32 phase_map) +static inline u32 get_phase_point(u32 phase_map, unsigned int idx) { - struct timing_phase_path path[MAX_PHASE + 1]; - int i, j, cont_path_cnt; - int new_block, max_len, final_path_idx; - u8 final_phase = 0xFF; + idx &= MAX_PHASE; + return phase_map & (1 << idx); +} + +static int get_phase_len(u32 phase_map, unsigned int idx) +{ + int i; - /* Parse phase_map, take it as a bit-ring */ - cont_path_cnt = 0; - new_block = 1; - j = 0; for (i = 0; i < MAX_PHASE + 1; i++) { - if (phase_map & (1 << i)) { - if (new_block) { - new_block = 0; - j = cont_path_cnt++; - path[j].start = i; - path[j].end = i; - } else { - path[j].end = i; - } - } else { - new_block = 1; - if (cont_path_cnt) { - /* Calculate path length and middle point */ - int idx = cont_path_cnt - 1; - path[idx].len = - path[idx].end - path[idx].start + 1; - path[idx].mid = - path[idx].start + path[idx].len / 2; - } - } + if (get_phase_point(phase_map, idx + i) == 0) + return i; } + return MAX_PHASE + 1; +} - if (cont_path_cnt == 0) { - dev_dbg(sdmmc_dev(host), "No continuous phase path\n"); - goto finish; - } else { - /* Calculate last continuous path length and middle point */ - int idx = cont_path_cnt - 1; - path[idx].len = path[idx].end - path[idx].start + 1; - path[idx].mid = path[idx].start + path[idx].len / 2; - } +static u8 sd_search_final_phase(struct realtek_pci_sdmmc *host, u32 phase_map) +{ + int start = 0, len = 0; + int start_final = 0, len_final = 0; + u8 final_phase = 0xFF; - /* Connect the first and last continuous paths if they are adjacent */ - if (!path[0].start && (path[cont_path_cnt - 1].end == MAX_PHASE)) { - /* Using negative index */ - path[0].start = path[cont_path_cnt - 1].start - MAX_PHASE - 1; - path[0].len += path[cont_path_cnt - 1].len; - path[0].mid = path[0].start + path[0].len / 2; - /* Convert negative middle point index to positive one */ - if (path[0].mid < 0) - path[0].mid += MAX_PHASE + 1; - cont_path_cnt--; + if (phase_map == 0) { + dev_dbg(sdmmc_dev(host), "Phase: [map:%x]\n", phase_map); + return final_phase; } - /* Choose the longest continuous phase path */ - max_len = 0; - final_phase = 0; - final_path_idx = 0; - for (i = 0; i < cont_path_cnt; i++) { - if (path[i].len > max_len) { - max_len = path[i].len; - final_phase = (u8)path[i].mid; - final_path_idx = i; + while (start < MAX_PHASE + 1) { + len = get_phase_len(phase_map, start); + if (len_final < len) { + start_final = start; + len_final = len; } - - dev_dbg(sdmmc_dev(host), "path[%d].start = %d\n", - i, path[i].start); - dev_dbg(sdmmc_dev(host), "path[%d].end = %d\n", - i, path[i].end); - dev_dbg(sdmmc_dev(host), "path[%d].len = %d\n", - i, path[i].len); - dev_dbg(sdmmc_dev(host), "path[%d].mid = %d\n", - i, path
[PATCH] staging: silicom: introduce bp_dev_get_idx_bsf() and use it
There are two places where duplicate code is located. Moreover, there is a custom implementation of the sscanf() functionality. This patch makes code quite simplier and cleaner. Signed-off-by: Andy Shevchenko --- drivers/staging/silicom/bpctl_mod.c | 188 +--- 1 file changed, 47 insertions(+), 141 deletions(-) diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c index 495272d..a5cacd9 100644 --- a/drivers/staging/silicom/bpctl_mod.c +++ b/drivers/staging/silicom/bpctl_mod.c @@ -1,11 +1,11 @@ /**/ /* */ -/* Bypass Control utility, Copyright (c) 2005-20011 Silicom */ +/* Bypass Control utility, Copyright (c) 2005-2011 Silicom */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation, located in the file LICENSE. */ -/* Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved. */ +/* Copyright(c) 2007 - 2009, 2013 Intel Corporation. All rights reserved. */ /* */ /* */ /**/ @@ -124,80 +124,60 @@ int bp_proc_create(void); int is_bypass_fn(struct bpctl_dev *pbpctl_dev); int get_dev_idx_bsf(int bus, int slot, int func); -static unsigned long str_to_hex(char *p); +static int bp_get_dev_idx_bsf(struct net_device *dev, int *index) +{ + struct ethtool_drvinfo drvinfo = {0}; + char *buf; + int bus, slot, func; + + if (dev->ethtool_ops && dev->ethtool_ops->get_drvinfo) + dev->ethtool_ops->get_drvinfo(dev, &drvinfo); + else + return -EOPNOTSUPP; + + if (!drvinfo.bus_info) + return -ENODATA; + if (!strcmp(drvinfo.bus_info, "N/A")) + return -ENODATA; + + buf = strchr(drvinfo.bus_info, ':'); + if (!buf) + return -EINVAL; + buf++; + if (sscanf(buf, "%x:%x.%x", &bus, &slot, &func) != 3) + return -EINVAL; + + *index = get_dev_idx_bsf(bus, slot, func); + return 0; +} + static int bp_device_event(struct notifier_block *unused, unsigned long event, void *ptr) { struct net_device *dev = netdev_notifier_info_to_dev(ptr); static struct bpctl_dev *pbpctl_dev, *pbpctl_dev_m; int dev_num = 0, ret = 0, ret_d = 0, time_left = 0; + /* printk("BP_PROC_SUPPORT event =%d %s %d\n", event,dev->name, dev->ifindex ); */ /* return NOTIFY_DONE; */ if (!dev) return NOTIFY_DONE; - if (event == NETDEV_REGISTER) { - { - struct ethtool_drvinfo drvinfo; - char cbuf[32]; - char *buf = NULL; - char res[10]; - int i = 0, ifindex, idx_dev = 0; - int bus = 0, slot = 0, func = 0; - ifindex = dev->ifindex; - - memset(res, 0, 10); - memset(&drvinfo, 0, sizeof(struct ethtool_drvinfo)); - - if (dev->ethtool_ops && dev->ethtool_ops->get_drvinfo) { - memset(&drvinfo, 0, sizeof(drvinfo)); - dev->ethtool_ops->get_drvinfo(dev, &drvinfo); - } else - return NOTIFY_DONE; - if (!drvinfo.bus_info) - return NOTIFY_DONE; - if (!strcmp(drvinfo.bus_info, "N/A")) - return NOTIFY_DONE; - memcpy(&cbuf, drvinfo.bus_info, 32); - buf = &cbuf[0]; - while (*buf++ != ':') - ; - for (i = 0; i < 10; i++, buf++) { - if (*buf == ':') - break; - res[i] = *buf; - - } - buf++; - bus = str_to_hex(res); - memset(res, 0, 10); - - for (i = 0; i < 10; i++, buf++) { - if (*buf == '.') - break; - res[i] = *buf; - - } - buf++; - slot = str_to_hex(res); -
[PATCH] staging: silicom: introduce bp_dev_get_idx_bsf() and use it
There are two places where duplicate code is located. Moreover, there is a custom implementation of the sscanf() functionality. This patch makes code quite simplier and cleaner. Signed-off-by: Andy Shevchenko --- drivers/staging/silicom/bpctl_mod.c | 188 +--- 1 file changed, 47 insertions(+), 141 deletions(-) diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c index 495272d..39dc92a 100644 --- a/drivers/staging/silicom/bpctl_mod.c +++ b/drivers/staging/silicom/bpctl_mod.c @@ -1,11 +1,11 @@ /**/ /* */ -/* Bypass Control utility, Copyright (c) 2005-20011 Silicom */ +/* Bypass Control utility, Copyright (c) 2005-2011 Silicom */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation, located in the file LICENSE. */ -/* Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved. */ +/* Copyright(c) 2007 - 2009, 2013 Intel Corporation. All rights reserved. */ /* */ /* */ /**/ @@ -124,80 +124,60 @@ int bp_proc_create(void); int is_bypass_fn(struct bpctl_dev *pbpctl_dev); int get_dev_idx_bsf(int bus, int slot, int func); -static unsigned long str_to_hex(char *p); +static int bp_get_dev_idx_bsf(struct net_device *dev, int *index) +{ + struct ethtool_drvinfo drvinfo = {0}; + char *buf; + int bus, slot, func; + + if (dev->ethtool_ops && dev->ethtool_ops->get_drvinfo) + dev->ethtool_ops->get_drvinfo(dev, &drvinfo); + else + return -EOPNOTSUPP; + + if (!drvinfo.bus_info) + return -ENODATA; + if (!strcmp(drvinfo.bus_info, "N/A")) + return -ENODATA; + + buf = strchr(drvinfo.bus_info, ':'); + if (!buf) + return -EINVAL; + buf++; + if (sscanf(buf, "%x:%x.%x", &bus, &slot, &func) != 3) + return -EINVAL; + + *index = get_dev_idx_bsf(bus, slot, func); + return 0; +} + static int bp_device_event(struct notifier_block *unused, unsigned long event, void *ptr) { struct net_device *dev = netdev_notifier_info_to_dev(ptr); static struct bpctl_dev *pbpctl_dev, *pbpctl_dev_m; int dev_num = 0, ret = 0, ret_d = 0, time_left = 0; + /* printk("BP_PROC_SUPPORT event =%d %s %d\n", event,dev->name, dev->ifindex ); */ /* return NOTIFY_DONE; */ if (!dev) return NOTIFY_DONE; - if (event == NETDEV_REGISTER) { - { - struct ethtool_drvinfo drvinfo; - char cbuf[32]; - char *buf = NULL; - char res[10]; - int i = 0, ifindex, idx_dev = 0; - int bus = 0, slot = 0, func = 0; - ifindex = dev->ifindex; - - memset(res, 0, 10); - memset(&drvinfo, 0, sizeof(struct ethtool_drvinfo)); - - if (dev->ethtool_ops && dev->ethtool_ops->get_drvinfo) { - memset(&drvinfo, 0, sizeof(drvinfo)); - dev->ethtool_ops->get_drvinfo(dev, &drvinfo); - } else - return NOTIFY_DONE; - if (!drvinfo.bus_info) - return NOTIFY_DONE; - if (!strcmp(drvinfo.bus_info, "N/A")) - return NOTIFY_DONE; - memcpy(&cbuf, drvinfo.bus_info, 32); - buf = &cbuf[0]; - while (*buf++ != ':') - ; - for (i = 0; i < 10; i++, buf++) { - if (*buf == ':') - break; - res[i] = *buf; - - } - buf++; - bus = str_to_hex(res); - memset(res, 0, 10); - - for (i = 0; i < 10; i++, buf++) { - if (*buf == '.') - break; - res[i] = *buf; - - } - buf++; - slot = str_to_hex(res); -
Re: [PATCH v3 00/21] staging: comedi: tidy up digital output (*insn_bits)
On 2013-08-30 18:46, H Hartley Sweeten wrote: Consolidate the boilerplate code used to mask and set the output channels of DIO and DO subdevices. v3: fix [PATCH 01/21] to prevent overflow when calculating s->io_bits fix [PATCH 02/21] so only the valid channels in the subdevice are modified drop the patch that only updated to output channels with comedi_dio_update_state() split the patch that modified the drivers that filtered the 'mask' by s->io_bits drop the change to the pcmuio driver v2: address issues pointed out by Ian Abbott reorder series a bit pick up a couple drivers that were missed in v1 The comedi_parport driver still needs converted. This driver will be converted and cleaned up in a separate series. H Hartley Sweeten (21): staging: comedi: initialize subdevice s->io_bits in postconfig staging: comedi: drivers: introduce comedi_dio_update_state() staging: comedi: skel: use comedi_dio_update_state() staging: comedi: usbdux drivers: use comedi_dio_update_state() staging: comedi: drivers: use comedi_dio_update_state() for simple cases staging: comedi: drivers: use comedi_dio_update_state() for complex cases staging: comedi: ni_mio_common: use comedi_dio_update_state() staging: comedi: vmk80xx: use comedi_dio_update_state() staging: comedi: das08: remove do_bits from private data staging: comedi: das08: use s->state in das08_do_wbits() staging: comedi: das1800: remove do_bits from private data staging: comedi: das16m1: remove do_bits from private data staging: comedi: adq12b: remove digital_state from private data staging: comedi: ssv_dnp: use comedi_dio_update_state() staging: comedi: hwdrv_apci3120: use comedi_dio_update_state() staging: comedi: addi_apci_16xx: use comedi_dio_update_state() staging: comedi: addi_apci_3xxx: use comedi_dio_update_state() staging: comedi: ii_pci20kc: use comedi_dio_update_state() staging: comedi: me4000: use comedi_dio_update_state() staging: comedi: me_daq: use comedi_dio_update_state() staging: comedi: s626: use comedi_dio_update_state() drivers/staging/comedi/comedidev.h | 2 + drivers/staging/comedi/drivers.c | 29 + drivers/staging/comedi/drivers/8255.c | 25 +++- .../staging/comedi/drivers/addi-data/addi_common.c | 2 - .../comedi/drivers/addi-data/hwdrv_apci1564.c | 7 +-- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 17 ++ .../comedi/drivers/addi-data/hwdrv_apci3200.c | 7 +-- drivers/staging/comedi/drivers/addi_apci_1516.c| 8 +-- drivers/staging/comedi/drivers/addi_apci_16xx.c| 11 +--- drivers/staging/comedi/drivers/addi_apci_2032.c| 8 +-- drivers/staging/comedi/drivers/addi_apci_2200.c| 8 +-- drivers/staging/comedi/drivers/addi_apci_3120.c| 2 - drivers/staging/comedi/drivers/addi_apci_3501.c| 8 +-- drivers/staging/comedi/drivers/addi_apci_3xxx.c| 17 +- drivers/staging/comedi/drivers/adl_pci6208.c | 10 +--- drivers/staging/comedi/drivers/adl_pci7x3x.c | 13 +--- drivers/staging/comedi/drivers/adl_pci9111.c | 9 +-- drivers/staging/comedi/drivers/adl_pci9118.c | 11 ++-- drivers/staging/comedi/drivers/adq12b.c| 32 +- drivers/staging/comedi/drivers/adv_pci1710.c | 16 ++--- drivers/staging/comedi/drivers/adv_pci1723.c | 13 ++-- drivers/staging/comedi/drivers/adv_pci_dio.c | 33 -- drivers/staging/comedi/drivers/aio_iiro_16.c | 4 +- .../staging/comedi/drivers/amplc_dio200_common.c | 33 +- drivers/staging/comedi/drivers/amplc_pc263.c | 17 +++--- drivers/staging/comedi/drivers/amplc_pci263.c | 17 +++--- drivers/staging/comedi/drivers/cb_das16_cs.c | 9 +-- drivers/staging/comedi/drivers/cb_pcidas64.c | 25 drivers/staging/comedi/drivers/contec_pci_dio.c| 12 +--- drivers/staging/comedi/drivers/das08.c | 46 ++ drivers/staging/comedi/drivers/das08.h | 1 - drivers/staging/comedi/drivers/das16.c | 9 +-- drivers/staging/comedi/drivers/das16m1.c | 22 ++- drivers/staging/comedi/drivers/das1800.c | 22 ++- drivers/staging/comedi/drivers/das800.c| 6 +- drivers/staging/comedi/drivers/dmm32at.c | 70 +- drivers/staging/comedi/drivers/dt2801.c| 18 +++--- drivers/staging/comedi/drivers/dt2811.c| 8 +-- drivers/staging/comedi/drivers/dt2817.c| 51 +++- drivers/staging/comedi/drivers/dt282x.c| 10 ++-- drivers/staging/comedi/drivers/dt3000.c| 9 ++- drivers/staging/comedi/drivers/dt9812.c| 9 +-- drivers/staging/comedi/drivers/dyna_pci10xx.c | 20 ++- drivers/staging/comedi/drivers/icp_multi.c | 14 + drivers/staging/comedi/drivers/ii_
[PATCH] Staging: android: Remove extern from function prototypes in .h files
checkpatch.pl complains that extern prototypes should be avoided in .h files Signed-off-by: Bojan Prtvar --- drivers/staging/android/timed_output.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/timed_output.h b/drivers/staging/android/timed_output.h index ec907ab..905c7cc 100644 --- a/drivers/staging/android/timed_output.h +++ b/drivers/staging/android/timed_output.h @@ -31,7 +31,7 @@ struct timed_output_dev { int state; }; -extern int timed_output_dev_register(struct timed_output_dev *dev); -extern void timed_output_dev_unregister(struct timed_output_dev *dev); +int timed_output_dev_register(struct timed_output_dev *dev); +void timed_output_dev_unregister(struct timed_output_dev *dev); #endif -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Hello
Hello, Is this an active email address? If yes,please send a reply..Checking for confirmation. Thanks! ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Hello
Hello, Is this an active email address? If yes,please send a reply..Checking for confirmation. Thanks! ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: et131x: Remove unused rcv_pend_lock spinlock
The rcv_pend_lock spinlock isn't used anymore. remove it. Signed-off-by: Mark Einon --- drivers/staging/et131x/et131x.c |2 -- 1 file changed, 2 deletions(-) create mode 100644 drivers/staging/et131x/Module.symvers diff --git a/drivers/staging/et131x/Module.symvers b/drivers/staging/et131x/Module.symvers new file mode 100644 index 000..e69de29 diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 4c1eade..a8f7cd7 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -493,7 +493,6 @@ struct et131x_adapter { spinlock_t send_hw_lock; spinlock_t rcv_lock; - spinlock_t rcv_pend_lock; spinlock_t fbr_lock; /* Packet Filter and look ahead size */ @@ -3924,7 +3923,6 @@ static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev, spin_lock_init(&adapter->tcb_ready_qlock); spin_lock_init(&adapter->send_hw_lock); spin_lock_init(&adapter->rcv_lock); - spin_lock_init(&adapter->rcv_pend_lock); spin_lock_init(&adapter->fbr_lock); adapter->registry_jumbo_packet = 1514; /* 1514-9216 */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: et131x: Removing some unecessary braces
Remove braces from a few single line if statements. Signed-off-by: Mark Einon --- drivers/staging/et131x/et131x.c | 39 +++ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 55a6d59..786cb98 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -834,11 +834,10 @@ static void et131x_rx_dma_enable(struct et131x_adapter *adapter) if (csr & ET_RXDMA_CSR_HALT_STATUS) { udelay(5); csr = readl(&adapter->regs->rxdma.csr); - if (csr & ET_RXDMA_CSR_HALT_STATUS) { + if (csr & ET_RXDMA_CSR_HALT_STATUS) dev_err(&adapter->pdev->dev, "RX Dma failed to exit halt state. CSR 0x%08x\n", csr); - } } } @@ -1013,11 +1012,10 @@ static void et1310_config_mac_regs2(struct et131x_adapter *adapter) cfg1 = readl(&mac->cfg1); } while ((cfg1 & ET_MAC_CFG1_WAIT) != ET_MAC_CFG1_WAIT && delay < 100); - if (delay == 100) { + if (delay == 100) dev_warn(&adapter->pdev->dev, "Syncd bits did not respond correctly cfg1 word 0x%08x\n", cfg1); - } /* Enable txmac */ ctl |= ET_TX_CTRL_TXMAC_ENABLE | ET_TX_CTRL_FC_DISABLE; @@ -2747,10 +2745,9 @@ static void et131x_handle_recv_interrupt(struct et131x_adapter *adapter) adapter->net_stats.rx_packets++; /* Set the status on the packet, either resources or success */ - if (adapter->rx_ring.num_ready_recv < RFD_LOW_WATER_MARK) { - dev_warn(&adapter->pdev->dev, - "RFD's are running out\n"); - } + if (adapter->rx_ring.num_ready_recv < RFD_LOW_WATER_MARK) + dev_warn(&adapter->pdev->dev, "RFD's are running out\n"); + count++; } @@ -3017,10 +3014,10 @@ static int nic_send_packet(struct et131x_adapter *adapter, struct tcb *tcb) /* For Gig only, we use Tx Interrupt coalescing. Enable the software * timer to wake us up if this packet isn't followed by N more. */ - if (phydev && phydev->speed == SPEED_1000) { + if (phydev && phydev->speed == SPEED_1000) writel(PARM_TX_TIME_INT_DEF * NANO_IN_A_MICRO, &adapter->regs->global.watchdog_timer); - } + spin_unlock_irqrestore(&adapter->send_hw_lock, flags); return 0; @@ -3068,11 +3065,10 @@ static int send_packet(struct sk_buff *skb, struct et131x_adapter *adapter) shbufva = (u16 *) skb->data; if ((shbufva[0] == 0x) && - (shbufva[1] == 0x) && (shbufva[2] == 0x)) { + (shbufva[1] == 0x) && (shbufva[2] == 0x)) tcb->flags |= FMP_DEST_BROAD; - } else if ((shbufva[0] & 0x3) == 0x0001) { + else if ((shbufva[0] & 0x3) == 0x0001) tcb->flags |= FMP_DEST_MULTI; - } } tcb->next = NULL; @@ -3664,7 +3660,7 @@ static void et131x_error_timer_handler(unsigned long data) adapter->boot_coma++; if (adapter->boot_coma == 10) { - if (!phydev->link) { + if (!phydev->link) if (!et1310_in_phy_coma(adapter)) { /* NOTE - This was originally a 'sync with * interrupt'. How to do that under Linux? @@ -3672,7 +3668,6 @@ static void et131x_error_timer_handler(unsigned long data) et131x_enable_interrupts(adapter); et1310_enable_phy_coma(adapter); } - } } /* This is a periodic timer, so reschedule */ @@ -4156,7 +4151,7 @@ static void et131x_isr_handler(struct work_struct *work) } /* Handle RXDMA Error Interrupt */ - if (status & ET_INTR_RXDMA_ERR) { + if (status & ET_INTR_RXDMA_ERR) /* The rxdma_error interrupt is sent when a time-out on a * request issued by the JAGCore has occurred or a completion is * returned with an un-successful status. In both cases the @@ -4172,21 +4167,18 @@ static void et131x_isr_handler(struct work_struct *work) * something bad has occurred. A reset might be the thing to do. */ /* TRAP();*/ - dev_warn(&adapter->pdev->dev, "RxDMA_ERR interrupt, error %x\n", readl(&iomem->txmac.tx_test)); - } /* Handle the Wake on LAN Event */ - if (status & ET_INTR_WOL) { + if (statu
[PATCH 3/4] staging: et131x: Whitespace changes, cat some spilt lines
Ignoring checkpatch for some lines - now just over 80 chars, but much more readable. Signed-off-by: Mark Einon --- drivers/staging/et131x/et131x.c | 120 +-- 1 file changed, 40 insertions(+), 80 deletions(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index a8f7cd7..55a6d59 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -872,8 +872,8 @@ static void et131x_tx_dma_enable(struct et131x_adapter *adapter) /* Setup the transmit dma configuration register for normal * operation */ - writel(ET_TXDMA_SNGL_EPKT|(PARM_DMA_CACHE_DEF << ET_TXDMA_CACHE_SHIFT), - &adapter->regs->txdma.csr); + writel(ET_TXDMA_SNGL_EPKT | (PARM_DMA_CACHE_DEF << ET_TXDMA_CACHE_SHIFT), + &adapter->regs->txdma.csr); } static inline void add_10bit(u32 *v, int n) @@ -978,12 +978,10 @@ static void et1310_config_mac_regs2(struct et131x_adapter *adapter) } /* We need to enable Rx/Tx */ - cfg1 |= ET_MAC_CFG1_RX_ENABLE | ET_MAC_CFG1_TX_ENABLE | - ET_MAC_CFG1_TX_FLOW; + cfg1 |= ET_MAC_CFG1_RX_ENABLE | ET_MAC_CFG1_TX_ENABLE | ET_MAC_CFG1_TX_FLOW; /* Initialize loop back to off */ cfg1 &= ~(ET_MAC_CFG1_LOOPBACK | ET_MAC_CFG1_RX_FLOW); - if (adapter->flowcontrol == FLOW_RXONLY || - adapter->flowcontrol == FLOW_BOTH) + if (adapter->flowcontrol == FLOW_RXONLY || adapter->flowcontrol == FLOW_BOTH) cfg1 |= ET_MAC_CFG1_RX_FLOW; writel(cfg1, &mac->cfg1); @@ -1807,8 +1805,7 @@ static void et131x_config_rx_dma_regs(struct et131x_adapter *adapter) writel(0, &rx_dma->psr_full_offset); psr_num_des = readl(&rx_dma->psr_num_des) & ET_RXDMA_PSR_NUM_DES_MASK; - writel((psr_num_des * LO_MARK_PERCENT_FOR_PSR) / 100, - &rx_dma->psr_min_des); + writel((psr_num_des * LO_MARK_PERCENT_FOR_PSR) / 100, &rx_dma->psr_min_des); spin_lock_irqsave(&adapter->rcv_lock, flags); @@ -1837,10 +1834,8 @@ static void et131x_config_rx_dma_regs(struct et131x_adapter *adapter) } /* Now's the best time to initialize FBR contents */ - fbr_entry = - (struct fbr_desc *) rx_local->fbr[id]->ring_virtaddr; - for (entry = 0; -entry < rx_local->fbr[id]->num_entries; entry++) { + fbr_entry = (struct fbr_desc *) rx_local->fbr[id]->ring_virtaddr; + for (entry = 0; entry < rx_local->fbr[id]->num_entries; entry++) { fbr_entry->addr_hi = rx_local->fbr[id]->bus_high[entry]; fbr_entry->addr_lo = rx_local->fbr[id]->bus_low[entry]; fbr_entry->word2 = entry; @@ -1850,10 +1845,8 @@ static void et131x_config_rx_dma_regs(struct et131x_adapter *adapter) /* Set the address and parameters of Free buffer ring 1 and 0 * into the 1310's registers */ - writel(upper_32_bits(rx_local->fbr[id]->ring_physaddr), - base_hi); - writel(lower_32_bits(rx_local->fbr[id]->ring_physaddr), - base_lo); + writel(upper_32_bits(rx_local->fbr[id]->ring_physaddr), base_hi); + writel(lower_32_bits(rx_local->fbr[id]->ring_physaddr), base_lo); writel(rx_local->fbr[id]->num_entries - 1, num_des); writel(ET_DMA10_WRAP, full_offset); @@ -1862,8 +1855,7 @@ static void et131x_config_rx_dma_regs(struct et131x_adapter *adapter) */ rx_local->fbr[id]->local_full = ET_DMA10_WRAP; writel(((rx_local->fbr[id]->num_entries * - LO_MARK_PERCENT_FOR_RX) / 100) - 1, - min_des); + LO_MARK_PERCENT_FOR_RX) / 100) - 1, min_des); } /* Program the number of packets we will receive before generating an @@ -1894,19 +1886,15 @@ static void et131x_config_tx_dma_regs(struct et131x_adapter *adapter) struct txdma_regs __iomem *txdma = &adapter->regs->txdma; /* Load the hardware with the start of the transmit descriptor ring. */ - writel(upper_32_bits(adapter->tx_ring.tx_desc_ring_pa), - &txdma->pr_base_hi); - writel(lower_32_bits(adapter->tx_ring.tx_desc_ring_pa), - &txdma->pr_base_lo); + writel(upper_32_bits(adapter->tx_ring.tx_desc_ring_pa), &txdma->pr_base_hi); + writel(lower_32_bits(adapter->tx_ring.tx_desc_ring_pa), &txdma->pr_base_lo); /* Initialise the transmit DMA engine */ writel(NUM_DESC_PER_RING_TX - 1, &txdma->pr_num_des); /* Load the completion writeback physical address */ - writel(upper_32_bi
[PATCH 1/4] staging: et131x: Remove unused spinlock
phy_lock is no longer used in any useful code, it's all been moved into a phy_device. Remove the lock definition and init. Signed-off-by: Mark Einon --- drivers/staging/et131x/et131x.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index f73e58f..4c1eade 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -496,8 +496,6 @@ struct et131x_adapter { spinlock_t rcv_pend_lock; spinlock_t fbr_lock; - spinlock_t phy_lock; - /* Packet Filter and look ahead size */ u32 packet_filter; @@ -3928,7 +3926,6 @@ static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev, spin_lock_init(&adapter->rcv_lock); spin_lock_init(&adapter->rcv_pend_lock); spin_lock_init(&adapter->fbr_lock); - spin_lock_init(&adapter->phy_lock); adapter->registry_jumbo_packet = 1514; /* 1514-9216 */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/4] staging: et131x: Removing some unecessary braces
On Mon, Sep 02, 2013 at 10:23:22PM +0100, Mark Einon wrote: > Remove braces from a few single line if statements. > No. Leave them if they are around a multi-line indent. The original is more readable. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] staging/speakup/kobjects.c: Code improvement.
Well, there is no need to use strcmp since we can make a test of similar semantic by using the var_id field of param. I moved the test into the VAR_NUM:VAR_TIME case since VAR_STRING will never be "voice". spk_xlate isn't used anymore (in line 628), then there is no difference between using cp and buf in VAR_STRING case. Besides, buf is a const char and those changes remove one uneeded line. I created the function spk_reset_default_value because it clarifies the code and allows code reusing. Signed-off-by: Raphael S.Carvalho --- drivers/staging/speakup/kobjects.c | 71 1 files changed, 39 insertions(+), 32 deletions(-) diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 51bdea3..5c6e77a 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -586,6 +586,25 @@ ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr, EXPORT_SYMBOL_GPL(spk_var_show); /* + * Used to reset either default_pitch or default_vol. + */ +static inline void spk_reset_default_value(char *header_name, + int *synth_default_value, int idx) +{ + struct st_var_header *param; + + if (synth && synth_default_value) { + param = spk_var_header_by_name(header_name); + if (param) { + spk_set_num_var(synth_default_value[idx], + param, E_NEW_DEFAULT); + spk_set_num_var(0, param, E_DEFAULT); + pr_info("%s reset to default value\n", param->name); + } + } +} + +/* * This function is called when a user echos a value to one of the * variable parameters. */ @@ -624,56 +643,44 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, if (ret == -ERANGE) { var_data = param->data; pr_warn("value for %s out of range, expect %d to %d\n", - attr->attr.name, + param->name, var_data->u.n.low, var_data->u.n.high); } + + /* + * If voice was just changed, we might need to reset our default + * pitch and volume. + */ + if (param->var_id == VOICE) { + spk_reset_default_value("pitch", synth->default_pitch, + value); + spk_reset_default_value("vol", synth->default_vol, + value); + } break; case VAR_STRING: - len = strlen(buf); - if ((len >= 1) && (buf[len - 1] == '\n')) + len = strlen(cp); + if ((len >= 1) && (cp[len - 1] == '\n')) --len; - if ((len >= 2) && (buf[0] == '"') && (buf[len - 1] == '"')) { - ++buf; + if ((len >= 2) && (cp[0] == '"') && (cp[len - 1] == '"')) { + ++cp; len -= 2; } - cp = (char *) buf; cp[len] = '\0'; - ret = spk_set_string_var(buf, param, len); + ret = spk_set_string_var(cp, param, len); if (ret == -E2BIG) pr_warn("value too long for %s\n", - attr->attr.name); + param->name); break; default: pr_warn("%s unknown type %d\n", param->name, (int)param->var_type); break; - } - /* -* If voice was just changed, we might need to reset our default -* pitch and volume. -*/ - if (strcmp(attr->attr.name, "voice") == 0) { - if (synth && synth->default_pitch) { - param = spk_var_header_by_name("pitch"); - if (param) { - spk_set_num_var(synth->default_pitch[value], - param, E_NEW_DEFAULT); - spk_set_num_var(0, param, E_DEFAULT); - } - } - if (synth && synth->default_vol) { - param = spk_var_header_by_name("vol"); - if (param) { - spk_set_num_var(synth->default_vol[value], - param, E_NEW_DEFAULT); - spk_set_num_var(0, param, E_DEFAULT); - } - } - } + } spin_unlock_irqrestore(&speakup_info.spinlock, flags); if (ret == -ERESTART) - pr_info("%s reset to default value\n", attr->attr.name); + pr_info("