platform/kernel/linux-exynos.git
10 years agostaging: r8188eu: Remove pkt_to_recv{frame, data, mem} routines
Larry Finger [Fri, 14 Feb 2014 22:54:08 +0000 (16:54 -0600)]
staging: r8188eu: Remove pkt_to_recv{frame, data, mem} routines

These functions are not called from the outside source.

Suggested-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: r8188eu: Remove union wrapping of recv_frame
Larry Finger [Fri, 14 Feb 2014 22:54:07 +0000 (16:54 -0600)]
staging: r8188eu: Remove union wrapping of recv_frame

We have now removed everthing from the union except the struct. The union
can be deleted, the struct renamed, and the referencing of members of the
struct becomes a lot simpler.

Some, but not all, of the problems noted by checkpatch.pl have been fixed.

Sugggested-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: r8188eu: Remove pointless "alignment" entry in recv_frame
Larry Finger [Fri, 14 Feb 2014 22:54:06 +0000 (16:54 -0600)]
staging: r8188eu: Remove pointless "alignment" entry in recv_frame

This alignment entry in union recv_frame does nothing. It certainly
dues not ensure alignment.

Suggested-by: Jes.Sorensen@redhat.com
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Jes.Sorensen@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: r8188eu: Remove unnecessary list_head entry from recv_frame union
Larry Finger [Fri, 14 Feb 2014 22:54:05 +0000 (16:54 -0600)]
staging: r8188eu: Remove unnecessary list_head entry from recv_frame union

Struct recv_frame_hdr already contains a list head. This one is pointless.

Suggested-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: r8712u: delete unnecessary field initialization
Julia Lawall [Sat, 15 Feb 2014 07:36:11 +0000 (08:36 +0100)]
staging: r8712u: delete unnecessary field initialization

On success, the function netdev_alloc_skb initializes the dev field of its
result to its first argument, so this doesn't have to be done in the
calling context.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression skb,privn,e;
@@

