Ian Abbott [Wed, 3 Sep 2014 12:45:45 +0000 (13:45 +0100)]
staging: comedi: add CMDF_ROUND_... as synonyms for TRIG_ROUND_...
The `TRIG_ROUND_...` macros are some of the values that can be OR-ed
into the `flags` member of `struct comedi_cmd`. They may influence the
rounding of sample timings during operation of the asynchronous command.
The names are a bit of a left-over from earlier times. It would be
better to use the names `CMDF_ROUND_...` to match various other command
flags.
Define `CMDF_ROUND_MASK`, `CMDF_ROUND_NEAREST`, `CMDF_ROUND_DOWN`,
`CMDF_ROUND_UP` and `CMDF_ROUND_UP_NEXT` with the same numeric values as
`TRIG_ROUND_MASK`, `TRIG_ROUND_NEAREST`, `TRIG_ROUND_DOWN`,
`TRIG_ROUND_UP` and `TRIG_ROUND_UP_NEXT`, and redefine the
`TRIG_ROUND_...` macros as synonyms of the `CMDF_ROUND_...` macros.
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 [Wed, 3 Sep 2014 12:45:43 +0000 (13:45 +0100)]
staging: comedi: add CMDF_BOGUS as synonym for TRIG_BOGUS
`TRIG_BOGUS` is one of the values that can be OR-ed into the `flags`
member of `struct comedi_cmd`. It causes the comedi core to go through
some of the motions of setting up an asynchronous command without
actually setting it up. If all goes well, it causes the command set-up
to fail with an `EAGAIN` error.
The name `TRIG_BOGUS` is a bit of a left-over from earlier times. A
better name would be `CMDF_BOGUS` to match various other command flags.
Define `CMDF_BOGUS` with the same numeric value as the old `TRIG_BOGUS`
and redefine `TRIG_BOGUS` as a synonym of it.
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 [Wed, 3 Sep 2014 12:45:32 +0000 (13:45 +0100)]
staging: comedi: adl_pci9118: use CMDF_WAKE_EOS
Replace use of `TRIG_WAKE_EOS` command flag with the new name
`CMDF_WAKE_EOS`. The numeric value is unchanged. Also change
diagnostic messages to use "CMDF_WAKE_EOS" instead of "TRIG_WAKE_EOS"
and change the Comedi driver description comment to use "CMDF_WAKE_EOS".
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 [Wed, 3 Sep 2014 12:45:29 +0000 (13:45 +0100)]
staging: comedi: add CMDF_WAKE_EOS as synonym for TRIG_WAKE_EOS
`TRIG_WAKE_EOS` is one of the values that can be OR-ed into the `flags`
member of `struct comedi_cmd`. It's intended action is tune the
asynchronous command to interrupt at the end of every "scan". The name
is a bit of a left-over from earlier times. A better name would be
`CMDF_WAKE_EOS` to match various other command flags.
Define `CMDF_WAKE_EOS` with the same numeric value as the old
`TRIG_WAKE_EOS` and redefine `TRIG_WAKE_EOS` as a synonym of it.
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 [Wed, 3 Sep 2014 12:45:27 +0000 (13:45 +0100)]
staging: comedi: ni_at_a2150: use CMDF_PRIORITY
Replace use of `TRIG_RT` command flag with the equivalent flag
`CMDF_PRIORITY`. The numeric value is unchanged. Also replace
"TRIG_RT" with "CMDF_PRIORITY" in the kernel messages.
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 [Wed, 3 Sep 2014 12:45:25 +0000 (13:45 +0100)]
staging: comedi: das16: use CMDF_PRIORITY
Replace use of `TRIG_RT` command flag with the equivalent flag
`CMDF_PRIORITY`. The numeric value is unchanged. Also replace
"TRIG_RT" with "CMDF_PRIORITY" in kernel log messages.
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>
Paul Bolle [Thu, 4 Sep 2014 10:44:53 +0000 (12:44 +0200)]
staging: emxx_udc: remove check for CONFIG_MACH_EMGR
There's a check for CONFIG_MACH_EMGR. But the Kconfig symbol MACH_EMGR
doesn't exist. Remove that check and the single #define it hides. Note
that this macro isn't used by this driver anyway.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Mark Einon [Wed, 3 Sep 2014 21:40:55 +0000 (22:40 +0100)]
staging: et131x: Remove spinlock fbr_lock
The spinlock fbr_lock is only used in a single call sequence staring
from et131x_poll. As this call is already locked by napi->poll_lock,
we can remove it.
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Mark Einon [Wed, 3 Sep 2014 21:40:54 +0000 (22:40 +0100)]
staging: et131x: Remove dead code in isr
Dan Carpenter reports:
The patch c2ebf58ba089: "staging: et131x: Implement NAPI support"
from Aug 21, 2014, leads to the following static checker warning:
drivers/staging/et131x/et131x.c:4004 et131x_isr()
warn: we tested 'status' before and it was 'true'
We don't actually need the dead code, as we're now using NAPI to
handle enabling interrupts - but we do need to enable interrupts if
NAPI is not scheduled - so enable interrupts if this is the case.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix coding style issue where the if statement unnecessarily uses curly
braces for one line statements and where the else conditional statement
should follow the closing curly brace '}'. Also, the open curly brace
'{' should be on the same line as the if statement.
Signed-off-by: An Ha <zero579911@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix coding style issue which requires a space before the open
curly brace '{', after the open parenthesis '(', after a comma, and
after the equal sign '=' in an assignment.
Also, remove unnecessary whitespace after open parenthesis '(' and
before a quoted newline.
Signed-off-by: An Ha <zero579911@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The comedi skeleton driver is one of the few "hybrid" drivers with
both legacy and PCI attach mechanisms. Instead of splitting this
driver, just remove it. There are many other comedi drivers that
provide better examples.
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, 1 Sep 2014 13:13:30 +0000 (14:13 +0100)]
staging: comedi: ni_at_a2150: range check board index
The "ni_at_a2150" driver determines the board type by calling
`a2150_probe()`. This reads a register and converts it to a board index
in the range 0 to 3. However, the board table array it indexes into
(`a2150_boards[]`) only has 2 entries. Return an error from the
Comedi driver "attach" handler `a2150_attach()` if the probed board
index is beyond the end of the array.
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>
Fix coding style issues:
* put braces in all if-else branches;
* limit the length of changed lines to 80 columns.
checkpatch.pl warning count reduces by 3.
staging: unisys: uislib: uislib.c: sparse warning of context imbalance
fixed sparse warning : context imbalance in 'pause_device'
unexpected unlock
this patch will generate warning from checkpatch for
lines over 80 character , but since those are user-visible strings
so it was not modified.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Tested-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: unisys: uislib: uisqueue.c: rewrite of do_locked_client_insert
1) removed unused variables
2) fixed sparse warning of context imbalance in 'do_locked_client_insert'
different lock contexts for basic block
3) removed the call to visor_signalqueue_empty() , this function is
checking whether a signal queue is empty, but the return value
of the function is not beeing used, so it is safe to remove.
staging/lustre: annotate lock/unlock in lov_stripe_lock / lov_stripe_unlock
Annotate the lock/unlock pair in lov_stripe_lock/lov_stripe_unlock to
avoid sparse warning about a context imbalance.
Part of the eudyptula challenge: http://eudyptula-challenge.org/
John L. Hammond [Fri, 5 Sep 2014 20:08:12 +0000 (15:08 -0500)]
staging/lustre/mdc: inline llog methods
In mdc_setup() and mdc_precleanup() call mdc_llog_init() and
mdc_llog_finish() directly rather than through the OBD method wrappers
obd_llog_init() and obd_llod_finish(). Simplify the prototypes of
mdc_llog_init() and mdc_llog_finish() according to their uses.
Signed-off-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John L. Hammond [Fri, 5 Sep 2014 20:08:10 +0000 (15:08 -0500)]
staging/lustre: remove obd_ost.h
Move the structures defined in lustre/include/obd_ost.h to the one
file that uses them (lustre/osc/osc_request.c). Remove the unused
function osc_update_enqueue(). Remove the then empty header
lustre/include/obd_ost.h.
Signed-off-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In osc_request.c there is no reason to handle any llog contexts since
they are never setup. Remove the functions unused function
osc_llog_init() and the obsolete function osc_llog_finish(). Remove
the llog cleanup code in osc_disconnect() and osc_precleanup().
Signed-off-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging/lustre: Different prototypes between the declaration and the definition
Align the prototype of lprocfs_wr_uint() in the declaration with the one used
in the definition.
The prototype is:
int lprocfs_wr_uint(struct file *file, const char __user *buffer,
unsigned long count, void *data)
In obdclass/lprocfs_status.c
But in lustre/include/lprocfs_status.h, the __user annotation is missing for
the attribute buffer.
The correct prototype is the first one (the definition) since:
- This function is eventually called by the write() function pointer of an
instance of struct file_operations
- In this function, buffer is a parameter of copy_from_user()
- Before the commit 73bb1da692d0dc3e93b9c9e29084d6a5dcbc37a6, the declaration
and the definition had the same prototype, but only the .c has been updated.
Correcting this will remove a sparse error and add sparse warnings.
This is a task of the Eudyptula challenge.
Fix the warning reported by sparse on drivers/staging/lustre/lnet/lnet/router_proc.c
warning: incorrect type in argument 4 (different address spaces)
The correction is to annotate all user buffer variable by __user
Nicolas Thery [Sat, 6 Sep 2014 05:18:47 +0000 (07:18 +0200)]
staging: rtl8188eu: include missing header
This patch fixes the following sparse warnings:
drivers/staging/rtl8188eu/hal/phy.c:46:5: warning: symbol
'phy_query_bb_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:56:6: warning: symbol
'phy_set_bb_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:129:5: warning: symbol
'phy_query_rf_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:140:6: warning: symbol
'phy_set_rf_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:228:6: warning: symbol
'phy_set_tx_power_level' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:324:6: warning: symbol
'phy_set_bw_mode' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:360:6: warning: symbol 'phy_sw_chnl'
was not declared. Should it be static?
Signed-off-by: Nicolas Thery <nthery@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lmv_internal.h:96: ERROR: space prohibited after that open parenthesis '('
lmv_internal.h:96: ERROR: space required before the open parenthesis '('
lmv_internal.h:147: WARNING: space prohibited between function name and open parenthesis '('
Signed-off-by: Juston Li <juston.h.li@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
`struct pci230_private` has two members to manage the enabled interrupt
sources. `int_en` is the interrupt sources we want to be enabled and
`ier` is a shadow of the write-only interrupt enable register. They
have the same value most of the time. They differ in the interrupt
handler (`pci230_interrupt()`) itself when it temporarily clears bits in
the interrupt enable register and the `ier` member in order to unlatch
them in hardware, but leaves the `int_en` member alone. They also
differ in `pci230_ai_stop()` and `pci230_ao_stop()` which clear bits in
the `int_en` member and wait for the interrupt handler to finish before
copying the value to the `ier` member and the interrupt enable register.
Simplify the handling a bit, by making the `ier` member take on the role
of the `int_en` member, and allowing the value to differ from the
interrupt enable register while the interrupt handler is running.
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>
Some counter channels may be required for AI commands and AO commands.
Depending on how the commands are set up, it may not be possible to run
both at the same time, so we keep some state and code to find out if the
required resources are busy or not.
The existing code is a bit unwieldy - the code for claiming resources
involves two `for` loops for example. Rewrite it to make it simpler.
The new code just has a bit-mask value for each shared resource (counter
channels), and an array indexed by resource "owners" (AI and AO
commands), so the code for claiming resources now just has a single loop
that checks that none of the other owners have claimed the wanted
resources.
Rename the functions involved, because the old names involving 'put' and
'get' suggested some sort of usage counting.
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, 1 Sep 2014 11:03:53 +0000 (12:03 +0100)]
staging: comedi: amplc_pci230: replace `state` member with bitfields
The `state` member of `struct pci230_private` is used with the atomic
bit-op functions and has a couple of bits defined, `AI_CMD_STARTED` and
`AO_CMD_STARTED`. Spin-locks are used to protect the clearing of these
bits and other stuff. No special protection is used for setting these
bits. Replace the `state` member with a couple of new, single-bit
bitfield members, `ai_cmd_started` and `ao_cmd_started` to save some
space.
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, 1 Sep 2014 11:03:51 +0000 (12:03 +0100)]
staging: comedi: amplc_pci230: use comedi_range_is_bipolar()
Use the inline `comedi_range_is_bipolar()` function from "comedidev.h"
to decide whether a range is bipolar or unipolar instead of using the
local static arrays `pci230_ai_bipolar[]` and `pci230_ao_bipolar[]`
which can then be removed.
Change the types of the `ai_bipolar` and `ao_bipolar` members of `struct
pci230_private` to `bool` to match the return value of
`comedi_range_is_bipolar()` and change them into single-bit bitfields to
save a bit of space. Also change the type and name of some local
variables in `pci230_ai_check_chanlist()` that hold the result of
`comedi_range_is_bipolar()`.
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, 1 Sep 2014 11:03:50 +0000 (12:03 +0100)]
staging: comedi: amplc_pci230: add `pci230_` prefix to functions
Most functions in "amplc_pci230" are named with the prefix `pci230_`,
apart from one or two that have the prefix `amplc_pci230_` and a few
odd-balls with no particular prefix. Rename the ones without a prefix
for consistency.
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>
`pci230_ai_read()` reads a sample from the ADC data register and
converts it to a comedi sample value. The AI sample may have 12 or 16
bits of resolution, depending on the board type, but 12-bit sample
values are in bits 15 to 4 of the register. The hardware value is
signed, 2's complement if set to a bipolar mode, or unsigned, straight
binary if set to a unipolar mode. To convert to a Comedi sample value
it may need shifting right by 4 bits, and the top bit of the sample
value may need to be toggled.
Simplify the existing code by doing the 2's complement to straight
binary conversion before the shift. That way, it is always bit 15 that
is inverted regardless of the resolution.
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>