openwrt/staging/blogic.git
10 years agostaging: r8192ee: fix coccinelle warnings
Fengguang Wu [Thu, 19 Jun 2014 22:26:29 +0000 (15:26 -0700)]
staging: r8192ee: fix coccinelle warnings

drivers/staging/rtl8192ee/btcoexist/halbtc8821a2ant.c:2491:3-4: Unneeded semicolon

 Removes unneeded semicolon.

Generated by: /kbuild/src/linux/scripts/coccinelle/misc/semicolon.cocci

CC: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: octeon: minor style cleanups
Nicolas Koch [Tue, 3 Jun 2014 19:56:31 +0000 (21:56 +0200)]
Staging: octeon: minor style cleanups

Done as task 10 of the eudyptula challenge.

Signed-off-by: Nicolas Koch <nioko1337@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: octeon-ethernet: Move PHY activation to .ndo_open().
David Daney [Thu, 29 May 2014 10:10:02 +0000 (11:10 +0100)]
staging: octeon-ethernet: Move PHY activation to .ndo_open().

This prevents PHY not found types of errors for PHY drivers that are
probed after the Ethernet driver is probed, because the ifconfig UP is
done from userspace after all drivers have been probed.

Also avoid the cvmx-helper-board.c PHY code if a real PHY driver is
present, this allows a bootloader supplied device tree to specify the
PHY information rather than having to modify the code for each
different board.

Tested-by: Alex Smith <alex.smith@imgtec.com>
Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: unwind on error in dgap_init_one()
Daeseok Youn [Fri, 13 Jun 2014 09:23:15 +0000 (18:23 +0900)]
staging: dgap: unwind on error in dgap_init_one()

The dgap_init_one() needs to handle error properly
if one of functions in dgap_init_one() is failed.

Introduce some functions for handling error in dgap_init_one()
 - dgap_tty_unregister() : unregister tty driver
 - dgap_free_flipbuf() : free flip buffer
 - dgap_release_remap() : release memory region and unmapped memory.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: move unrelated functions in dgap_firmware_load()
Daeseok Youn [Fri, 13 Jun 2014 09:22:40 +0000 (18:22 +0900)]
staging: dgap: move unrelated functions in dgap_firmware_load()

The dgap_firmware_load() has a lot of stuff which are
unrelated with loading firmware.
So just moved to dgap_init_one().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: rename dgap_after_config_loaded() to dgap_alloc_flipbuf()
Daeseok Youn [Fri, 13 Jun 2014 09:22:05 +0000 (18:22 +0900)]
staging: dgap: rename dgap_after_config_loaded() to dgap_alloc_flipbuf()

dgap_after_config_loaded() as function name doesn't tell
what it does.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: introduce dgap_free_irq()
Daeseok Youn [Fri, 13 Jun 2014 09:21:04 +0000 (18:21 +0900)]
staging: dgap: introduce dgap_free_irq()

dgap_free_irq() will free the irq which is requested in
dgap_request_irq().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: introduce dgap_tty_free() for freeing channels.
Daeseok Youn [Fri, 13 Jun 2014 09:19:55 +0000 (18:19 +0900)]
staging: dgap: introduce dgap_tty_free() for freeing channels.

It should be called after dgap_tty_register_ports() is failed.
So channels which are allocated in dgap_tty_init() will be freed.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: get rid of brd->firstminor because it is 0
Daeseok Youn [Fri, 13 Jun 2014 09:19:03 +0000 (18:19 +0900)]
staging: dgap: get rid of brd->firstminor because it is 0

firstminor in struct borad_t is always zero, so it
can be removed.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: remove unused paramter in dgap_parsefile()
Daeseok Youn [Fri, 13 Jun 2014 09:18:04 +0000 (18:18 +0900)]
staging: dgap: remove unused paramter in dgap_parsefile()

"remove" parameter is not used in dgap_parsefile().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: rename dgap_tty_uninit() to dgap_cleanup_tty()
Daeseok Youn [Tue, 3 Jun 2014 06:28:42 +0000 (15:28 +0900)]
staging: dgap: rename dgap_tty_uninit() to dgap_cleanup_tty()

- dgap_tty_uninit() doesn't match dgap_tty_init() at all.
so rename it. It is just used for cleanup when this module is
exited or failed to initialize by dgap_init_module.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: rename dgap_finalize_board_init() to dgap_request_irq()
Daeseok Youn [Tue, 3 Jun 2014 06:28:08 +0000 (15:28 +0900)]
staging: dgap: rename dgap_finalize_board_init() to dgap_request_irq()

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: pass "brd" as a paramter to dgap_after_config_loaded()
Daeseok Youn [Tue, 3 Jun 2014 08:01:31 +0000 (17:01 +0900)]
staging: dgap: pass "brd" as a paramter to dgap_after_config_loaded()

Pass "brd" to dgap_after_config_loaded() instead of passing
"dgap_numboards" and looking up brd again.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: pass "dgap_numboards" as a paramter to dgap_found_board()
Daeseok Youn [Tue, 3 Jun 2014 06:26:53 +0000 (15:26 +0900)]
staging: dgap: pass "dgap_numboards" as a paramter to dgap_found_board()

- Pass "dgap_numboards" to dgap_found_board() instead of
using a global variable.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: make dgap_config_buf a local buffer
Daeseok Youn [Mon, 2 Jun 2014 05:09:04 +0000 (14:09 +0900)]
staging: dgap: make dgap_config_buf a local buffer