skb = netdev_alloc_skb(privn,...);
... when strict
(
-skb->dev = privn;
|
?skb = e
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8821ae: fix invalid bit mask on MSR_AP check
Levente Kurusa [Fri, 14 Feb 2014 21:50:23 +0000 (22:50 +0100)]
staging: rtl8821ae: fix invalid bit mask on MSR_AP check

Since MSR_AP is 0x3, ANDing it with 0xFC will never be true.
Add a NOT operation to 0xFC so that we will AND with the last
three bits which will result in a possibility that the condition
will succeed.

Signed-off-by: Levente Kurusa <levex@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: usbip: prevent possible buffer overflow reading port records
Mark Asselstine [Thu, 13 Feb 2014 02:47:56 +0000 (21:47 -0500)]
staging: usbip: prevent possible buffer overflow reading port records

To avoid buffer overflow while reading a corrupted or possibly
modified port file we validate the length of each part of the port
record to ensure it doesn't exceed the length of the destination
buffer.

https://bugzilla.kernel.org/show_bug.cgi?id=69931

Signed-off-by: Mark Asselstine <asselsm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl816: trigger sources were validated in (*do_cmdtest)
H Hartley Sweeten [Mon, 10 Feb 2014 22:20:37 +0000 (15:20 -0700)]
staging: comedi: pcl816: trigger sources were validated in (*do_cmdtest)

The trigger sources were already validataed in the (*do_cmdtest) before the
(*do_cmd) is called. Remove the unnecessary checks in pcl816_ai_cmd().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl812: trigger sources were validated in (*do_cmdtest)
H Hartley Sweeten [Mon, 10 Feb 2014 22:20:36 +0000 (15:20 -0700)]
staging: comedi: pcl812: trigger sources were validated in (*do_cmdtest)

The trigger sources were already validataed in the (*do_cmdtest) before the
(*do_cmd) is called. Remove the unnecessary checks in pcl812_ai_cmd().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: das800: trigger sources are validated in (*do_cmdtest)
H Hartley Sweeten [Mon, 10 Feb 2014 22:20:35 +0000 (15:20 -0700)]
staging: comedi: das800: trigger sources are validated in (*do_cmdtest)

The trigger sources were already validataed in the (*do_cmdtest) before the
(*do_cmd) is called. Refactor the code in das800_ai_do_cmd() to use if/else
instead of the switch since the default cases can never be reached.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: comedi_test: trigger sources are validated in (*do_cmdtest)
H Hartley Sweeten [Mon, 10 Feb 2014 22:20:34 +0000 (15:20 -0700)]
staging: comedi: comedi_test: trigger sources are validated in (*do_cmdtest)

The trigger sources were already validataed in the (*do_cmdtest) before the
(*do_cmd) is called. Refactor the code in waveform_ai_cmd() to remove the
final else which can never be reached.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: cb_pcidas: trigger sources are validated in (*do_cmdtest)
H Hartley Sweeten [Mon, 10 Feb 2014 22:20:33 +0000 (15:20 -0700)]
staging: comedi: cb_pcidas: trigger sources are validated in (*do_cmdtest)

The trigger sources were already validataed in the (*do_cmdtest) before the
(*do_cmd) is called. Refactor the code in cb_pcidas_ai_cmd() to remove the
final else which can never be reached.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: cb_das16_cs: remove incomplete async command support
H Hartley Sweeten [Mon, 10 Feb 2014 22:20:32 +0000 (15:20 -0700)]
staging: comedi: cb_das16_cs: remove incomplete async command support

This driver has a (*do_cmdtest) function for analog input async command
support but the (*do_cmd) function just returns -EINVAL.

Remove the incomplete async command support.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: adl_pci9111: trigger sources are validated in (*do_cmdtest)
H Hartley Sweeten [Mon, 10 Feb 2014 22:20:31 +0000 (15:20 -0700)]
staging: comedi: adl_pci9111: trigger sources are validated in (*do_cmdtest)

The trigger sources were already validataed in the (*do_cmdtest) before the
(*do_cmd) is called. Refactor the code in pci9111_ai_do_cmd() to use if/else
instead of the switch since the default cases can never be reached.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: usbduxfast: remove TRIG_TIMER from scan_begin_src
H Hartley Sweeten [Mon, 10 Feb 2014 22:20:30 +0000 (15:20 -0700)]
staging: comedi: usbduxfast: remove TRIG_TIMER from scan_begin_src

Currently the (*do_cmdtest) indicates that TRIG_TIMER is a valid scan_begin_src
but later this source is tested as -EINVAL. To simplify the code a bit just
remove the TRIG_TIMER source.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: usbduxfast: 'cmd->chanlist_len' was already validataed
H Hartley Sweeten [Mon, 10 Feb 2014 22:20:29 +0000 (15:20 -0700)]
staging: comedi: usbduxfast: 'cmd->chanlist_len' was already validataed

Remove the unnecessary check of 'cmd->chanlist_len > 0'. The (*do_cmdtest) already
validated this before the (*do_cmd) was called.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: don't clear 'data' on (*insn_read) timeout
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:46 +0000 (11:49 -0700)]
staging: comedi: don't clear 'data' on (*insn_read) timeout

It's not necessary to clear the returned data pointer when an (*insn_read)
times out. For aesthetics, remove all of these in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: move (*insn_{read, write}) timeout debug messages to core
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:45 +0000 (11:49 -0700)]
staging: comedi: move (*insn_{read, write}) timeout debug messages to core

Have the comedi core display a standard dev_dbg() message when a timeout
occurs and remove all the driver specific messages.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: dmm32at: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:44 +0000 (11:49 -0700)]
staging: comedi: dmm32at: use comedi_timeout()

Use comedi_timeout() to wait for the analog input settle and end-of-
conversion. These tests use different registers but the same bit so
the register is passed as the 'context'. The same test is used in
dmm32at_ai_cmd() but the 'insn' is not available. This is ok since
the test function, and comedi_timeout() don't use it.

Use comedi_timout() to wait for the analog output end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: dt2814: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:43 +0000 (11:49 -0700)]
staging: comedi: dt2814: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl818: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:42 +0000 (11:49 -0700)]
staging: comedi: pcl818: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl816: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:41 +0000 (11:49 -0700)]
staging: comedi: pcl816: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl812: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:40 +0000 (11:49 -0700)]
staging: comedi: pcl812: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Combine the logic for the pcl812 and acl812 end-of-conversion in the
helper function to simplify the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: daqboard2000: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:39 +0000 (11:49 -0700)]
staging: comedi: daqboard2000: use comedi_timeout()

