Eli Billauer [Sat, 5 Jul 2014 09:45:07 +0000 (12:45 +0300)]
staging: xillybus: Add sanity check in interrupt handler
Data arriving from the hardware is verified prior to its use. The lack of
this check has never been reported to cause a problem, but it's necessary
nevertheless.
Signed-off-by: Eli Billauer <eli.billauer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Tue, 8 Jul 2014 10:54:23 +0000 (13:54 +0300)]
staging: rtl8188eu: use GFP_ATOMIC under spinlock
We're holding a spinlock here so we can't do sleeping allocations.
The call tree is:
rtw_sta_flush() <-- takes spin_lock_bh(&pstapriv->asoc_list_lock);
--> ap_free_sta()
--> rtw_clearstakey_cmd()
Originally these calls were rtw_zmalloc() and then we switched them to
kzalloc() in fadbe0cd5292 ('staging: rtl8188eu:Remove rtw_zmalloc(),
wrapper for kzalloc()') and that made the bugs show up for my static
checker. The original code was buggy as well but my static checker
couldn't parse it.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ft1000-usb: check for errors in card_send_command
kmalloc() result check was lacking. Fixing that required also
changing card_send_command() return type from void to int, and
checking its return code everywhere.
staging: goldfish: Introduce the use of managed interfaces
This patch introduces the use of managed interfaces like devm_kzalloc,
devm_ioremap, dmam_alloc_coherent, devm_request_irq and does away with
the calls to functions to free the allocated memory in the probe and
remove functions. Also, the labels are removed in the probe function.
staging: wlan-ng: Use net_device_stats from struct net_device
Instead of using an own copy of struct net_device_stats in struct
wlandevice, use stats from struct net_device. Also remove the thus
unnecessary .ndo_get_stats function, as it would now just return
netdev->stats, which is the default in dev_get_stats().
Furthermore, convert prefix increment of stats counters to the more
common postfix increment idiom.
staging: gdm72xx: Remove unnecessary memset of netdev private data
The memory for struct net_device private data is allocated using
kzalloc/vzalloc in alloc_netdev_mqs, thus there is no need to zero it
again in the driver.
staging: gdm72xx: Use net_device_stats from struct net_device
Instead of using an own copy of struct net_device_stats in struct nic,
use stats from struct net_device. Also remove the thus unnecessary
.ndo_get_stats function, as it would now just return netdev->stats,
which is the default in dev_get_stats().
Ben Chan [Tue, 1 Jul 2014 06:32:27 +0000 (23:32 -0700)]
staging: gdm72xx: clean up endianness conversions
This patch cleans up the endianness conversions in the gdm72xx driver:
- Directly use the generic byte-reordering macros for endianness
conversion instead of some custom-defined macros.
- Convert values on the constant side instead of the variable side when
appropriate.
- Add endianness annotations.
Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sachin Kamat [Mon, 30 Jun 2014 08:16:40 +0000 (13:46 +0530)]
staging: emxx_udc: Fix build error
‘strict_strtol’ is deprecated. Use kstrtol instead. Fixes the following
build error:
drivers/staging/emxx_udc/emxx_udc.c:3288:3: error: implicit declaration of function ‘strict_strtol’
The issue is discovered by static checker. The proposed change (0x000c0
-> 0x000c) is likely correct because:
1. 16-bit `map` holds value coming from struct
ieee80211_vht_mcs_info.tx_mcs_map, which is described so: "TX MCS map 2
bits for each stream, total 8 streams". The changed code refers to case
of 2 TX streams, and 0x000c mask filters two bits related to the second
stream. Some codelines below 0x0003 mask is used to test first stream.
2. Mask 0x000c is used 3 more times in that place.
3. Specifying 5 digits of hex value is uncommon, especially while working
with `u16` variable. So likely the trailing zero is a typo.
staging: rtl8821ae: Pass large struct by const reference
struct rtl_stats is rather huge (152 bytes), and since
rtl8812ae_rx_command_packet_handler() does not modify it, it might as
well be passed by const reference.
Aaro Koskinen [Sun, 29 Jun 2014 19:52:54 +0000 (22:52 +0300)]
staging: octeon-usb: don't retry on data toggle error
On data toggle error, we don't know if and how many bytes were
successfully transferred by DMA. We should just fail the transaction
instead of trying a retry.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Sun, 29 Jun 2014 19:52:53 +0000 (22:52 +0300)]
staging: octeon-usb: use usb_hcd_link_urb_to_ep()
The driver did not use link_urb_to_ep() / unlink_urb_from_ep(). This
caused odd behaviour in some error recovery situations, all requests
would start to fail after the first failure.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The handling of ip2= in drivers/char/ip2/ip2base.c was moved to
drivers/char/ip2/ip2main.c in commit 47babd4c6a16915aeb15d4216d91f03910572982 ("Char: merge ip2main and
ip2base").
staging: comedi: usbduxsigma: fixing rounding error in the range struct
The AD converter on the usbsigma turns vref (2.5V/2) into the
binary value 0x780000. However the full scale range goes up to
0x800000 so that vref/2 needs to be upscaled by 0x800000/0x780000
which is 1.06bar. In the driver it's been 1.06 without the infinite
6666. I've put the fraction in the code so that the compiler can
calculate the most precise scaling value by itself.
Ian Abbott [Wed, 2 Jul 2014 11:02:16 +0000 (12:02 +0100)]
staging: comedi: allow COMEDI_BUFINFO, COMEDI_CANCEL and COMEDI_POLL on locked subdevice
Comedi subdevices can be locked for mostly exclusive access by a
particular file object by means of the COMEDI_LOCK ioctl. Some
operations disregard the lock. For example, the read() and write() file
operations are allowed for the file object that set up an asynchronous
command on the subdevice (making it "busy") regardless of whether it is
locked.
The COMEDI_BUFINFO, COMEDI_CANCEL and COMEDI_POLL ioctls are also
associated with the file object that made the subdevice "busy" with a
command. They currently obey the exclusive access lock on the subdevice
as well, but it makes more sense for them to ignore it like the read()
and write() file operations. Remove the exclusive subdevice access
checks for these ioctls.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_apci_1564: clean up apci1564_interrupt()
Remove the checks for interrupts from unknown sources. This situation
should never occur and the checks were doing nothing to help the
situation.
Also, the portion of the function for handling counter interrupts is
reapeated four times (once for each counter), but is completely identical
save for the register is is accessing, so we can handle all four counters
with a for loop.
Finally, the interrupt handler is incorrectly setting and then checking
devpriv->timer_select_mode before processing some of the triggered
interrupts, so just remove all occurrences of this.
Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk.> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_apci_1564: fix use of apci1564_reset() to disable DI interrupts
apci1564_cos_insn_config() is currently using apci1564_reset() to disable
digital input interrupts when the configuration operation is
COMEDI_DIGITAL_TRIG_DISABLE. However, this is incorrect as the device reset
function also resets the registers for the digital outputs, timer, watchdog, and
counters as well. Replace the reset function call with a direct disabling of
just the digital input interrupts.
Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk.> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_apci_1564: move addi_watchdog.h include to addi_apci_1564.c
Commit aed3f9d (staging: comedi: addi_apci_1564: absorb apci1564_reset()) moved
the only use of addi_watchdog.h from hwdrv_apci1564.c to addi_apci_1564.c, but
left the include statement itself in the former file. Move this include to the
file which actually uses it.
Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk.> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes the `process_done` variable from both
format_eth_hdr_to_stack() and read_bulk_callback() (where it is
declared), as it is not used anywhere (it is set in the
format_eth_hdr_to_stack() function, but afterwards not used).
This commit fixes a few sparse warnings for missing the 'static' keyword
in array definitions:
drivers/staging//vt6655/rxtx.c:81:22: warning: symbol 'wTimeStampOff' was not declared. Should it be static?
drivers/staging//vt6655/rxtx.c:86:22: warning: symbol 'wFB_Opt0' was not declared. Should it be static?
drivers/staging//vt6655/rxtx.c:90:22: warning: symbol 'wFB_Opt1' was not declared. Should it be static?
Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
stagingL vt6656: implement fall back rates reporting.
The driver reports the rate tried in struct vnt_interrupt_data tsr* variables
which is available in INTnsProcessData via interrupt urb context.
Instead of closing apTD tx context in s_nsBulkOutIoCompleteWrite by setting
in_use to false. Keep the context open and allow vnt_int_report_rate to
close it.
If the tx_retry value is correct it will report back the sucessful RATE tried.
struct vnt_usb_send_context add pkt_no which is index of apTD