The dgap_config_buf is only used in dgap_firmware_load().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: unwind on error in dgap_tty_register_ports()
Daeseok Youn [Mon, 2 Jun 2014 05:08:24 +0000 (14:08 +0900)]
staging: dgap: unwind on error in dgap_tty_register_ports()

- The dgap_tty_register_ports() needs to handle if the
tty_port_register_device() fails.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: unwind on error in dgap_tty_init()
Daeseok Youn [Mon, 2 Jun 2014 05:07:46 +0000 (14:07 +0900)]
staging: dgap: unwind on error in dgap_tty_init()

If the kzalloc() fails for channels, it need to handle
that error. It should free channels which were already
allocated.

And also removes the call to dgap_tty_uninit() in
dgap_firmware_load().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: remove bogus null test in dgap_tty_init()
Daeseok Youn [Mon, 2 Jun 2014 05:06:53 +0000 (14:06 +0900)]
staging: dgap: remove bogus null test in dgap_tty_init()

- The channels array were set to NULL in dgap_found_board().
- Removes redundant null check for channels array in for loop,
if one of the channel cannot be allocated, dgap_tty_init() just returns
an error.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: unwind on error in dgap_found_board()
Daeseok Youn [Thu, 29 May 2014 09:11:09 +0000 (18:11 +0900)]
staging: dgap: unwind on error in dgap_found_board()

Adds a label for "kfree(brd)". And also remove
a state value as BOARD_FAILED in brd when dgap_do_remap() is failed.
Because "brd" will free after failure.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: remove useless dgap_probe1() function
Daeseok Youn [Thu, 29 May 2014 09:10:27 +0000 (18:10 +0900)]
staging: dgap: remove useless dgap_probe1() function

The dgap_probe1() function is just calling dgap_found_board().
So it is removed and dgap_found_board() is called directly.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8192u: r8192U_core.c: Cleaning up unclear and confusing code
Rickard Strandqvist [Sun, 15 Jun 2014 15:14:06 +0000 (17:14 +0200)]
staging: rtl8192u: r8192U_core.c: Cleaning up unclear and confusing code

Removes confusing and unclear code.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rtl8192u: r8192U_core.c Converted a C99 comment to fix code-style error
Chaitanya Hazarey [Wed, 11 Jun 2014 17:26:44 +0000 (10:26 -0700)]
Staging: rtl8192u: r8192U_core.c Converted a C99 comment to fix code-style error

Converted a C99 comment to fix the following error:

