staging: dgnc: convert to wait_event_interruptible_timeout
This patch makes use of wait_event_interruptible_timeout to achieve
timeout functionality.This is a TODO mentiond in the comment which is also
removed.It also aligns with what the function is supposed to do as in the
comments.
Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aybuke Ozdemir [Wed, 10 Feb 2016 16:02:25 +0000 (18:02 +0200)]
Staging: comedi: Prefer using the BIT macro
Replace all instances of bit shifting on 1 with the BIT(x) macro. In
addition, convert other non-1 shift operations with the equivalent
BIT(x) macro for uniformity. Issue pointed out by checkpatch.
staging: comedi: Use ARRAY_SIZE for sizes of arrays
Use ARRAY_SIZE to calculate the size of an array to make code concise.
The semantic patch used can be found here:
https://github.com/coccinelle/coccinellery/commit/9cbab452a3a2e18439e8386d6c4a68ee42c3ee2b
Ian Abbott [Tue, 9 Feb 2016 15:17:24 +0000 (15:17 +0000)]
staging: comedi: comedi.h: remove SDF_MODE0 etc.
The macros `SDF_MODE0`, `SDF_MODE1`, `SDF_MODE2`, `SDF_MODE3`, and
`SDF_MODE4` are COMEDI subdevice flags originally associated with the
obsolete (and no longer present) COMEDI "trigger" functionality. They
have been of no use since COMEDI release 0.7.61 back in November 2001.
Since they were going spare, a couple of them have been aliased as
`SDF_PWM_COUNTER` and `SDF_PWM_HBRIDGE` to mean other things. Remove
the obsolete macros and redefine `SDF_PWM_COUNTER` and `SDF_PWM_HBRIDGE`
as equivalent numeric values.
Some code distributed with the userspace COMEDILIB library uses the
`SDF_MODE0` etc. flags to display the fact that they are set, but
COMEDILIB uses and installs its own, compatible version of "comedi.h"
anyway so isn't affected by their removal from the kernel copy.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove `struct comedi_trig` and some associated macros, `TRIG_DITHER`,
`TRIG_DEGLITCH`, `TRIG_CONFIG`, and ioctl code `COMEDI_TRIG`. These
have been obsolete since COMEDI release 0.7.61 back in November 2001.
The userspace COMEDILIB library still has some deprecated code that
may attempt to use these, but it uses its own, compatible version of
"comedi.h", so isn't affected by their removal from the kernel copy.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 9 Feb 2016 15:17:22 +0000 (15:17 +0000)]
staging: comedi: comedi.h: add kernel-doc comments to struct types
Add "kernel-doc"-formatted comments to the COMEDI `struct` declarations
used with ioctls. Don't bother documenting `struct comedi_trig` as it
is obsolete and not supported.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 9 Feb 2016 15:17:21 +0000 (15:17 +0000)]
staging: comedi: comedi.h: add kernel-doc to common enums
Add "kernel-doc"-formatted comments to COMEDI's general-purpose `enum`
type declarations. Don't bother documenting the low-level
driver-specific ones for now.
Move the declaration of `enum comedi_counter_status_flags` next to the
other general-purpose `enum` types.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 9 Feb 2016 15:17:20 +0000 (15:17 +0000)]
staging: comedi: comedi.h: tweak start of header comment
The wording at the start of the header comment is a bit misleading,
particularly the part in parentheses: "(installed as
/usr/include/comedi.h)". This version of "comedi.h" certainly won't be
installed as that pathname. Fix it.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor RGMII 10 Mbps preamble error checking. The current implementation
does not work correctly in phydev mode since only the link status changes
trigger the callback, and if we stay on 10 Mbps operation the periodic
checks for error counters are never done.
Provide a periodic worker also during the phydev operation, and notify
the link status changes through the phydev instead of the inband
status change interrupt. This also has the benefit that we don't need
to use legacy CVMX MDIO calls to check the PHY state, and we can avoid
races that trigger bogus "Using 10Mbps with software preamble removal"
logs when interfaces are being bringed up. It also avoids some corner-case
crashes when the in-band interrupt triggers while the interface is
being taken down.
Tested on EdgeRouter Lite & D-Link DSR-1000N.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sudip Mukherjee [Mon, 8 Feb 2016 17:56:46 +0000 (23:26 +0530)]
staging: most: return proper error
We were returning ENOMEM on all types of errors. Lets return the actual
error code. At the same time remove the label which became unused as a
result of this patch.
Boolean variables should be assigned true/false rather than 1/0.
This patch makes a correction on such a variable which has boolean
values assigned in all other places within the file.
Erik Arfvidson [Mon, 8 Feb 2016 15:41:51 +0000 (10:41 -0500)]
staging: unisys: fix comments in visornic_main.c
This patch fixes the following types of check patch warnings:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line
Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Erik Arfvidson [Mon, 8 Feb 2016 15:41:50 +0000 (10:41 -0500)]
staging: unisys: fix block comments in ultrainputreport.h
This patch fixes the following types of check patch warnings:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line
Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chaehyun Lim [Thu, 11 Feb 2016 04:46:25 +0000 (13:46 +0900)]
staging: wilc1000: rename counter in wilc_send_config_pkt
This patch renames the name of counter variable to i.
This change makes more readability because wilc_send_config_pkt has a
similar argument name as count.
Chaehyun Lim [Thu, 11 Feb 2016 04:46:24 +0000 (13:46 +0900)]
staging: wilc1000: remove initialization code of counter variable
There is no need to set to 0 for counter variable before entering next
for-loop statement because counter is initialized again in for-loop
statement, so just remove it.
Chaehyun Lim [Thu, 11 Feb 2016 04:46:23 +0000 (13:46 +0900)]
staging: wilc1000: use int type for counter variable
counter is used as for-loop control variable and indicating index of
struct wid array so that it is better to use int type.
There is no need to set to 0 when it is declared at the top of this
function. It is initialized as 0 in for-loop statement.
Chaehyun Lim [Thu, 11 Feb 2016 04:46:22 +0000 (13:46 +0900)]
staging: wilc1000: fix return type of wilc_send_config_pkt
wilc_send_config_pkt is returned 0 or -ETIMEDOUT according to return
value of wilc_wlan_cfg_set or wilc_wlan_cfg_set.
It is better to use int type to represent linux standard error code.
Oleg Drokin [Wed, 10 Feb 2016 18:00:21 +0000 (13:00 -0500)]
staging/lustre: Update internal client version.
While initial code drop was corresponding to 2.3.64, lots of
different changes went in since then, and also quite a bunch of fixes,
but almost none of the new features.
Code-wise we are almost at 2.5.0, so let's call it 2.4.60 - this is a
version that was never reached in the actual pre-2.5 development, so
it should be a clear distinction of where we are now.
Dan Carpenter noticed that since we already checked for
(oa->o_valid & OBD_MD_FLID) == 0, that means
(oa->o_valid & OBD_MD_FLID) is always true after that so
no point in checking for it.
staging: lustre: Modify arguments of sizeof() to pointer variables
Take the size of a dereference to a variable rather than the associated
type, to make the code more resistant to type changes in the future.
The type of the pointer variable here is the same as the type in the
argument that is being replaced in sizeof().
Rakhi Sharma [Wed, 10 Feb 2016 08:43:47 +0000 (14:13 +0530)]
staging: lustre: lov_pool: Fixed a return coding style warning.
Remove unusefull return at the end of void function.
WARNING: void function return statements are not generally useful.
Signed-off-by: Rakhi Sharma <rakhish1994@gmail.com>
Changes in v3:
shortened the subject line and make the discription more clear. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Chromik [Thu, 11 Feb 2016 12:29:23 +0000 (13:29 +0100)]
misc: panel, convert struct to bitmap
There is an anonymous struct which is actually used as a bitmap. So
convert the struct to a bitmap and change code accordingly where
needed.
This also allows for a cleanup of set_data_bits and set_ctrl_bits as
they can use a common helper now. The helper can also be converted to
a for loop instead of doing bit OR. And given it is a for loop now,
bit masking (using BIT_MSK) is moved from the callers there too.
Bhumika Goyal [Mon, 8 Feb 2016 19:58:10 +0000 (01:28 +0530)]
Staging:wlan-ng:Merged two lines into one
The last two lines of these functions are compressed into one.
Also removed the variable ret as it is now not used.
Found using coccinelle:
@@
expression e, ret;
@@
Larry Finger [Tue, 5 Jan 2016 02:30:58 +0000 (20:30 -0600)]
staging: r8192U: Fix check pointer after usage problem
In routine rtl8192_tx_isr(), pointer skb is dereferenced before it is
checked for NULL. This patch has only been compile-tested, as I do not
have the hardware. This problem was reported at
https://bugzilla.kernel.org/show_bug.cgi?id=109951.
Fixes: bugzilla.kernel.org: #109951 Reported-by: Yong Shi <brave_shi@163.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Yong Shi <brave_shi@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The existing kerneldoc blocs had a few issues:
- some of them didn't start with /**
- some used -- instead of - to separate the short description
- some descriptions had text looking like section headers
- some descriptions started with "to" while some used the imperative: use the
imperative everywhere
- some had a "with:" at the end of the shortdesc that didn't make sense once
formatted by kernel-docs
- two argument names where out of sync with the prototype
Signed-off-by: Manuel Pégourié-Gonnard <mpg@elzevir.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: rts5208: Remove unnecessary synchronize_irq() before free_irq()
Calling synchronize_irq() right before free_irq() is quite useless. On one
hand the IRQ can easily fire again before free_irq() is entered, on the
other hand free_irq() itself calls synchronize_irq() internally (in a race
condition free way), before any state associated with the IRQ is freed.
Patch was generated using the following semantic patch:
// <smpl>
@@
expression irq;
@@
-synchronize_irq(irq);
free_irq(irq, ...);
// </smpl>
Arnd Bergmann [Fri, 20 Nov 2015 21:59:14 +0000 (22:59 +0100)]
staging: ste_rmi4: avoid unused function warnings
The rmi4 touchscreen driver encloses the power-management
functions in #ifdef CONFIG_PM, but the smtcfb_pci_suspend/resume
functions are only really used when CONFIG_PM_SLEEP is also
set, as a frequent gcc warning shows:
ste_rmi4/synaptics_i2c_rmi4.c:1050:12: warning: 'synaptics_rmi4_suspend' defined but not used
ste_rmi4/synaptics_i2c_rmi4.c:1084:12: warning: 'synaptics_rmi4_resume' defined but not used
This changes the driver to remove the #ifdef and instead mark
the functions as __maybe_unused, which is a nicer anyway, as it
provides build testing for all the code in all configurations
and is harder to get wrong.
Sean MacLennan [Mon, 16 Nov 2015 00:51:43 +0000 (19:51 -0500)]
staging:rtl8192e: Usage count off by one
The rtllib driver is not calling try_module_get() when loading the
encryption modules. Because of this, you can never remove the module
once you have used it one (i.e. bring up the wireless interface).
Replace the led_classdev_register() with the platform managed version
devm_led_classdev_register() & henceforth remove the redundant
nvec_paz00_remove() function.
Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Acked-by: Marc Dietrich <marvin24@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Okash Khawaja [Thu, 17 Dec 2015 20:30:38 +0000 (20:30 +0000)]
staging: rtl8192u: fix large frame size compiler warning
This patch fixes following compiler warning:
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c: In function
‘RxReorderIndicatePacket’:
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:758:1: warning: the
frame size of 1064 bytes is larger than 1024 bytes
[-Wframe-larger-than=]
It replaces the statically allocated array prxbIndicateArray with
a kmalloc'd one.
Dan Carpenter [Sat, 30 Jan 2016 14:41:10 +0000 (17:41 +0300)]
staging: rtl8712: memory corruption in wpa_set_encryption()
->KeyMaterial is declared as a 16 byte array, but we only ever allocate
either 5 or 13 bytes of it. The problem is that we memset() all 16
bytes to zero so we're memsetting past the end of the allocated memory.
I fixed this in slightly lazy way, by just allocating 16 bytes. This
works but there is a lot more cleanup you could do to this code if you
wanted. Which is why this code is in staging.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cancel pending URBs during suspend operation to avoid receiving ESHUTDOWN
in read/write completion callbacks while the device is suspended.
Receiving ESHUTDOWN in read/write completion callbacks will cause the
driver to enter a non-functioning "stopped" state from which the driver is
unable to recover without reloading the module.