Use comedi_timeout() to wait for the analog input pipe full, scanning,
amd end-of-conversion status. The status to check it passed as the
'context' to comedi_timeout().

Use comedi_timeout() to wait for the analog output end-of-conversion.

This also fixes a possible bug where invalid data is returned for the
analog input read if the conversion did not complete, The analog
output has a similar possible bug where the cached readback value is
incorrect if the conversion times out.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: dt282x: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:38 +0000 (11:49 -0700)]
staging: comedi: dt282x: use comedi_timeout()

The wait_for() macro in this driver is a bit nasty. It effects control flow
which according to the CodingStyle is a _very_ bad idea.

The mux_busy() and ad_done() macros are also bad since they rely on a local
variable having a specific name.

Remove these macros and use comedi_timeout() to wait for the analog input
mux busy completion and end-of-conversion. Both of these are detected by
reading the same register and testing different bits. Pass the bits to test
as the 'context' to the callback function.

The dt282x_ai_cmd() function also checks for the mux busy completion. The
'insn' is not available here but passing NULL is safe because nothing
uses it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: s626: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:37 +0000 (11:49 -0700)]
staging: comedi: s626: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

This prevents a deadlock condition that could occur by providing a
timeout in case the end-of-conversion does not happen.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: rtd520: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:36 +0000 (11:49 -0700)]
staging: comedi: rtd520: use comedi_timeout()

Use comedi_timeout() to wait for the analog input and output end-of-
conversions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_daq_700: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:35 +0000 (11:49 -0700)]
staging: comedi: ni_daq_700: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: multiq3: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:34 +0000 (11:49 -0700)]
staging: comedi: multiq3: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: icp_multi: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:33 +0000 (11:49 -0700)]
staging: comedi: icp_multi: use comedi_timeout()

Use comedi_timeout() to wait for the analog input and output end-of-
conversion.

Use break to exit the loop when a timeout occurs during the analog
input read so that common code can be used to disable the device.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: dyna_pci10xx: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:32 +0000 (11:49 -0700)]
staging: comedi: dyna_pci10xx: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Also, remove some unnecessary comments.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: amplc_pci230: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:31 +0000 (11:49 -0700)]
staging: comedi: amplc_pci230: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: adq12b: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:30 +0000 (11:49 -0700)]
staging: comedi: adq12b: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

This also fixes a possible bug where invalid data is returned if the
conversion did not complete.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: adv_pci1710: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:29 +0000 (11:49 -0700)]
staging: comedi: adv_pci1710: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: adl_pci9118: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:28 +0000 (11:49 -0700)]
staging: comedi: adl_pci9118: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: adl_pci9111: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:27 +0000 (11:49 -0700)]
staging: comedi: adl_pci9111: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_atmio16d: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:26 +0000 (11:49 -0700)]
staging: comedi: ni_atmio16d: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Change the errno returned when the conversion overflows from -ETIME
to -EOVERFLOW.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_at_a2150: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:25 +0000 (11:49 -0700)]
staging: comedi: ni_at_a2150: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: addi_apci_3xx: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:24 +0000 (11:49 -0700)]
staging: comedi: addi_apci_3xx: use comedi_timeout()

Use comedi_timeout() to wait for the analog input and output end-of-
conversions.

This prevents a deadlock condition that could occur by providing a
timeout in case the end-of-conversion does not happen.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: s526: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:23 +0000 (11:49 -0700)]
staging: comedi: s526: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: mpc624: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:22 +0000 (11:49 -0700)]
staging: comedi: mpc624: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: me_daq: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:21 +0000 (11:49 -0700)]
staging: comedi: me_daq: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: dt2811: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:20 +0000 (11:49 -0700)]
staging: comedi: dt2811: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: das16m1: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:19 +0000 (11:49 -0700)]
staging: comedi: das16m1: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: das08: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:18 +0000 (11:49 -0700)]
staging: comedi: das08: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: cb_pcimdas: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:17 +0000 (11:49 -0700)]
staging: comedi: cb_pcimdas: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Remove the unnecessary comments.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: cb_pcidas64: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:16 +0000 (11:49 -0700)]
staging: comedi: cb_pcidas64: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: cb_pcidas: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:15 +0000 (11:49 -0700)]
staging: comedi: cb_pcidas: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: cb_das16_cs: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:14 +0000 (11:49 -0700)]
staging: comedi: cb_das16_cs: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: aio_aio12_8: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:13 +0000 (11:49 -0700)]
staging: comedi: aio_aio12_8: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: rti800: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:12 +0000 (11:49 -0700)]
staging: comedi: rti800: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Change the errno returned for an overrun from -EIO to -EOVERFLOW.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: dt2815: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:11 +0000 (11:49 -0700)]
staging: comedi: dt2815: use comedi_timeout()

