Ian Abbott [Tue, 27 Jan 2015 17:49:01 +0000 (17:49 +0000)]
staging: comedi: add comedi_usb.h
Add a new header that Comedi USB drivers can include instead of
"comedidev.h". Currently, it just pulls in <linux/usb.h> and
"comedidev.h", but the plan is to migrate the USB-specific stuff from
"comedidev.h" here.
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>
Add a comedi driver comment in a form suitable for importing into
Comedilib documentation. The information about the change-of-state
subdevice has been pulled from other comments in the driver.
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>
Ian Abbott [Mon, 26 Jan 2015 13:25:23 +0000 (13:25 +0000)]
staging: comedi: 8255.c: document subdev_8255_init() and _mm_init()
Add kerneldoc comments for the subdev_8255_init() and
subdev_8255_mm_init() functions and remove the other comment about how
to use this module in a comedi driver.
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>
staging: comedi: das16: fix DMA size for short transfers
Currently this driver alwasy programs the DMA transfer to be the allocated
size of the DMA buffer. When the async command 'stop_src' is TRIG_COUNT its
possible (likely) for the last transfer to be less than the buffer size.
Introduce a helper function, das16_ai_setup_dma(), to calculate the actual
size of the DMA transfer based on the number of samples remaining and the
number of unread samples.
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: das16: use comedi_async 'scans_done' to detect EOA
Refactor das16_interrupt() to use the comedi_async 'scans_done' member to
detect the End-of-Acquisition for the async command. Use the helper function
comedi_nsamples_left() to determine if DMA needs to be restarted.
This allows the removal of the private data 'adc_byte_count' and fixes a
possible integer overflow issue when that value is calculated.
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>
Clarify the (*attach) a bit by introducing a helper function to handle the
setup of the analog output 'range_table'.
Some of the boards supported by this driver do not have programmable ranges.
The analog output subdevice can use optional range information provided by
the user during the attach of the driver. Currently this range data is
allocated and stored in the private data.
Use the subdevice private data member instead and allocate the memory with
comedi_alloc_spriv(). The comedi core will automatically free this memory
when the driver is detached. If the allocation fails set the 'range_table'
to 'range_unknown' instead of failing the driver 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>
Clarify the (*attach) a bit by introducing a helper function to handle the
setup of the analog input 'range_table'.
Some of the boards supported by this driver do not have programmable ranges.
The analog input subdevice can use optional range information provided by
the user during the attach of the driver. Currently this range data is
allocated and stored in the private data.
Use the subdevice private data member instead and allocate the memory with
comedi_alloc_spriv(). The comedi core will automatically free this memory
when the driver is detached. If the allocation fails set the 'range_table'
to 'range_unknown' instead of failing the driver 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 das16_ai_disable() function disables interrupts and the pacer clock. This
function is called by the subdevice (*cancel) operation.
The comedi core will not call a subdevice (*insn_read) operation while an
async command is running due to the s->busy check in parse_insn(). Since all
async commands are terminated by a (*cancel), the das16_ai_disable() is not
necessary in das16_ai_insn_read(). Remove it.
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>
Lorenzo Stoakes [Sat, 24 Jan 2015 15:45:24 +0000 (15:45 +0000)]
staging: rtl8192u: Refactor heavy nesting
This patch fixes warnings raised by checkpatch.pl relating to heavily indented
lines in r8192U_dm.c by refactoring code to achieve the same outcome indented by
one less tab.
Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lorenzo Stoakes [Sat, 24 Jan 2015 15:45:22 +0000 (15:45 +0000)]
staging: rtl8192u: fix whitespace and alignment
This patch fixes warnings/errors raised by checkpatch.pl relating to whitespace
in r8192U_dm.c, removes inconsistent whitespace, and additionally fixes some
vertical alignment issues.
Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Zachary Warren [Sat, 17 Jan 2015 11:39:53 +0000 (22:39 +1100)]
staging: unisys: rework signal remove/insert to avoid sparse lock warnings
Avoids the following warnings from sparse:
visorchannel_funcs.c:457:9: warning:
context imbalance in 'visorchannel_signalremove' - different lock contexts for basic block
visorchannel_funcs.c:512:9: warning:
context imbalance in 'visorchannel_signalinsert' - different lock contexts for basic
These warnings are false positives. Sparse can't track conditional contexts. The change
puts the lock/unlock into the same context by splitting the insert/remove functions each
into a wrapper function that does locking if necessary and an inner function that does the
insert/remove operation.
In mdc_kuc_write(), OBD_ALLOC(lh, len) may leave 'lh' to NULL as kmalloc
may fail to allocate memory. This fix adds a check to avoid, dereferencing
a NULL pointer.
Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John Stultz [Tue, 20 Jan 2015 21:42:34 +0000 (13:42 -0800)]
staging: Remove the Android alarm-dev driver
The functionality provided by the Android alarm-dev driver
should now be present in the timerfd interface (thanks to
Greg Hackmann and Todd Poynor).
As of Lollipop, AOSP can make use of the timerfd if
alarm-dev is not present (though a fixup for setting the
rtc time if rtc0 isn't the backing for _ALARM clockids has
been applied post-Lollipop).
Thus, we should be able to remove alarm-dev from staging.
Cc: Greg Hackmann <ghackmann@google.com> Cc: Elliott Hughes <enh@google.com> Cc: Todd Poynor <toddpoynor@google.com> Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Acked-by: Mark Salyzyn <salyzyn@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Andrew Milkovich [Sun, 18 Jan 2015 18:41:30 +0000 (10:41 -0800)]
Staging: dgnc: fixed some coding style errors
This patch fixes the following checkpatch.pl error:
ERROR: Macros with complex values should be enclosed in parentheses
Outer parentheses were added to macro definitions.
Signed-off-by: Andrew Milkovich <amilkovich@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: rts5208: use msecs_to_jiffies for timeouts
This is only an API consolidation and should make things more readable
Converting milliseconds to jiffies by val * HZ / 1000 is technically
not wrong but msecs_to_jiffies(val) is the cleaner solution and handles
corner cases correctly.
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixed the following warnings (reported by sparse):
drivers/staging/wlan-ng/hfa384x_usb.c:3828:36: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3229:16: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3430:18: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3349:51: warning: restricted __le16 degrades to integer
drivers/staging/wlan-ng/hfa384x_usb.c:3357:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3358:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3393:36: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3102:28: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3004:28: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:1308:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: expected unsigned short [unsigned] [usertype] type
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: got restricted __le16 [usertype] <noident>
Sudip Mukherjee [Thu, 22 Jan 2015 06:39:16 +0000 (12:09 +0530)]
staging: rtl8712: remove unused function
mp_query_drv_var() was only being used by
oid_rt_pro_query_dr_variable_hdl() but after commit
<f4f5a59ff2e746885be3c1c06c1d0e8861a10ce8> mp_query_drv_var() became
unused. so it is safe to remove it.
Ken Depro [Tue, 20 Jan 2015 15:01:18 +0000 (10:01 -0500)]
staging: unisys: Fix CamelCase for function names in virthba.c
This patch fixes CamelCase function names in virthba.c, reported by the
checkpatch script:
doDiskAddRemove --> do_disk_add_remove
SendDiskAddRemove --> send_disk_add_remove
Signed-off-by: Ken Depro <kenneth.depro@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ken Depro [Tue, 20 Jan 2015 15:01:17 +0000 (10:01 -0500)]
staging: unisys: Fix remaining CamelCase global variables in virthba.c
This patch fixes the remaining CamelCase global variables in virthba.c reported
by the checkpatch script:
MaxBuffLen --> max_buff_len
VirtHbasOpen --> virthbas_open
Signed-off-by: Ken Depro <kenneth.depro@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ken Depro [Tue, 20 Jan 2015 15:01:16 +0000 (10:01 -0500)]
staging: unisys: Fix CamelCase for Disk Add/Remove global variables in virthba.c
This patch fixes the Disk Add/Remove (DAR) related CamelCase global
variables in virthba.c, reported by the checkpatch script:
DARWorkQ --> dar_work_queue
DARWorkQHead --> dar_work_queue_head
DARWorkQLock --> dar_work_queue_lock
DARWorkQSched --> dar_work_queue_sched
Signed-off-by: Ken Depro <kenneth.depro@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ken Depro [Tue, 20 Jan 2015 15:01:13 +0000 (10:01 -0500)]
staging: unisys: Fix "else not useful after return" warning in virthba.c
This patch fixes a warning generated during the checkpatch script that stated
"else not useful after return". I modified the code to return a designated
status at the end of the function, and replaced the return statement in the
"else if" to set the status accordingly.
Signed-off-by: Ken Depro <kenneth.depro@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ken Depro [Tue, 20 Jan 2015 15:01:12 +0000 (10:01 -0500)]
staging: unisys: fix checkpatch checks for structs in virthba.c
This patch fixes a couple small issues reported by the checkpatch script:
Adds a blank line after a struct definition.
Removes unnecessary parentheses surrounding a dereference of a struct member.
Signed-off-by: Ken Depro <kenneth.depro@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ken Depro [Tue, 20 Jan 2015 15:01:11 +0000 (10:01 -0500)]
staging: unisys: Change alloc calls to use var name instead of type in virthba.c
This patch changes a couple of kzalloc calls to pass the variable name to the
call, rather than the variable struct type. This is a result of checks
generated during the checkpatch script.
Signed-off-by: Ken Depro <kenneth.depro@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Fri, 23 Jan 2015 14:20:25 +0000 (17:20 +0300)]
staging: fbtft: fix allyesconfig build
There are two functions call reset() so the allyesconfig breaks. Let's
make this one static.
Reported-by: Jim Davis <jim.epost@gmail.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Tested-by: Jim Davis <jim.epost@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:51:3:warning:
symbol 'll_rpc_opcode_table' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:142:3: warning:
symbol 'll_eopcode_table' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:178:12: warning:
symbol 'll_eopcode2str' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:731:1: warning:
symbol 'ptlrpc_lprocfs_svc_req_history_seek' was not declared. Should it be static?
Signed-off-by: Jon Bernard <jbernard@tuxion.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Thu, 22 Jan 2015 07:49:54 +0000 (10:49 +0300)]
staging: lustre: remove the CFS_HOP() macro
CFS_HOP() is a terrible macro. It chops the struct member name in half
so that it's not possible to use tools like grep or to search for how
a function pointer is used.
I removed a couple calls to:
LASSERT(CFS_HOP(hs, put_locked) != NULL);
because they isn't a need for them. Anyway dereferencing a NULL pointer
generates a pretty good stack trace already without adding extra debug
code.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Recent changes to use the builtin min functions [1] introduced
type checking which wasn't present before. This resulted in
"comparision of distinct pointer types lacks a cast" build
warnings on non X86 architectures [2,3].
The call to min() which resulted in this warning took the result
of kiblnd_rd_frag_size(), which returned a __u32, and the
variable 'resid', which is an int. 'resid' is inside a while
loop which is only entered if it is positive. Casting it as a
__u32 can be perormed without a loss of data or change in
functionality.
Tristan Lelong [Sun, 18 Jan 2015 07:44:49 +0000 (23:44 -0800)]
staging: lustre: remove kmalloc from fld_proc_hash_seq_write
This patch simplifies the fld_proc_hash_seq_write function
by removing the dynamic memory allocation.
The longest fh_name used so far in lustre is 4 characters.
We use a 8 bytes variable to be on the safe side.
staging: comedi: vmk80xx: tidy up vmk80xx_cnt_insn_config()
Tidy up this (*insn_config) function to follow the normal format in
comedi drivers.
INSN_CONFIG_RESET instructions do not have any extra parameters (insn->n is
always 1) so the for loop used to write the packet doesn't make any sense.
Remove it and just write the single packet.
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: vmk80xx: GPCT_RESET is not an (*insn_config) instruction
The data[0] parameter to (*insn_config) functions is the "configuration instruction"
that should be handled. These are defined by the enum configuration_ids in comedi.h.
This driver is currently checking the data[0] value to be INSN_CONFIG_RESET or
GPCT_RESET in order to reset a counter channel. GPCT_RESET is defined as 0x0001
which would match the configuration instruction INSN_CONFIG_DIO_OUTPUT. That doesn't
make any sense for a counter.
Remove GPCT_RESET from the insn_cmd test.
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>