Chase Southwood [Sun, 9 Mar 2014 06:42:47 +0000 (00:42 -0600)]
Staging: comedi: addi-data: style cleanups in hwdrv_apci1564.c
This patch cleans up a few trivial style issues, including fixing crazy
indentation problems in the defines near the top of the file, removing a
couple of unneeded braces, and wrapping a couple of long comments onto new
lines to fix lines which were in excess of 80 characters.
Chase Southwood [Sun, 9 Mar 2014 04:00:54 +0000 (22:00 -0600)]
Staging: comedi: convert while loops to timeouts in s626.c
This patch changes a handful of while loops to timeouts to prevent
infinite looping on hardware failure. A couple such loops are in a
function (s626_debi_transfer()) which is called from critical sections,
so comedi_timeout() is unusable for them, and an iterative timeout is
used instead. For the while loops in a context where comedi_timeout() is
allowed, a new callback function, s626_send_dac_eoc(), has been defined
to evaluate the conditions that the while loops are testing. The new
callback employs a switch statement based on a simple new enum so that
it is usable for all of the different conditions tested in while loops
in s626_send_dac(). The proper comedi_timeout() calls are then used.
staging: comedi: drivers should not clear the async->events
The comedi core resets the async->events in comedi_buf_reset() which is
called when the subdevice is restored to an idle state and at the start
of an async command. The async->events are also cleared after handling
the events in comedi_event().
Drivers should not clear the events manually.
Signed-off-by: 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: ni_mio_common: use cfc_handle_events()
The ni_event() function in this file is an open coded version of
cfc_handle_events() where instead of calling the subdevice (*cancel)
function a switch is used to call the function based on the subdevice
'index'.
Use the comedi_fc helper function to simplify the code.
This also allows removing a couple of the forward declarations.
Fix the #ifdef/#endif for the ni_gpct_cancel() foward declaration and
around the function. This function is now only referenced by code that
is blocked with #ifdef PCIDMA.
This source file is included by the ni_atmio, ni_mio_cs, and ni_pcimio
drivers. In the Kconfig, the config options for these drivers already
select COMEDI_FC.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use the comedi_fc helper function to automatically call the subdevice
(*cancel) function when needed and call comedi_event().
This also fixes two bugs.
1) the analog input command is canceled due to a buffer overflow
without sending an event (@@ -341,7 +340,7 @@).
2) an analog output error causes the command to cancel but the event
is reported to the analog input subdevice (@@ -449,15 +447,13 @@).
In the Kconfig, COMEDI_DT282X already selects COMEDI_FC.
Signed-off-by: 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: jr3_pci: remove 'n_channels' from private data
This member of the private data is actually the number of subdevices. We
can get that information directly from the comedi_device. Do that instead
and remove the unnecessary member from the private data.
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>
staging: comedi: jr3_pci: introduce boardinfo for the supported boards
Create an enum for the boards supported by this driver and pass that enum in
the pci_driver id_table as the driver_data.
Introduce a boardinfo struct to hold the board specific data for the boards
supported by this driver. Use the boardinfo when attaching to the driver
instead of using the pcidev->device and the switch.
Since the PCI device ids are now only used in the id_table, remove the
defines and open code the device ids.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: jr3_pci: tidy up jr3_download_firmware()
This callback function for comedi_load_firmware() first validates that
the firmware data is the correct format then it writes the data to each
subdevice.
Split the two operations out as separate functions to clarify the code.
Tidy up the new functions.
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>
staging: comedi: jr3_pci: factor subdevice private data init out of (*attach)
Factor the code that allocates and initializes the subdevice private data
out of the (*attach) to reduce the indent level and make the code easier
to follow.
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>
staging: comedi: jr3_pci: use comedi_alloc_spriv()
Use the helper function to allocate the subdevice private data. This
sets the s->private variable for us and allows the comedi core to
automatically kfree() the memory during the (*detach).
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>
The COMEDI_CMD and COMEDI_CMDTEST ioctl functions both copy the chanlist
passed by the user from __user memory space to kernel memory space. They
then do some sanity checking of the chanlist with comedi_check_chanlist()
before the subdevice (*do_cmdtest) and (*do_cmd) operations are called.
Introduce a helper function to handle the memdup_user() and the sanity
checking.
Also, remove the unnecessary dev_dbg() when the memdup_user() or
comedi_check_chanlist() fail.
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>
The COMEDI_CMD and COMEDI_CMDTEST ioctl functions both copy the
comedi_cmd passed by the user from __user memory space to kernel
memory space. They then do some basic sanity checking of the cmd
before the subdevice (*do_cmdtest) and (*do_cmd) operations are
called.
Introduce a helper function to handle the copy_from_user() and
do the basic sanity checking.
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>
Himangi Saraogi [Sat, 15 Mar 2014 21:44:57 +0000 (03:14 +0530)]
staging:keucr: Remove typedefs
As suggested by Pablo, this patch uses a coccinelle script to remove the
typedefs:
typedef u8 BOOLEAN; <-- use "bool" instead.
typedef u8 BYTE; <-- use "u8"
typedef u8 *PBYTE; <-- use "u8 *"
typedef u16 WORD; <-- use "u16"
typedef u16 *PWORD; <-- use "u16 *"
typedef u32 DWORD; <-- use "u32"
typedef u32 *PDWORD; <-- use "u32 *"
in common.h.
Ana Rey [Sun, 16 Mar 2014 19:44:40 +0000 (20:44 +0100)]
staging: rtl8187se: Delete some innecesary whitespaces
Delete some whitespaces (whitespace before a quoted newline, space
at the start of a line and space before a tabs) as the codingStyle of
the kernel recommends.
Fix checkpatch.pl errors:
WARNING: unnecessary whitespace before a quoted newline
WARNING: please, no spaces at the start of a line
WARNING: please, no space before tabs
Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Ana Rey [Sun, 16 Mar 2014 19:44:39 +0000 (20:44 +0100)]
staging: rtl8187se: Add whitespaces around '&', '||' and '&&'
Add whitespaces around '&', '||' and '&&' as the codingStyle of the kernel
recommends.
Fix checkpatch.pl errors:
ERROR: spaces required around that '||' (ctx:VxV)
ERROR: spaces required around that '&&' (ctx:VxV)
ERROR: need consistent spacing around '&'
Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Ana Rey [Sun, 16 Mar 2014 19:44:35 +0000 (20:44 +0100)]
staging: rtl8187se: Add whitespaces around '+', '-' and '='
Add whitespaces around '+', '-' and '=' as the codingStyle of the kernel
recommends.
Fix checkpatch.pl errors:
ERROR: need consistent spacing around '+'
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: need consistent spacing around '-'
Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Ana Rey [Sun, 16 Mar 2014 19:44:34 +0000 (20:44 +0100)]
staging: rtl8187se: Delete spaces prohibited around semicolons, colons and exclamations
Delete spaces prohibited before semicolon, before ':' and after '!' and
fix coding style in these lines when It is necessary.
Fix checkpàtch.pl error and warning messages:
WARNING: space prohibited before semicolon
ERROR: space prohibited before that ':'
ERROR: space prohibited after that '!'
Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Ana Rey [Sun, 16 Mar 2014 19:44:27 +0000 (20:44 +0100)]
staging: rtl8187se: Fix whitespace around else-statements
Fix whitespaces around else-statements and fix coding style in the
lines when It is necessary as the codingStyle of the kernel recommends
in ieee80211/ieee80211_softmac.c
Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Ana Rey [Sun, 16 Mar 2014 19:44:26 +0000 (20:44 +0100)]
staging: rtl8187se: Fix whitespaces in if-statement.
Fix whitespaces around braces in if-statement as the
codingStyle of the kernel recommends in ieee80211/ieee80211_softmac.c
Also, fix coding style in these lines when It is necessary.
Fix checkpatch.pl errors:
ERROR: space required before the open brace '{'
Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Ana Rey [Sun, 16 Mar 2014 19:44:25 +0000 (20:44 +0100)]
staging: rtl8187se: Remove unused functions 'rsn_authen_cipher_suite' and 'ext_ieee80211_send_beacon_wq'
Remove unused functions rsn_authen_cipher_suite() and
ext_ieee80211_send_beacon_wq() from ieee80211_softmac.c.
Fix sparse warnings:
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c:27:11: warning: ‘rsn_authen_cipher_suite’ defined but not used [-Wunused-variable]
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c:327:13: warning: ‘ext_ieee80211_send_beacon_wq’ defined but not used [-Wunused-function]
Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Gulsah Kose [Sat, 15 Mar 2014 01:06:06 +0000 (03:06 +0200)]
staging: crystalhd: Fix no space before tabs
This patch fixes no spaces before tabs warning in crystalhd_misc.h
Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Ebru Akagunduz [Thu, 13 Mar 2014 08:34:20 +0000 (10:34 +0200)]
Staging: bcm: Removed unreachable code line in Bcmchar.c
This patch removes unreachable code line and
unnecessary braces in Bcmchar.c
Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com> Acked-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>