Use comedi_timeout() to wait for the analog output end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcmmio: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:10 +0000 (11:49 -0700)]
staging: comedi: pcmmio: use comedi_timeout()

Use comedi_timeout() to wait for the analog input and output end-of-
conversions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcmad: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:09 +0000 (11:49 -0700)]
staging: comedi: pcmad: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl711: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:08 +0000 (11:49 -0700)]
staging: comedi: pcl711: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_labpc: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:07 +0000 (11:49 -0700)]
staging: comedi: ni_labpc: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: mf6x4: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:06 +0000 (11:49 -0700)]
staging: comedi: mf6x4: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ii_pci20kc: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:05 +0000 (11:49 -0700)]
staging: comedi: ii_pci20kc: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: das800: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:04 +0000 (11:49 -0700)]
staging: comedi: das800: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: das16: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:03 +0000 (11:49 -0700)]
staging: comedi: das16: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: adl_pci6208x: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:02 +0000 (11:49 -0700)]
staging: comedi: adl_pci6208x: use comedi_timeout()

Use comedi_timeout() to wait for the analog output end-of-conversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: skel: use comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:01 +0000 (11:49 -0700)]
staging: comedi: skel: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Since this is the sample skeleton driver, add comments about how the
callback function works with comedi_timeout().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: introduce comedi_timeout()
H Hartley Sweeten [Mon, 10 Feb 2014 18:49:00 +0000 (11:49 -0700)]
staging: comedi: introduce comedi_timeout()

Introduce a comedi core helper function to handle the boilerplate
needed by the drivers to busy- wait for a condition to occur.
Typically this condition is the analog input/output end-of-conversion
used with the comedi (*insn_read) and (*insn_write) operations.

To use this function, the drivers just need to provide a callback
that checks for the desired condition. The callback should return
0 if the condition is met or -EBUSY if it is still waiting. Any
other errno will be returned to the caller. If the timeout occurs
before the condition is met -ETIMEDOUT will be returned.

The parameters to the callback function are the comedi_device,
comedi_subdevice, and comedi_insn pointers that were passed to the
(*insn_read) or (*insn_write) as well as an unsigned long, driver
specific, 'context' that can be used to pass any other information
that might be needed in the callback. This 'context' could be anything
such as the register offset to read the status or the bits needed
to check the status. The comedi_timeout() function itself does not
use any of these parameters.

This will help remove all the crazy "wait this many loops" used by
some of the drivers. It also creates a common errno for comedi to
detect when a timeout occurs.

ADC/DAC conversion times are typically pretty fast, usually around
100K samples/sec (10 usec). A conservative timeout of 1 second is used
in comedi_timeout().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/lustre: fix coccinelle warnings
Fengguang Wu [Wed, 12 Feb 2014 11:21:40 +0000 (19:21 +0800)]
staging/lustre: fix coccinelle warnings

drivers/staging/lustre/lustre/llite/dir.c:1416:2-8: Replace memcpy with struct assignment

Generated by: coccinelle/misc/memcpy-assign.cocci

CC: Peng Tao <bergwolf@gmail.com>
CC: Andreas Dilger <andreas.dilger@intel.com>
CC: Oleg Drokin <oleg.drokin@intel.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/lustre/libcfs: remove cfs_hash_long
Peng Tao [Wed, 12 Feb 2014 11:21:39 +0000 (19:21 +0800)]
staging/lustre/libcfs: remove cfs_hash_long

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/lustre/libcfs: remove user space code from kernel_user_comm.c
Peng Tao [Wed, 12 Feb 2014 11:21:38 +0000 (19:21 +0800)]
staging/lustre/libcfs: remove user space code from kernel_user_comm.c

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: fpgaboot: fix coccinelle warnings
Fengguang Wu [Fri, 14 Feb 2014 17:26:16 +0000 (09:26 -0800)]
staging: fpgaboot: fix coccinelle warnings

