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>
`pci230_ao_mangle_datum()` converts comedi sample values for the AO
subdevice to hardware register values. The comedi sample value will be
an unsigned value in the range 0 to 4095 (assuming 12-bit resolution).
The hardware wants the value shifted so the m.s. bit of the sample in in
bit 15. If set to a bipolar range, it also expects a 2's complement
value, so the top bit of the sample value needs to be inverted in that
case.
Simplify the existing code by doing the 2's complement conversion after
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>
The `ai_bits`, `ao_bits`, and `min_hwver` members of `struct
pci230_board` are only set to small, non-negative values, so make them
`unsigned char`. The `have_dio` member is used as a boolean so change
it to a bitfield of type `bool`.
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:44 +0000 (12:03 +0100)]
staging: comedi: amplc_pci230: remove ao_chans member
The PCI230(+) has an AO subdevice with 2 channels, but the PCI260(+) has
none.
The `ao_chans` member of `struct pci230_board` indicates whether the
board has an AO subdevice and the number of AO channels. The
`ao_bits` member indicates the AO sample width in bits and will only be
non-zero for boards with an AO subdevice.
Use `ao_bits` to indicate whether the board has an AO subdevice. If it
has, assume the the number of AO channels is 2. Then the `ao_chans`
member becomes redundant and can be removed.
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:43 +0000 (12:03 +0100)]
staging: comedi: amplc_pci230: remove ai_chans member
All boards supported by the "amplc_pci230" driver have 16 AI channels,
so the `ai_chans` member of `struct pci230_board` is superfluous and can
be removed.
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_alloc_private()` is now only called from `pci230_auto_attach()`
to allocate private device storage and initialize various spin-lock
members therein. Absorb the body of `pci230_alloc_private()` into
`pci230_auto_attach()` itself.
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:41 +0000 (12:03 +0100)]
staging: comedi: amplc_pci230: no need to comedi_set_hw_dev() here
The comedi core module calls `comedi_set_hw_dev()` to associate the
hardware `struct device` with the `struct comedi_device` before it calls
the comedi driver's "auto_attach" hook `pci230_auto_attach()`. There is
no need for `pci230_auto_attach()` to call `comedi_set_hw_dev()` itself,
so remove the call.
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:39 +0000 (12:03 +0100)]
staging: comedi: amplc_pci230: set detach handler to comedi_pci_detach()
Since the comedi driver's "detach`" handler `pci230_detach()` now merely
calls `comedi_pci_detach()` with the same parameter, use
`comedi_pci_detach()` itself as the "detach" handler.
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:38 +0000 (12:03 +0100)]
staging: comedi: amplc_pci230: no need to manipulate PCI ref count
This driver no longer supports a "legacy" attach mechanism that searches
for a suitable PCI device and increments it's reference count, but since
the common "detach" handler `pci230_detach()` still has a left-over
`pci_dev_put()`, a matching `pci_dev_get()` is needed in the
"auto_attach" handler `pci230_auto_attach()`. There is no longer any
reason to "get" and "put" the PCI device, so those calls can be removed.
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 "amplc_pci230" driver currently retains the legacy attach mechanism
to allow devices to be attached manually via the `COMEDI_DEVCONFIG`
ioctl. The only real use for this is to pretend that a PCI230+ or
PCI260+ is a PCI230 or PCI260 for backwards compatibility, as they have
different number of bits of resolution on the AI subdevice. Since the
card would be automatically configured as a PCI230+ or PCI260+ at PCI
probe time anyway, hopefully any users who want it to appear as a PCI230
or PCI260 would have got tired of removing the automatically configured
device and configuring it manually by now and will have updated their
software to cope with the PCI230+ or PCI260+.
Get rid of the legacy attach mechanism by removing the Comedi driver
"attach" handler `pci230_attach()` and associated code. Also remove the
"wildcard" entry from the board table `pci230_boards[]` as it is no
longer needed. Don't bother initializing the `board_name`, `offset`,
and `num_names` members of `struct comedi_driver amplc_pci230_driver`
any longer as they are only needed when configuring the device manually.
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>
This patch completes two final matters of cleanup which are each too small
for their own patch. It corrects a couple of indentation issues and
removes a return statement at the end of a void function.
Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: hwdrv_apci1500: clean some whitespace style issues
Now that commented out code has been removed, else statements can move to
the same line as the close brace of the if statement. Also, a blank line
has been added between declarations and code where needed.
Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chase Southwood [Sun, 31 Aug 2014 19:44:23 +0000 (14:44 -0500)]
staging: comedi: usbdux: fix more sparse endianness warnings
Sparse shows a couple of warnings like:
drivers/staging/comedi/drivers/usbdux.c:889:20: warning: incorrect type in assignment (different base types)
drivers/staging/comedi/drivers/usbdux.c:889:20: expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/comedi/drivers/usbdux.c:889:20: got restricted __le16 [usertype] <noident>
This is the result of a couple of calls to cpu_to_le16() being assigned to
uint16_t typed variables. Switch the types of these variables/pointers to
__le16 accordingly.
Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Suggested-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Merge tag 'xtensa-20140830' of git://github.com/czankel/xtensa-linux
Pull Xtensa updates from Chris Zankel:
"Xtensa improvements for 3.17:
- support highmem on cores with aliasing data cache. Enable highmem
on kc705 by default
- simplify addition of new core variants (no need to modify Kconfig /
Makefiles)
- improve robustness of unaligned access handler and its interaction
with window overflow/underflow exception handlers
- deprecate atomic and spill registers syscalls
- clean up Kconfig: remove orphan MATH_EMULATION, sort 'select'
statements
- wire up renameat2 syscall.
Various fixes:
- fix address checks in dma_{alloc,free}_coherent (runtime BUG)
- fix access to THREAD_RA/THREAD_SP/THREAD_DS (debug build breakage)
- fix TLBTEMP_BASE_2 region handling in fast_second_level_miss
(runtime unrecoverable exception)
- fix a6 and a7 handling in fast_syscall_xtensa (runtime userspace
register clobbering)
- fix kernel/user jump out of fast_unaligned (potential runtime
unrecoverabl exception)
- replace termios IOCTL code definitions with constants (userspace
build breakage)"
* tag 'xtensa-20140830' of git://github.com/czankel/xtensa-linux: (25 commits)
xtensa: deprecate fast_xtensa and fast_spill_registers syscalls
xtensa: don't allow overflow/underflow on unaligned stack
xtensa: fix a6 and a7 handling in fast_syscall_xtensa
xtensa: allow single-stepping through unaligned load/store
xtensa: move invalid unaligned instruction handler closer to its users
xtensa: make fast_unaligned store restartable
xtensa: add double exception fixup handler for fast_unaligned
xtensa: fix kernel/user jump out of fast_unaligned
xtensa: configure kc705 for highmem
xtensa: support highmem in aliasing cache flushing code
xtensa: support aliasing cache in kmap
xtensa: support aliasing cache in k[un]map_atomic
xtensa: implement clear_user_highpage and copy_user_highpage
xtensa: fix TLBTEMP_BASE_2 region handling in fast_second_level_miss
xtensa: allow fixmap and kmap span more than one page table
xtensa: make fixmap region addressing grow with index
xtensa: fix access to THREAD_RA/THREAD_SP/THREAD_DS
xtensa: add renameat2 syscall
xtensa: fix address checks in dma_{alloc,free}_coherent
xtensa: replace IOCTL code definitions with constants
...
Guenter Roeck [Sun, 31 Aug 2014 18:14:26 +0000 (11:14 -0700)]
unicore32: Fix build error
unicore32 builds fail with
arch/unicore32/kernel/signal.c: In function ‘setup_frame’:
arch/unicore32/kernel/signal.c:257: error: ‘usig’ undeclared (first use in this function)
arch/unicore32/kernel/signal.c:279: error: ‘usig’ undeclared (first use in this function)
arch/unicore32/kernel/signal.c: In function ‘handle_signal’:
arch/unicore32/kernel/signal.c:306: warning: unused variable ‘tsk’
arch/unicore32/kernel/signal.c: In function ‘do_signal’:
arch/unicore32/kernel/signal.c:376: error: implicit declaration of function ‘get_signsl’
make[1]: *** [arch/unicore32/kernel/signal.o] Error 1
make: *** [arch/unicore32/kernel/signal.o] Error 2
Bisect points to commit 649671c90eaf ("unicore32: Use get_signal()
signal_setup_done()").
This code never even compiled. Reverting the patch does not work, since
previously used functions no longer exist, so try to fix it up. Compile
tested only.
Fixes: 649671c90eaf ("unicore32: Use get_signal() signal_setup_done()") Cc: Richard Weinberger <richard@nod.at> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King:
"Various assorted fixes:
- a couple of patches from Mark Rutland to resolve an errata with
Cortex-A15 CPUs.
- fix cpuidle for the CPU part ID changes in the last merge window
- add support for a relocation which ARM binutils is generating in
some circumstances"
* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
ARM: 8130/1: cpuidle/cpuidle-big_little: fix reading cpu id part number
ARM: 8129/1: errata: work around Cortex-A15 erratum 830321 using dummy strex
ARM: 8128/1: abort: don't clear the exclusive monitors
ARM: 8127/1: module: add support for R_ARM_TARGET1 relocations
Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC fixes from Olof Johansson:
"Here's the weekly batch of fixes from arm-soc.
The delta is a largeish negative delta, due to revert of SMP support
for Broadcom's STB SoC -- it was accidentally merged before some
issues had been addressed, so they will make a new attempt for 3.18.
I didn't see a need for a full revert of the whole platform due to
this, we're keeping the rest enabled.
The rest is mostly:
- a handful of DT fixes for i.MX (Hummingboard/Cubox-i in particular)
- some MTD/NAND fixes for OMAP
- minor DT fixes for shmobile
- warning fix for UP builds on vexpress/spc
There's also a couple of patches that wires up hwmod on TI's DRA7 SoC
so it can boot. Drivers and the rest had landed for 3.17, and it's
small and isolated so it made sense to pick up now even if it's not a
bugfix"
* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (23 commits)
vexpress/spc: fix a build warning on array bounds
ARM: DRA7: hwmod: Add dra74x and dra72x specific ocp interface lists
ARM: DRA7: Add support for soc_is_dra74x() and soc_is_dra72x() variants
MAINTAINERS: catch special Rockchip code locations
ARM: dts: microsom-ar8035: MDIO pad must be set open drain
ARM: dts: omap54xx-clocks: Fix the l3 and l4 clock rates
ARM: brcmstb: revert SMP support
ARM: OMAP2+: hwmod: Rearm wake-up interrupts for DT when MUSB is idled
ARM: dts: Enable UART wake-up events for beagleboard
ARM: dts: Remove twl6030 clk32g "regulator"
ARM: OMAP2+: omap_device: remove warning that clk alias already exists
ARM: OMAP: fix %d confusingly prefixed with 0x in format string
ARM: dts: DRA7: fix interrupt-cells for GPIO
mtd: nand: omap: Fix 1-bit Hamming code scheme, omap_calculate_ecc()
ARM: dts: omap3430-sdp: Revert to using software ECC for NAND
ARM: OMAP2+: GPMC: Support Software ECC scheme via DT
mtd: nand: omap: Revert to using software ECC by default
ARM: dts: hummingboard/cubox-i: change SPDIF output to be more descriptive
ARM: dts: hummingboard/cubox-i: add USB OC pinctrl configuration
ARM: shmobile: r8a7791: add missing 0x0100 for SDCKCR
...
Sudip Mukherjee [Sun, 31 Aug 2014 09:53:35 +0000 (15:23 +0530)]
staging: lustre: lnet: lib-ptl.c: sparsa warning: symbol not declared
fixed sparse warning of following symbol not declared:
warning: symbol 'lnet_ptl_cleanup' was not declared. Should it be static?
warning: symbol 'lnet_ptl_setup' was not declared. Should it be static?
navin patidar [Sun, 31 Aug 2014 08:38:25 +0000 (14:08 +0530)]
staging: rtl8188eu: Rework function writeOFDMPowerReg88E()
Rename CamelCase variables and function name.
Remove a block of the code which is executed only if RF type is T2R2 but
rtl8188eu's RF is a T1R1 type, so driver doesn't need that code.