The subdevices that don't initialize any of the callbacks don't really
exist. Remove the unnecessary initialzation and just set the type to
COMEDI_SUBD_UNUSED.
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>
The subdevices that don't initialize any of the callbacks don't really
exist. Remove the unnecessary initialzation and just set the type to
COMEDI_SUBD_UNUSED.
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: addi_apci_1500: remove subdevice callbacks from boardinfo
This driver only has one boardinfo entry so the subdevice callbacks are
always the same. Remvoe the callbacks from the boardinfo and use them
directly when initializing the subdevices.
Remove all the subdevice callback initialization that would be set to
NULL.
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: addi_apci_035: remove subdevice callbacks from boardinfo
This driver only has one boardinfo entry so the subdevice callbacks are
always the same. Remvoe the callbacks from the boardinfo and use them
directly when initializing the subdevices.
Remove all the subdevice callback initialization that would be set to
NULL.
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: addi_common.c: remove included source file
The addi_apci_035 and addi_apci_1500 are the only drivers left that
include this source file. Copy the i_ADDIDATA_InsnReadEeprom() function
from that file to those drivers and remove the addi_common.c file.
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>
The addi_apci_035 and addi_apci_1500 are the only drivers left that use
this function in addi_common.c. The function simply calls the 'interrupt'
function that is in the boardinfo of the driver. Both drivers use the
same 'interrupt' function for all boardnfo entries.
Remove the i_ADDI_Reset() function as well as the 'interrupt' boardinfo
and use the 'interrupt' function directly when doing the request_irq().
In addition, the addi_apci_3120 driver has a private v_ADDI_Interrupt()
function that is doing the same thing. Remove that one as well.
Fix the return type of 'interrupt' functions in the drivers and add the
return vaules.
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>
The addi_apci_035 and addi_apci_1500 are the only drivers left that use
this function in addi_common.c. The addi_common code adds a lot of bloat
to the drivers.
Copy the addi_auto_attach() code to the (*auto_attach) functions of the
drivers and remove the function. This will help with removing the bloat.
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>
The addi_apci_035 and addi_apci_1500 are the only drivers left that use
this function in addi_common.c. The function simply calls the 'reset'
function that is in the boardinfo of the driver. Both drivers use the
same 'reset' function for all boardnfo entries.
Remove the i_ADDI_Reset() function as well as the 'reset' boardinfo and
just call the 'reset' function directly.
The i_ADDI_Reset() is called by addi_auto_attach() in addi_common.c after
a sucessful attach. Modify the (*auto_attach) in the drivers to call the
'reset' function directly and remove it from addi_auto_attach().
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>
The addi_apci_035 and addi_apci_1500 are the only drivers left that use
this function in addi_common.c. Remove the function an add a private
comedi_driver (*detach) function to those drivers.
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: comedidev.h: don't expose COMEDI_CB_* defines to userspace
The COMEDI_CB_* defines are the comedi_async "events" that the drivers set
to let the core detect the state of running async commands. These "events"
are only relevant to the kernel modules and should not be exposed to
userspace in the comedi.h user API header.
Move the defines to comedidev.h to avoid exposing them. For aesthetics,
convert the defines to bit shifts to better indicate that they are bitmask
values. Cleanup the documentation.
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>
Ian Abbott [Mon, 13 Oct 2014 12:41:22 +0000 (13:41 +0100)]
staging: comedi: cb_pcimdas: add support for PCIe-DAS1602/16
The Measurement Computing PCIe-DAS1602/16 is a PCI-Express version of
the PCIM-DAS1602/16, but has a different PCI device ID. Add support
for this device and update the driver description, Kconfig description
and MODULE_DESCRIPTION.
Thanks to Christoph Langbein for supplying the PCI device ID.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The Comedi driver comment mentions a couple of manual configuration
options, but manual configuration via the COMEDI_DEVCONFIG ioctl and
comedi "attach" handler is no longer supported by this driver. Update
the comment appropriately.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aya Mahfouz [Sun, 26 Oct 2014 17:46:00 +0000 (19:46 +0200)]
staging: media: lirc: lirc_sir.c: use pr_debug and dev_dbg instead of dprintk
This patch removes the custom printk macro dprintk and replaces most of
the calls made to it by dev_dbg. pr_debug was used when the calling
function did not provide the appropiate device variable.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aya Mahfouz [Sun, 26 Oct 2014 17:59:43 +0000 (19:59 +0200)]
staging: media: lirc: lirc_zilog.c: replace custom print macros with dev_* and pr_*
This patch removes the custom printk macros dprintk, zilog_notify,
zilog_error, and zilog_info. All the calls to these macros were
replaced by dev_dbg, dev_notice, dev_err, and dev_info respectively
whenever possible. There were cases in which pr_debug, pr_notice,
pr_err and pr_info were used. It was when the calling function did
not provide an appropiate dev variable.
Applying this patch will trigger the out of memory checkpatch warning
for two lines. It will be fixed in a separate patch.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Melike Yurtoglu [Sun, 26 Oct 2014 21:55:22 +0000 (23:55 +0200)]
staging: ozwpan: Fix incorrect type in assignments
This patch fixes following sparse warnings:
drivers/staging/ozwpan/ozhcd.c:1917:35: warning: incorrect type in
assignment (different base types)
drivers/staging/ozwpan/ozhcd.c:1917:35: expected restricted __le16
[usertype] wHubCharacteristics
drivers/staging/ozwpan/ozhcd.c:1917:35: got unsigned short [unsigned]
[usertype] <noident>
Tapasweni Pathak [Sun, 26 Oct 2014 13:50:16 +0000 (19:20 +0530)]
staging: android: Replace timeval with timespec64
'timeval' is used to print timestamps in seconds and millisecond.
32-bit systems using 'struct timeval' will break in the year 2038,
So we have to replace that code with more appropriate types.
This patch changes the android driver to use timespec64.
Since this is a staging driver and the output is only used for a
debugfs file, it is fine to slightly change the output and
use nanoseconds instead. ktime_to_timespec64, is used which will return
seconds and nanoseconds.
Aya Mahfouz [Sat, 25 Oct 2014 21:40:15 +0000 (23:40 +0200)]
staging: dgnc: dgnc_driver: remove all occurences of trcbuf_size
This patch removes the variable trcbuf_size given there is no real
use for it anymore. All of the debug variables in this driver is
basically dead code.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vaishali Thakkar [Mon, 27 Oct 2014 12:26:33 +0000 (17:56 +0530)]
Staging: rtl8192u: Annotate association types with proper endianness
This patch fixes following sparse warning at number of places in
file rtl819x_BAProc.c.
Warning: incorrect type in assignment (different base types)
expected unsigned short [unsigned] [usertype] tmp
got restricted __le16 [usertype] <noident>
Here, code before this change is correct. But this change silents
sparse warnings and will not harm code too.
Staging: lustre: Place a space after a semi colon.
Removes the following errors generated using checkpatch.pl tool:
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h:247: ERROR: space required after that ';' (ctx:VxV)
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h:269: ERROR: space required after that ';' (ctx:VxV)
This patch used the following semantic patch to find an instance where NULL
check is present before kfree
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>
Code is made more simpler by breaking up of sequence of kmallocs and adding
some more exit labels.
Removed unnecessary initialization of buf and fmtbuf to NULL as they are local
variables.
Suggested-by: Arnd Bergmann <arnd@arndb.de> Suggested-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tina Ruchandani [Sat, 25 Oct 2014 23:35:49 +0000 (16:35 -0700)]
Staging: lustre: llite: Simplify error handling
This patch fixes the following checkpatch error:
ERROR: do not use assignment in if condition
2172: FILE: drivers/staging/lustre/lustre/llite/llite_lib.c:2172:
if (!inode || !(sbi = ll_i2sbi(inode))) {
Tina Ruchandani [Sat, 25 Oct 2014 21:45:55 +0000 (14:45 -0700)]
Staging: lustre: lnet: Make functions static
This patch makes the following functions static
as they are only used in their respective files.
These functions were detected by sparse.
- lib-md.c : lnet_md_validate
- lib-move.c : lnet_ni_*
lnet_setpayloadbuffer
lnet_peer_alive_locked
lnet_msg2bufpool
lnet_post_routed_recv_locked
lnet_configure / lnet_unconfigure
lnet_ioctl
init_lnet
fini_lnet
Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes uneeded return variables, using only
'return _SUCCESS' instead.
It fixes the following warning detected by coccinelle:
Unneeded variable.
It was done using the following semantic patch:
@@
identifier ret;
type T;
expression e;
@@
-T ret = e;
... when != ret
when strict
-return ret;
+return e;
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes uneeded return variables, using only
'return _SUCCESS' instead.
It fixes the following warning detected by coccinelle:
Unneeded variable.
It was done using the following semantic patch:
@@
identifier ret;
type T;
expression e;
@@
-T ret = e;
... when != ret
when strict
-return ret;
+return e;
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes uneeded return variables, just using
'return _SUCCESS' or 'return HCI_STATUS_SUCCESS' instead.
This fixes the following warning detected using coccinelle:
Unneeded variable.
It was done using the following semantic patch:
@@
identifier ret;
type T;
expression e;
@@
-T ret = e;
... when != ret
when strict
-return ret;
+return e;
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tina Ruchandani [Sat, 25 Oct 2014 23:56:01 +0000 (16:56 -0700)]
Staging: rtl8723au: core: Add braces around macro
This patch fixes the following checkpatch warning:
ERROR: Macros with complex values should be enclosed
in parentheses
1535: FILE: drivers/staging/rtl8723au/core/rtw_mlme.c:1535:
Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vaishali Thakkar [Sat, 25 Oct 2014 06:26:29 +0000 (11:56 +0530)]
Staging: rtl8723au: Use USB API functions
This patch replaces driver specific functions(RT_usb_endpoint_is_bulk_in,
RT_usb_endpoint_is_bulk_out, RT_usb_endpoint_is_int_in) with USB API
functions(usb_endpoint_is_bulk_in, usb_endpoint_is_bulk_out,
usb_endpoint_is_int_in).
Also, this patch removes these three RT functions as they are no longer
needed after replacement.
This patch also have one line over 80 characters as limiting it to 80
characters does not make code look good.
Benjamin Romer [Thu, 23 Oct 2014 18:30:58 +0000 (14:30 -0400)]
staging: unisys: refactor TASK_MGMT_TYPES
Get rid of the typedef and use enum task_mgmt_types in its place. Clean up
the indentation of the enumeration values and update all use of the name to
the new name.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>