drivers/staging/gs_fpgaboot/gs_fpgaboot.c:191:2-3: Unneeded semicolon

 Removes unneeded semicolon.

Generated by: coccinelle/misc/semicolon.cocci

CC: Insop Song <insop.song@gainspeed.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: fpgaboot: fix coccinelle warnings
Fengguang Wu [Fri, 14 Feb 2014 17:26:07 +0000 (09:26 -0800)]
staging: fpgaboot: fix coccinelle warnings

drivers/staging/gs_fpgaboot/gs_fpgaboot.c:305:1-3: WARNING: PTR_RET can be used

 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: coccinelle/api/ptr_ret.cocci

CC: Insop Song <insop.song@gainspeed.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: tidspbridge: Remove OMAP_PM_SRF
Richard Weinberger [Sun, 9 Feb 2014 18:47:58 +0000 (19:47 +0100)]
staging: tidspbridge: Remove OMAP_PM_SRF

The symbol is an orphan, get rid of it.

Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: remove unused header files
navin patidar [Wed, 12 Feb 2014 17:40:16 +0000 (23:10 +0530)]
staging: rtl8188eu: remove unused header files

Remove h2clbk.h and nic_spec.h header files.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: r8188eu: Fix Smatch warnings
Larry Finger [Wed, 12 Feb 2014 17:27:45 +0000 (11:27 -0600)]
staging: r8188eu: Fix Smatch warnings

Smatch reports the following:

core/rtw_ieee80211.c:489 rtw_get_wpa_cipher_suite() warn: add some parenthesis here?
core/rtw_ieee80211.c:491 rtw_get_wpa_cipher_suite() warn: add some parenthesis here?
core/rtw_ieee80211.c:493 rtw_get_wpa_cipher_suite() warn: add some parenthesis here?
core/rtw_ieee80211.c:495 rtw_get_wpa_cipher_suite() warn: add some parenthesis here?
core/rtw_ieee80211.c:497 rtw_get_wpa_cipher_suite() warn: add some parenthesis here?
core/rtw_ieee80211.c:505 rtw_get_wpa2_cipher_suite() warn: add some parenthesis here?
core/rtw_ieee80211.c:507 rtw_get_wpa2_cipher_suite() warn: add some parenthesis here?
core/rtw_ieee80211.c:509 rtw_get_wpa2_cipher_suite() warn: add some parenthesis here?
core/rtw_ieee80211.c:511 rtw_get_wpa2_cipher_suite() warn: add some parenthesis here?
core/rtw_ieee80211.c:513 rtw_get_wpa2_cipher_suite() warn: add some parenthesis here?
core/rtw_ieee80211.c:534 rtw_parse_wpa_ie() warn: add some parenthesis here?
core/rtw_ieee80211.c:579 rtw_parse_wpa_ie() warn: add some parenthesis here?
core/rtw_ieee80211.c:649 rtw_parse_wpa2_ie() warn: add some parenthesis here?
core/rtw_ieee80211.c:803 rtw_get_wps_attr() warn: add some parenthesis here?
core/rtw_ieee80211.c:1213 rtw_get_p2p_ie() warn: add some parenthesis here?
core/rtw_ieee80211.c:1248 rtw_get_p2p_attr() warn: add some parenthesis here?
core/rtw_mlme.c:258 _rtw_find_network() warn: add some parenthesis here?
core/rtw_mlme.c:1581 rtw_check_join_candidate() warn: this array is probably non-NULL. 'pmlmepriv->assoc_ssid.Ssid'
core/rtw_mlme.c:1843 SecIsInPMKIDList() warn: add some parenthesis here?
core/rtw_mlme_ext.c:4189 on_action_public_vendor() warn: add some parenthesis here?
core/rtw_recv.c:1157 validate_recv_mgnt_frame() warn: add some parenthesis here?
core/rtw_xmit.c:671 xmitframe_addmic() warn: add some parenthesis here?
hal/rtl8188e_mp.c:206 Hal_MPT_CCKTxPowerAdjustbyIndex() error: buffer overflow 'CCKSwingTable_Ch1_Ch13' 33 <= 255
hal/rtl8188e_mp.c:215 Hal_MPT_CCKTxPowerAdjustbyIndex() error: buffer overflow 'CCKSwingTable_Ch14' 33 <= 255