ERROR: trailing statements should be on next line

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rtl8192u: r8192U_core.c Fixed open brace { placement
Chaitanya Hazarey [Wed, 11 Jun 2014 17:26:43 +0000 (10:26 -0700)]
Staging: rtl8192u: r8192U_core.c Fixed open brace { placement

Fixed open brace placement to address the following code-style errors:

ERROR: that open brace { should be on the previous line

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rtl8192u: r8192U_core.c Converted some C99 comments to fix code-style errors
Chaitanya Hazarey [Thu, 5 Jun 2014 20:25:58 +0000 (13:25 -0700)]
Staging: rtl8192u: r8192U_core.c Converted some C99 comments to fix code-style errors

Converted some C99 warnings to fix the following error:

ERROR: trailing statements should be on next line

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rtl8192u: r8192U_core.c Rearranged statements to fix code-style errors
Chaitanya Hazarey [Thu, 5 Jun 2014 20:25:57 +0000 (13:25 -0700)]
Staging: rtl8192u: r8192U_core.c Rearranged statements to fix code-style errors

Rearranged statements around if and switch statements to address the following error:

ERROR: trailing statements should be on next line

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rtl8192u: r8192U_core.c Added a space after ','
Chaitanya Hazarey [Thu, 5 Jun 2014 20:25:56 +0000 (13:25 -0700)]
Staging: rtl8192u: r8192U_core.c Added a space after ','

Added spaces after ',' to fix the following warning:

ERROR: space required after that ',' (ctx:VxV)

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rtl8192u: r8192U_wx.c Removed some more commented out dead code
Chaitanya Hazarey [Mon, 2 Jun 2014 16:11:45 +0000 (09:11 -0700)]
Staging: rtl8192u: r8192U_wx.c Removed some more commented out dead code

Removed dead code from the file.

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8192u: remove checks for CONFIG_IEEE80211_CRYPT_TKIP
Paul Bolle [Fri, 30 May 2014 12:52:18 +0000 (14:52 +0200)]
staging: rtl8192u: remove checks for CONFIG_IEEE80211_CRYPT_TKIP

Ever since rtl8192u was added as a staging driver in v2.6.33 it contained
checks for CONFIG_IEEE80211_CRYPT_TKIP. But the Kconfig symbol
IEEE80211_CRYPT_TKIP was renamed to LIB80211_CRYPT_TKIP in v2.6.29. So
these checks have always evaluated to false. And these checks were rather
odd to begin with, since rtl8192u comes with its own ieee80211 stack,
which has support for TKIP built in.

Now the safe and easy thing to do here would be to remove these checks
and the code they hide. But it turns out that with some minor cleanup
the code currently hidden behind these checks builds cleanly. And by
building it we allow the people actually running this code to test
whether it is any good.

That minor cleanup is needed because ieee80211_encrypt_fragment()
accesses struct sk_buff's data member as if it is a struct
ieee80211_hdr. It's not. See, in ieee80211_xmit() a struct
ieee80211_hdr_3addrqos is skb_put() into the sk_buff with which
ieee80211_encrypt_fragment() will be called. So switch from
ieee80211_hdr to ieee80211_hdr_3addrqos here.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rtl8192u: r8192U_wx.c Added a single space for code-style issue
Chaitanya Hazarey [Thu, 29 May 2014 20:45:20 +0000 (13:45 -0700)]
Staging: rtl8192u: r8192U_wx.c Added a single space for code-style issue

Added a space around '|' to address:

ERROR: need consistent spacing around '|' (ctx:VxW)

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rtl8192u: r8192U_wx.c Removed all C99 comments
Chaitanya Hazarey [Thu, 29 May 2014 20:45:19 +0000 (13:45 -0700)]
Staging: rtl8192u: r8192U_wx.c Removed all C99 comments

To address the error -

ERROR: do not use C99 // comments

Removed all C99 comments.

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rtl8192u: r8192U_wx.c removed commented dead code
Chaitanya Hazarey [Thu, 29 May 2014 20:45:18 +0000 (13:45 -0700)]
Staging: rtl8192u: r8192U_wx.c removed commented dead code

Removed dead code, commented out printks and DMESG.

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: board: kzm9d: Board staging support for emxx_udc
Magnus Damm [Fri, 6 Jun 2014 10:44:52 +0000 (19:44 +0900)]
staging: board: kzm9d: Board staging support for emxx_udc

Add staging board support for the KZM9D board and add
an emxx_udc platform device to allow in-tree continous
development of the driver on the KZM9D board.

When DT bindings are ready for the emxx_udc driver then
the platform device in the KZM9D staging board code can
easily be removed. Until then we use platform devices
to continously improve the driver and integration code.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: board: Initial board staging support
Magnus Damm [Fri, 6 Jun 2014 10:44:43 +0000 (19:44 +0900)]
staging: board: Initial board staging support

Add staging board base support to allow continuous upstream
in-tree development and integration of platform devices.

Helps developers integrate devices as platform devices for
device drivers that only provide platform device bindings.
This in turn allows for incremental development of both
hardware feature support and DT binding work in parallel.

Two separate pieces of board staging functionality is
provided to ease per-board staging board support:
 - The board_staging() macro allows easy per-board callbacks
 - The board_staging_dt_node_available() provides DT node checking

Tested on the KZM9D board with the emxx_udc staging driver.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: emxx_udc: Add TODO file
Magnus Damm [Fri, 6 Jun 2014 10:44:35 +0000 (19:44 +0900)]
staging: emxx_udc: Add TODO file

Add a TODO file for emxx_udc to show what is left to do.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: emxx_udc: I/O memory and IRQ resource support
Magnus Damm [Fri, 6 Jun 2014 10:44:26 +0000 (19:44 +0900)]
staging: emxx_udc: I/O memory and IRQ resource support

Adjust the emxx_udc driver to make use of the standard
driver model to pass I/O memory and IRQ as resources
instead of hard coding those things in the driver.

Needs more work - the VBUS signal is yet not handled.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: emxx_udc: Add Emma Mobile USB Gadget driver
Magnus Damm [Fri, 6 Jun 2014 10:44:17 +0000 (19:44 +0900)]
staging: emxx_udc: Add Emma Mobile USB Gadget driver

Add the emxx_udc driver to staging based on an old linux-2.6.35.7
android tree. The driver has been brushed up slightly to complile
but it is still in great need of cleanup.

At this point DT bindings are clearly lacking and I doubt that the
driver even can run with multiple instances (global variables, hurray!).

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoRevert "staging: tidspbridge: use safer test on the result of find_first_zero_bit"
Greg Kroah-Hartman [Thu, 19 Jun 2014 20:18:06 +0000 (13:18 -0700)]
Revert "staging: tidspbridge: use safer test on the result of find_first_zero_bit"

This reverts commit cc0be81f00472d782804293766ddd9d1c2b4ebd1, it was
incorrect.

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_stc.h: remove stc read/write callbacks from ni_private
H Hartley Sweeten [Thu, 19 Jun 2014 17:20:37 +0000 (10:20 -0700)]
staging: comedi: ni_stc.h: remove stc read/write callbacks from ni_private

The drivers that include ni_mio_common.c set the stc register read/write
callbacks to private functions that handle the read/write operations in
the correct manner for the hardware.

The ni_atmio and ni_mio_cs drivers use identical code to handle the
operations.

The ni_pcimio driver is a bit different due to the non-windowed setup
of the stc registers on the m series boards. For the other boards
supported by the ni_pcimio driver, the direct access of the first 8
STC registers is also disabled due to a difference on the 611x devices.

These differences can all be handled in the ni_stc_{read,write}[lw]()
helpers. Refactor the helpers and remove the callbacks from the private
data.

Also, move the helper functions the handle the mapping of the windowed
STC register offsets to M series register offset from ni_pcimio.c to
ni_mio_common.c.

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>
10 years agostaging: comedi: ni_stc.h: remove read/write callbacks from ni_private
H Hartley Sweeten [Thu, 19 Jun 2014 17:20:36 +0000 (10:20 -0700)]
staging: comedi: ni_stc.h: remove read/write callbacks from ni_private

The drivers that include ni_mio_common.c set the read/write callbacks
to private functions that handle the read/write operations in the
correct manner for the hardware. The ni_atmio and ni_mio_cs drivers
use ioport register access and the ni_pcimio driver uses memory mapped
register access. The memory mapped base address is stored in the 'mite'
pointer in the private data which is only allocated and initialized by
the ni_pcimio driver.

Detect the need for memory mapped register access by checking if the
'mite' pointer is set in the private data and remove the callbacks
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>
10 years agostaging: comedi: ni_mio_common.c: wrap the read/write operations
H Hartley Sweeten [Thu, 19 Jun 2014 17:20:35 +0000 (10:20 -0700)]
staging: comedi: ni_mio_common.c: wrap the read/write operations

The ni_atmio, ni_pcimio, and ni_mio_cs drivers all include this source
file to handle the common functionality of the drivers. Each of those
drivers set some function pointers in the private data to handle the
read/write operations to the normal registers.

Like done for the stc register operations, wrap these operations with
some helper functions to clarify the code a bit and make it easier to
read and maintain.

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>
10 years agostaging: comedi: ni_mio_common.c: wrap the stc_read/write operations
H Hartley Sweeten [Thu, 19 Jun 2014 17:20:34 +0000 (10:20 -0700)]
staging: comedi: ni_mio_common.c: wrap the stc_read/write operations

The ni_atmio, ni_pcimio, and ni_mio_cs drivers all include this source
file to handle the common functionality of the drivers. Each of those
drivers set some function pointers in the private data to handle the
read/write operations to the stc registers.

Wrap these operations with some helper functions to clarify the code
a bit and make it easier to read and maintain.

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>
10 years agostaging: comedi: ni_stc.h: cleanup ni_e_series_enable_second_irq()
H Hartley Sweeten [Thu, 19 Jun 2014 17:20:33 +0000 (10:20 -0700)]
staging: comedi: ni_stc.h: cleanup ni_e_series_enable_second_irq()

This function is used to enable/disable the second irq on NI e-series
boards. This irq used used to generate dma requests for the counters.

There are only 2 counters (NUM_GPCT) so the default case of the switch
can never occur.

Tidy up this function and remove the unreachable BUG().

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>
10 years agostaging: comedi: ni_stc.h: add a 'is_m_series' flag to private data
H Hartley Sweeten [Thu, 19 Jun 2014 17:20:32 +0000 (10:20 -0700)]
staging: comedi: ni_stc.h: add a 'is_m_series' flag to private data

The (board->reg_type & ni_reg_m_series_mask) test is commonly used
in ni_mio_common.c to detect if the driver is being used with a
National Instruments "M series" DAQ board. Simplify the code a bit
by adding an 'is_m_series' bit-field flag to 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>
10 years agostaging: rtl8723au: Eliminate last rtw_get_beacon_interval*() usage
Jes Sorensen [Thu, 19 Jun 2014 09:37:35 +0000 (11:37 +0200)]
staging: rtl8723au: Eliminate last rtw_get_beacon_interval*() usage

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: Remove last users of rtw_get_capability*() functions
Jes Sorensen [Thu, 19 Jun 2014 09:37:34 +0000 (11:37 +0200)]
staging: rtl8723au: Remove last users of rtw_get_capability*() functions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: rtw_get_bcn_info23a(): Use __func__ in debug prints
Jes Sorensen [Thu, 19 Jun 2014 09:37:33 +0000 (11:37 +0200)]
staging: rtl8723au: rtw_get_bcn_info23a(): Use __func__ in debug prints

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: rtw_get_bcn_info23a(): Use capability from wlan_bssid_ex
Jes Sorensen [Thu, 19 Jun 2014 09:37:32 +0000 (11:37 +0200)]
staging: rtl8723au: rtw_get_bcn_info23a(): Use capability from wlan_bssid_ex

This eliminates yet another user of rtw_get_capability23a_from_ie()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: issue_assocreq(): Use struct ieee80211_mgmt to build assoc_req...
Jes Sorensen [Thu, 19 Jun 2014 09:37:31 +0000 (11:37 +0200)]
staging: rtl8723au: issue_assocreq(): Use struct ieee80211_mgmt to build assoc_req frame

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: issue_assocrsp(): Use capability from struct wlan_bssid_ex
Jes Sorensen [Thu, 19 Jun 2014 09:37:30 +0000 (11:37 +0200)]
staging: rtl8723au: issue_assocrsp(): Use capability from struct wlan_bssid_ex

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: issue_probersp(): Do not copy the IEs in front of probe_resp...
Jes Sorensen [Thu, 19 Jun 2014 09:37:29 +0000 (11:37 +0200)]
staging: rtl8723au: issue_probersp(): Do not copy the IEs in front of probe_resp data

Another case where the driver was copying IEs in front of the
probe_resp data in the management frame, when running in AP mode. This
would result in badly corrupted frames hitting the wire - ouf ouf ouf!

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: issue_beacon23a(): Use struct ieee80211_mgmt to build beacon
Jes Sorensen [Thu, 19 Jun 2014 09:37:28 +0000 (11:37 +0200)]
staging: rtl8723au: issue_beacon23a(): Use struct ieee80211_mgmt to build beacon

Why on Earth we have two functions in the driver constructing beacon
frames is beyond me ... but one step at a time

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: issue_beacon23a(): Do not copy IEs in front of beacon data
Jes Sorensen [Thu, 19 Jun 2014 09:37:27 +0000 (11:37 +0200)]
staging: rtl8723au: issue_beacon23a(): Do not copy IEs in front of beacon data

Not sure how this happened, but one should never copy the IEs in front
of the beacon frame info. This could lead to some nasty corrupted
beacon frames hitting the wire if running AP mode - ouf!

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: ConstructBeacon(): Use struct ieee80211_mgmt to build beacon
Jes Sorensen [Thu, 19 Jun 2014 09:37:26 +0000 (11:37 +0200)]
staging: rtl8723au: ConstructBeacon(): Use struct ieee80211_mgmt to build beacon

This gets rid of a bunch of hard coded offsets and reduces the
dependency of the ugly rtw_get_*_from_ie() functions.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: is_same_network23a(): Use the capability info from wlan_bssid_ex
Jes Sorensen [Thu, 19 Jun 2014 09:37:25 +0000 (11:37 +0200)]
staging: rtl8723au: is_same_network23a(): Use the capability info from wlan_bssid_ex

We already have the capability info in struct wlan_bssid_ex, no point
in searching for it once again.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: Update bss beacon info in rtw_add_beacon()
Jes Sorensen [Thu, 19 Jun 2014 09:37:24 +0000 (11:37 +0200)]
staging: rtl8723au: Update bss beacon info in rtw_add_beacon()

Pull out the core info beacon_interval, capability, and tsf and update
cur_network.network with the info in rtw_add_beacon() instead of
relying on it being in ->IEs.

This will help later when getting rid of the beacon struct info from
->IEs and only carrying the actual IEs there.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: rtw_add_beacon(): Replace magic constant with appropriate struct...
Jes Sorensen [Thu, 19 Jun 2014 09:37:23 +0000 (11:37 +0200)]
staging: rtl8723au: rtw_add_beacon(): Replace magic constant with appropriate struct size

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: struct wlan_bssid_ex: Rename BeaconPeriod to beacon_interval
Jes Sorensen [Thu, 19 Jun 2014 09:37:22 +0000 (11:37 +0200)]
staging: rtl8723au: struct wlan_bssid_ex: Rename BeaconPeriod to beacon_interval

This is to be more consistent mapping the names in wlan_bssid_ex to
those in struct ieee80211_mgmt.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: rtw_cfg80211_inform_bss(): Use the capability info we already...
Jes Sorensen [Thu, 19 Jun 2014 09:37:21 +0000 (11:37 +0200)]
staging: rtl8723au: rtw_cfg80211_inform_bss(): Use the capability info we already saved

No point in pulling capability info out of the IE array when it's
already stored in struct wlan_bssid_ex

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: collect_bss_info(): Save capability in struct wlan_bssid_ex
Jes Sorensen [Thu, 19 Jun 2014 09:37:20 +0000 (11:37 +0200)]
staging: rtl8723au: collect_bss_info(): Save capability in struct wlan_bssid_ex

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: rtw_cfg80211_inform_bss(): Report the beacon interval already...
Jes Sorensen [Thu, 19 Jun 2014 09:37:19 +0000 (11:37 +0200)]
staging: rtl8723au: rtw_cfg80211_inform_bss(): Report the beacon interval already retrieved

Use the beacon interval we already retreived in collect_bss_info()
instead of pulling it out of the saved IE array again.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: Save timestamp for network in collect_bss_info() and report it...
Jes Sorensen [Thu, 19 Jun 2014 09:37:18 +0000 (11:37 +0200)]
staging: rtl8723au: Save timestamp for network in collect_bss_info() and report it to the stack

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: rtw_cfg80211_inform_bss(): Use cfg80211_inform_bss()
Jes Sorensen [Thu, 19 Jun 2014 09:37:17 +0000 (11:37 +0200)]
staging: rtl8723au: rtw_cfg80211_inform_bss(): Use cfg80211_inform_bss()

There is no point in creating a fake beacon frame to call
cfg80211_inform_bss_frame() when we can just call
cfg80211_inform_bss() with the parameters we were sticking into the
fake frame.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8723au: rtw_cfg80211_inform_bss(): timestamp isn't used
Jes Sorensen [Thu, 19 Jun 2014 09:37:16 +0000 (11:37 +0200)]
staging: rtl8723au: rtw_cfg80211_inform_bss(): timestamp isn't used

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge tag 'iio-for-3.17a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Thu, 19 Jun 2014 03:02:33 +0000 (20:02 -0700)]
Merge tag 'iio-for-3.17a' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First round of new drivers, cleanups and functionality for the 3.17 cycle.

New drivers
* t5403 barometric pressure sensor
* kxcjk1013 accelerometer (with a locking followup fix).
* ak09911 digital compass

Documentation
* ABI docs for proximity added (interface has been there a long time but
  somehow snuck through without being documented)
* Move iio-trig-sysfs documentation out of staging (got left behind when
  the driver moved some time ago).

Cleanups
 * drop the timestamp argument from iio_trigger_poll(_chained) as
   nothing has been done with it for some time.
 * ad799x kerneldoc for ad799x_chip brought up to date.
 * replace a number of reimplementations of the GENMASK macro and
   use the BIT macro to cleanup a few locations.
 * bring the iio_event_monitor example program up to date with new
   device types.
 * fix some incorrect function prototypes in iio_utils.h example code.
 * INDIO_RING_TRIGGERED to INDIO_BUFFER_TRIGGERED fix in docs. This
   got left behind after we renamed it a long time back.
 * fix error handling in the generic_buffer example program.
 * small tidy ups in the iio-trig-periodic-rtc driver.
 * Allow reseting iio-trig-periodic-rtc frequency to 0 (default) after
   it has changed.
 * Trivial tidy ups in coding style in iio_simply_dummy

10 years agostaging: lustre: lclient: lcommon_cl.c fixing coding style issues
Anil Belur [Wed, 18 Jun 2014 08:23:56 +0000 (18:23 +1000)]
staging: lustre: lclient: lcommon_cl.c fixing coding style issues

fixed: WARNING: suspect code indent for conditional statements (32, 32)

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: lclient: lcommon_cl.c fixing coding style issues
Anil Belur [Wed, 18 Jun 2014 08:23:55 +0000 (18:23 +1000)]
staging: lustre: lclient: lcommon_cl.c fixing coding style issues

fixed: WARNING: line over 80 characters, used a new variable 'size_index' to
store the offset. Replaced "unsigned long" with  "loff_t" type for
'cur_index'. Removed the parenthesis around the second part of the if statement following the '||' as its not required.

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: lclient: lcommon_cl.c fixing coding style issues
Anil Belur [Wed, 18 Jun 2014 08:23:54 +0000 (18:23 +1000)]
staging: lustre: lclient: lcommon_cl.c fixing coding style issues

fixed: ERROR: inline keyword should sit between storage class and type

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: lclient: lcommon_cl.c fixing coding style issues
Anil Belur [Wed, 18 Jun 2014 08:23:53 +0000 (18:23 +1000)]
staging: lustre: lclient: lcommon_cl.c fixing coding style issues

fixed:  ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: lclient: lcommon_cl.c fixing coding style issues
Anil Belur [Wed, 18 Jun 2014 08:23:52 +0000 (18:23 +1000)]
staging: lustre: lclient: lcommon_cl.c fixing coding style issues

fixed: WARNING: Missing a blank line after declarations

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: lclient: lcommon_misc.c fixing coding style issues
Anil Belur [Wed, 18 Jun 2014 08:23:51 +0000 (18:23 +1000)]
staging: lustre: lclient: lcommon_misc.c fixing coding style issues

fixed warning:
* WARNING: min() should probably be min_t(__u32, desc.ld_tgt_count,
LOV_MAX_STRIPE_COUNT)

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: lclient: glimpse.c fixing coding style issues
Anil Belur [Wed, 18 Jun 2014 08:23:50 +0000 (18:23 +1000)]
staging: lustre: lclient: glimpse.c fixing coding style issues

fixed "WARNING: labels should not be indented"

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: lclient: glimpse.c fixing coding style issues
Anil Belur [Wed, 18 Jun 2014 08:23:49 +0000 (18:23 +1000)]
staging: lustre: lclient: glimpse.c fixing coding style issues

Fixed "ERROR: need consistent spacing around '+' (ctx:WxV)"

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: Fix sparse warnings for undeclared symbols
Scott Weir [Mon, 16 Jun 2014 10:44:51 +0000 (20:44 +1000)]
staging: lustre: Fix sparse warnings for undeclared symbols

This patch fixes the sparse warnings in drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c:
sec_lproc.c:58:6: warning: symbol 'sec_flags2str' was not declared. Should it be static?

Signed-off-by: Scott Weir <sjw0410@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: remove memset(0) after LIBCFS_ALLOC
Vitaly Osipov [Sat, 14 Jun 2014 07:29:51 +0000 (17:29 +1000)]
staging: lustre: remove memset(0) after LIBCFS_ALLOC

Joe Perches mentioned on driverdev-devel that memset after LIBCFS_ALLOC
is not necessary as it is already done during LIBCFS_ALLOC_POST. This
commit removes these unnecessary memsets. Based on the results of running
a cocci patch along the lines of:

@@
expression E1, E2;
@@

LIBCFS_ALLOC (E1,E2);
...
- memset(E1,0,E2);

Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: removed spaces at the start of a line
Marc Fite [Thu, 12 Jun 2014 17:28:16 +0000 (19:28 +0200)]
staging: lustre: removed spaces at the start of a line

This is a patch in order to remove 2 lines with spaces at the start of the line.

Signed-off-by: Marc Fite <marc@fite.cat>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: fix sparse warnings for undeclared symbols
John Church [Mon, 2 Jun 2014 13:31:10 +0000 (14:31 +0100)]
staging: lustre: fix sparse warnings for undeclared symbols

This patch fixes the following sparse warnings for drivers/staging/lustre/lnet/lnet/router.c:

router.c:139:1: warning: symbol 'lnet_ni_notify_locked' was not declared. Should it be static?
router.c:277:1: warning: symbol 'lnet_add_route_to_rnet' was not declared. Should it be static?

Signed-off-by: John Church <sleeveroller@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agolustre/osc/osc_dev.c add a blank line after declarations
Honggang Li [Thu, 12 Jun 2014 07:13:39 +0000 (15:13 +0800)]
lustre/osc/osc_dev.c add a blank line after declarations

Signed-off-by: Honggang Li <enjoymindful@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agolustre/osc/osc_dev.c remove space between sizeof and open parenthesis
Honggang Li [Thu, 12 Jun 2014 07:13:38 +0000 (15:13 +0800)]
lustre/osc/osc_dev.c remove space between sizeof and open parenthesis

Signed-off-by: Honggang Li <enjoymindful@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: wlan-ng: cfg80211.c: Fix sparse warnings
Tair Rzayev [Sat, 31 May 2014 20:33:59 +0000 (23:33 +0300)]
staging: wlan-ng: cfg80211.c: Fix sparse warnings

Include necessary header files to avoid "should be static" sparse warning

Signed-off-by: Tair Rzayev <tair.rzayev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: tidspbridge: Fix whitespace for pointers in function headers
Jeff Oczek [Sat, 14 Jun 2014 13:21:17 +0000 (09:21 -0400)]
staging: tidspbridge: Fix whitespace for pointers in function headers

Change style in function headers from 'type * ptr' to 'type *ptr'

Signed-off-by: Jeff Oczek <jeffoczek@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: tidspbridge: Add parameter names to function ptrs in struct dbll_attrs
Jeff Oczek [Sat, 14 Jun 2014 13:21:16 +0000 (09:21 -0400)]
staging: tidspbridge: Add parameter names to function ptrs in struct dbll_attrs

Add more descriptive names to function pointers in definition of struct dbll_attrs

Signed-off-by: Jeff Oczek <jeffoczek@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/fwserial: (coding style) remove not needed return statements
Radek Dostal [Sat, 14 Jun 2014 14:13:09 +0000 (16:13 +0200)]
staging/fwserial: (coding style) remove not needed return statements

Style-only modifications to make checkpatch.pl -f a bit happier.
Fixes warning: "void function return statements are not generally useful"

Signed-off-by: Radek Dostal <rd@radekdostal.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/fwserial: (coding style) add blank line after every declaration
Radek Dostal [Sat, 14 Jun 2014 14:13:08 +0000 (16:13 +0200)]
staging/fwserial: (coding style) add blank line after every declaration

Style-only modifications to make checkpatch.pl -f a bit happier.
Fixes warning: "Missing a blank line after declarations"

Signed-off-by: Radek Dostal <rd@radekdostal.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: keucr: usb.c: add blank lines after declarations
Mathias Engan [Thu, 12 Jun 2014 18:58:12 +0000 (20:58 +0200)]
staging: keucr: usb.c: add blank lines after declarations

Add blank line after declarations in eucr_suspend and eucr_resume
as reported by checkpatch.

Signed-off-by: Mathias Engan <mathias.engan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: tidspbridge: use safer test on the result of find_first_zero_bit
Julia Lawall [Wed, 4 Jun 2014 09:07:54 +0000 (11:07 +0200)]
staging: tidspbridge: use safer test on the result of find_first_zero_bit

Find_first_zero_bit considers BITS_PER_LONG bits at a time, and thus may
return a larger number than the maximum position argument if that position
is not a multiple of BITS_PER_LONG.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2,e3;
statement S1,S2;
@@

e1 = find_first_zero_bit(e2,e3)
...
if (e1
- ==
+ >=
  e3)
S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: tidspbridge: pmgr: dspapi.c: Cleaning up uninitialized variable
Rickard Strandqvist [Tue, 3 Jun 2014 22:23:39 +0000 (00:23 +0200)]
staging: tidspbridge: pmgr: dspapi.c: Cleaning up uninitialized variable

There is a risk that the variables will be used without being initialized.
Has also improved error handling, after an email proposal from Dan Carpenter.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: style - use kmalloc_array(n, s, ...) instead of kmalloc(n*s, ...)
Wolfgang Ocker [Mon, 2 Jun 2014 20:48:06 +0000 (22:48 +0200)]
staging: comedi: style - use kmalloc_array(n, s, ...) instead of kmalloc(n*s, ...)

Fix a style issue reported by checkpatch.pl for the Eudyptula challenge

Signed-off-by: Wolfgang Ocker <weo@weo1.de>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: goldfish: fix coding style.
Hoang Tran [Mon, 16 Jun 2014 07:18:37 +0000 (15:18 +0800)]
staging: goldfish: fix coding style.

Using an else following a break or return can unnecessarily
indent code blocks.

This patch fixes coding style reported by checkpatch.pl, a part
of eudyptula challenge.

Signed-off-by: Hoang Tran <hoangtran.gwr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_stc.h: add read/write callbacks to struct ni_private
H Hartley Sweeten [Thu, 29 May 2014 17:56:32 +0000 (10:56 -0700)]
staging: comedi: ni_stc.h: add read/write callbacks to struct ni_private

The {read,write}[bwl] macros used to access the registers in the ni_atmio,
ni_mio_cs, and ni_pcimio drivers and the included ni_mio_common.c file all
rely on a local variable having a specific name. They also require some of
the ni_mio_common code to need a __maybe_unused tag on the devpriv local
variable.

Remove all the macros by converting them into private functions and storing
the callbacks in the private data.

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>
10 years agostaging: comedi: ni_stc.h: remove unused members from struct ni_private
H Hartley Sweeten [Thu, 29 May 2014 17:56:31 +0000 (10:56 -0700)]
staging: comedi: ni_stc.h: remove unused members from struct ni_private

Remove all the unsed members from the private data for the ni mio drivers.

The ao0p and ao1p members are only used in the ni_ao_reset() function and
the code is commented out. Remove them, and the commented out code, as well.

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>
10 years agostaging: comedi: ni_stc.h: remove NI_PRIVATE_COMMON macro
H Hartley Sweeten [Thu, 29 May 2014 17:56:30 +0000 (10:56 -0700)]
staging: comedi: ni_stc.h: remove NI_PRIVATE_COMMON macro

This macro is used to create the private data structure that is used by
the ni_atmio, ni_mio_cs, and ni_pcimio drivers. These drivers all include
the ni_mio_common.c source to provide most of the driver functionality.

The only driver specific information needed to convert the macro into a
proper struct definition is the MAX_N_CALDACS define. This define is used
to size a couple array members in the struct. The ni_atmio and ni_mio_cs
drivers both define MAX_N_CALDACS as 32. The ni_pcimio driver defines it
as (16+16+2). The ni_mio_common file only uses this define to sanity check
that the struct members are large enough for the number of channels in
the calibration subdevice.

Move the MAX_N_CALDACS define to ni_stc.h and set it to the largest number
of caldacs (34).

The ni_atmio and ni_mio_cs drivers also add one additional member to the
private data struct before using the NI_PRIVATE_COMMON macro.

For the ni_atmio driver, the struct pnp_dev pointer can be saved in the
comedi_device as the 'hw_dev'. The (*detach) of this driver can then use
to_pnp_dev() to get it back when detaching the pnp device.

In the ni_mio_cs driver, the struct pcmia_device pointer is not used so
it can simply be removed.

The NI_PRIVATE_COMMON macro can then be converted into a proper struct
definition.

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>
10 years agostaging: comedi: ke_counter: add ability to select counter clock source
H Hartley Sweeten [Thu, 29 May 2014 17:45:52 +0000 (10:45 -0700)]
staging: comedi: ke_counter: add ability to select counter clock source

Add an (*insn_config) to the counter subdevice to allow the user to select
the clock source for the counters using the INSN_CONFIG_SET_CLOCK_SRC
instruction. The current selection can be queried with the instruction
INSN_CONFIG_GET_CLOCK_SRC.

Also, handle the INSN_CONFIG_RESET instruction to reset all the counters.

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>
10 years agostaging: comedi: adl_pci9111: simplify A/D trigger selection code
H Hartley Sweeten [Thu, 29 May 2014 17:35:10 +0000 (10:35 -0700)]
staging: comedi: adl_pci9111: simplify A/D trigger selection code

The functions pci9111_trigger_source_set(), pci9111_pretrigger_set(),
and pci9111_autoscan_set() are all used to select the A/D trigger type.
They all do a read/mask/set/write of the A/D Trigger Mode Control register.

Simplify the code by removing these helper functions and combining all
the trigger bits so that a single write can be used to set the register.

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>
10 years agostaging: comedi: adl_pci9111: remove PCI9111_HR_DEVICE_ID define
H Hartley Sweeten [Thu, 29 May 2014 17:35:09 +0000 (10:35 -0700)]
staging: comedi: adl_pci9111: remove PCI9111_HR_DEVICE_ID define

This define is only used in the pci_device_id table and doesn't add
any additional clarity to the code. Remove the define and just open
code the value.

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>
10 years agostaging: comedi: adl_pci9111: remove PCI9111_DRIVER_NAME define
H Hartley Sweeten [Thu, 29 May 2014 17:35:08 +0000 (10:35 -0700)]
staging: comedi: adl_pci9111: remove PCI9111_DRIVER_NAME define

This define is only used in a comedi_error() message. The addition of
the driver name to the message is not necessary. Remove the define.

For aesthetics, convert the comedi_error() into a dev_dbg().

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>
10 years agostaging: comedi: pcl724: add support for Diamond Systems ONYX-MM-DIO module
H Hartley Sweeten [Thu, 29 May 2014 17:42:23 +0000 (10:42 -0700)]
staging: comedi: pcl724: add support for Diamond Systems ONYX-MM-DIO module

The Diamond Systems ONYX-MM-DIO board is a PC/104 module with two 8255
chips providing 48 digital I/O channels.

This board can be supported by the pcl724 driver.

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>
10 years agostaging: comedi: pcl730: add support for Diamond Systems IR104-PBF module
H Hartley Sweeten [Thu, 29 May 2014 17:42:22 +0000 (10:42 -0700)]
staging: comedi: pcl730: add support for Diamond Systems IR104-PBF module

The Diamond Systems IR104-PBF board is a PC/104 module with 20
optoisolated inputs and 20 relay outputs.

This board can be supported by the pcl730 driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregk@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: addi_common.h: remove ADDIDATA_* defines
H Hartley Sweeten [Thu, 29 May 2014 17:30:05 +0000 (10:30 -0700)]
staging: comedi: addi_common.h: remove ADDIDATA_* defines

These defines don't add any additional clarity to the addi_data drivers.
Just remove them.

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>
10 years agostaging: comedi: addi_common.h: remove {LO, HI}WORD macros
H Hartley Sweeten [Thu, 29 May 2014 17:30:04 +0000 (10:30 -0700)]
staging: comedi: addi_common.h: remove {LO, HI}WORD macros

These macros don't add any additional clarity to the addi_data drivers.
Just remove them.

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>
10 years agostaging: comedi: addi_common.h: remove ADDIDATA_{EN, DIS}ABLE defines
H Hartley Sweeten [Thu, 29 May 2014 17:30:03 +0000 (10:30 -0700)]
staging: comedi: addi_common.h: remove ADDIDATA_{EN, DIS}ABLE defines

These defines don't add any additional clarity to the addi_data drivers.
Just remove them.

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>