Not listed here is one remaining buffer overflow message that I believe to be an error in Smatch.

These warnings were reported by Dan Carpenter.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: camel case and clean up devie_set_multi
Malcolm Priestley [Wed, 12 Feb 2014 19:22:37 +0000 (19:22 +0000)]
staging: vt6656: camel case and clean up devie_set_multi

White space clean up

Camel case changes
pDevice -> priv
pMgmt -> mgmt
byTmpMode -> tmp

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: device_set_multi: set filter off with MACvWriteMultiAddr
Malcolm Priestley [Wed, 12 Feb 2014 19:20:48 +0000 (19:20 +0000)]
staging: vt6656: device_set_multi: set filter off with MACvWriteMultiAddr

set u64 mc_filter to ~0x0 multi cast filter off and write MAC_REG_MAR0 using
MACvWriteMultiAddr to replace pbyData.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: device_set_multi: covert mc_filter to u64
Malcolm Priestley [Wed, 12 Feb 2014 19:18:26 +0000 (19:18 +0000)]
staging: vt6656: device_set_multi: covert mc_filter to u64

Convert mc_filter to u64, preform netdev_for_each_mc_addr
mask filtering.

In MACvWriteMultiAddr endian correct mc_filter and write
the entire multicast once.

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: Additional item for rtl8188eu TODO list
Paul E. McKenney [Wed, 12 Feb 2014 19:54:32 +0000 (11:54 -0800)]
staging: Additional item for rtl8188eu TODO list

The rtw_recv_indicatepkt() function in the file named
drivers/staging/rtl8188eu/os_dep/recv_linux.c has this strange code:

rcu_read_lock();
rcu_dereference(padapter->pnetdev->rx_handler_data);
rcu_read_unlock();

This code has no effect.  Normally, you would assign the result of
rcu_dereference() to some variable, but it is not clear from the
code what variable that would be.  Therefore, this patch applies to
the TODO file instead of the code itself.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: r8188eu: Fix more Smatch warnings and errors
Larry Finger [Wed, 12 Feb 2014 22:14:35 +0000 (16:14 -0600)]
staging: r8188eu: Fix more Smatch warnings and errors

After updating Smatch, the following new errors and warnings are reported:

drivers/staging/rtl8188eu/core/rtw_recv.c:368 recvframe_chkmic() warn: variable dereferenced before check 'psecuritypriv' (see line 364)
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:2642 rtw_wps_start() warn: variable dereferenced before check 'pdata' (see line 2636)
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:4461 rtw_dbg_port() error: we previously assumed 'pregpriv' could be null (see line 4453)
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:4473 rtw_dbg_port() error: we previously assumed 'pregpriv' could be null (see line 4469)

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8821ae: Fix potential infinite loop
Larry Finger [Wed, 12 Feb 2014 23:10:28 +0000 (17:10 -0600)]
staging: rtl8821ae: Fix potential infinite loop

Smatch reports the following:
drivers/staging/rtl8821ae/rtl8821ae/hw.c:153 _rtl8821ae_set_fw_clock_on() info: ignoring unreachable code.

Upon investigation, the code in this region has the capability of creating
an infinite loop.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: r8188eu: Remove dead code
Paul Bolle [Thu, 13 Feb 2014 12:00:18 +0000 (13:00 +0100)]
staging: r8188eu: Remove dead code

There are a few lines in this driver that depend on a macro
CONFIG_BT_COEXIST. But there's no Kconfig symbol of that name nor is
there a preprocessor define for that string. So remove these lines.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: comedi: clean up conditional statement in addi_apci_3xxx.c
Chase Southwood [Fri, 14 Feb 2014 01:02:26 +0000 (19:02 -0600)]
Staging: comedi: clean up conditional statement in addi_apci_3xxx.c

In this conditional statement, if (chan < 16), but the instruction passed
in data[0] is INSN_CONFIG_DIO_QUERY, the function does not return early,
but the else-branch does not get executed either.  As a result, mask
would be used uninitialized in the next line.  We want
comedi_dio_insn_config() to use a chan_mask based on the chanspec for the
INSN_CONFIG_DIO_QUERY instruction, so mask should be initialized to 0.
Then, if instead the instruction is INSN_CONFIG_DIO_{INPUT,OUTPUT}, we
return an error if (chan < 16) as these are invalid instructions for
ports 0 and 1, or update the mask otherwise, so all the io_bits are
modified for port 2.  This ensures that mask is always initialized by the
time it is used.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: lowmemorykiller: set TIF_MEMDIE before send kill sig
Weijie Yang [Fri, 14 Feb 2014 06:03:56 +0000 (14:03 +0800)]
staging: android: lowmemorykiller: set TIF_MEMDIE before send kill sig

Set TIF_MEMDIE tsk_thread flag before send kill signal to the
selected thread. This is to fit a usual code sequence and avoid
potential race issue.

Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging:lustre: Fix typo in comment and printk within lustre/obdclass
Masanari Iida [Fri, 14 Feb 2014 16:11:17 +0000 (01:11 +0900)]
staging:lustre: Fix typo in comment and printk within lustre/obdclass

This patch fixed spelling typo within lustre/lustre/obdclass.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_TIME_SINCE_NET_ENTRY case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:48:14 +0000 (14:48 -0500)]
staging/bcm: move IOCTL_BCM_TIME_SINCE_NET_ENTRY case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_GET_DEVICE_DRIVER_INFO case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:48:09 +0000 (14:48 -0500)]
staging/bcm: move IOCTL_BCM_GET_DEVICE_DRIVER_INFO case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_CNTRLMSG_MASK case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:48:04 +0000 (14:48 -0500)]
staging/bcm: move IOCTL_BCM_CNTRLMSG_MASK case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_NVM_RAW_READ case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:47:59 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_NVM_RAW_READ case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_SELECT_DSD case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:47:53 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_SELECT_DSD case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_GET_FLASH_CS_INFO case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:47:48 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_GET_FLASH_CS_INFO case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_COPY_SECTION case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:47:43 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_COPY_SECTION case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: formatting cleaning for IOCTL_BCM_IDENTIFY_ACTIVE_SECTION
Dave Jones [Thu, 13 Feb 2014 19:47:38 +0000 (14:47 -0500)]
staging/bcm: formatting cleaning for IOCTL_BCM_IDENTIFY_ACTIVE_SECTION

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_SET_ACTIVE_SECTION case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:47:33 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_SET_ACTIVE_SECTION case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_GET_FLASH2X_SECTION_BITMAP case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:47:28 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_GET_FLASH2X_SECTION_BITMAP case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_FLASH2X_SECTION_WRITE case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:47:23 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_FLASH2X_SECTION_WRITE case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_FLASH2X_SECTION_READ case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:47:18 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_FLASH2X_SECTION_READ case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_NVM_[READ|WRITE] cases out to their own function.
Dave Jones [Thu, 13 Feb 2014 19:47:13 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_NVM_[READ|WRITE] cases out to their own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_SET_DEBUG case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:47:08 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_SET_DEBUG case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_CAL_INIT case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:47:02 +0000 (14:47 -0500)]
staging/bcm: move IOCTL_BCM_CAL_INIT case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_GET_NVM_SIZE case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:46:57 +0000 (14:46 -0500)]
staging/bcm: move IOCTL_BCM_GET_NVM_SIZE case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_BULK_WRM case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:46:52 +0000 (14:46 -0500)]
staging/bcm: move IOCTL_BCM_BULK_WRM case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_GET_HOST_MIBS case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:46:47 +0000 (14:46 -0500)]
staging/bcm: move IOCTL_BCM_GET_HOST_MIBS case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: move IOCTL_BCM_GET_DSX_INDICATION case out to its own function.
Dave Jones [Thu, 13 Feb 2014 19:46:42 +0000 (14:46 -0500)]
staging/bcm: move IOCTL_BCM_GET_DSX_INDICATION case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>