Commit Graph

4809 Commits

Author SHA1 Message Date
Mike McCormack 16d74da0fd staging: rtl8192e: Delete dead and commented out code
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:56:59 -07:00
Tracey Dent 3742e3d794 Staging: rtl8187se: r8185b_init: fixed a lot of checkpatch.pl issues
Fixed numerous coding style issues using checkpatch.pl

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:49:32 -07:00
Tracey Dent de171bd6ff Staging: rtl8187se: r8180_wx: fixed a lot of checkptahc.pl issues
Fixed numerous coding style issues using checkpatch.pl

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:49:32 -07:00
Tracey Dent 7042b09ad5 Staging: rtl8187se: r8180_rtl8225: fixed a lot of checkpatch.pl issues
Fixed numerous coding style issues using checkpatch.pl

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:49:32 -07:00
Tracey Dent 33f6c688c9 Staging: rtl8187se: r8180_hw: fixed a lot of checkpatch.pl issues
Fixed numerous coding style issues using checkpatch.pl

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:49:31 -07:00
Tracey Dent 888b9de56b Staging: rtl8187se: r8180.h: fixed alot of checkpatch.pl issues
Fixed numerous coding style issues

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:49:31 -07:00
Victor Rosales a1b0925293 staging: winbond: mds.c: Fixed all checkpatch's errors
Just fixed all checkpatch's errors but not the warinings.

Signed-off-by: Victor Rosales <victorhrosales@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:48:17 -07:00
Pekka Enberg 0fe212f7e3 staging: w35und: Add locking problems to TODO list
The w35und uses atomics such as "ThreadCount" and "FireCount" to emulate
locking in the TX paths, for example. Document this bug in the TODO list.

Cc: Lars Lindley <lindley@coyote.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:46:04 -07:00
Pekka Enberg 11c9a55d08 staging: w35und: Inline MLMESendFrame() to wbsoft_tx()
The wbsoft_tx() function is a simple wrapper on top of MLMESendFrame() so
inline the latter to the former.

Cc: Lars Lindley <lindley@coyote.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:46:03 -07:00
Pekka Enberg 80a284bd15 staging: w35und: Use NETDEV_TX_BUSY if MLMESendFrame fails
This patch changes MLMESendFrame to return NETDEV_TX_BUSY if MLME frame is in
use so that wbsoft_tx() doesn't blindly return NETDEV_TX_OK in that case.

Cc: Sandro Bonazzola <sandro.bonazzola@gmail.com>
Cc: Lars Lindley <lindley@coyote.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:46:03 -07:00
Pekka Enberg ff80d13fc4 staging: w35und: Remove unused fields from struct wbsoft_priv
This patch removes unused fields from "struct wbsoft_priv".

Cc: Lars Lindley <lindley@coyote.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:44:56 -07:00
Pekka Enberg 89b32d45fe staging: w35und: Remove unused spinlocks
This patch removes unused spinlocks from "struct mlme_frame" and "struct
wbsoft_priv".

Cc: Lars Lindley <lindley@coyote.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:44:56 -07:00
Pekka Enberg 3c093865ae staging: w35und: Inline mlme_s.h to core.h
The mlme_s.h header is included in one place. As the header is very small, just
inline it to core.h.

Cc: Lars Lindley <lindley@coyote.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:44:56 -07:00
Pekka Enberg f2e497e3e9 staging: w35und: Remove dead code from mlme_s.h
There's bunch of macros in mlme_s.h that aren't used for anything. Kill them
off.

Cc: Lars Lindley <lindley@coyote.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:44:56 -07:00
Pekka Enberg b9f98a05ba staging: w35und: Kill unused scan_s.h header
The scan_s.h header is not actually used for anything so just kill it off.

Cc: Lars Lindley <lindley@coyote.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:44:55 -07:00
Pekka Enberg c4d562a99f staging: w35und: Remove remaining typedef declarations
This patch removes remaining typedef declarations from the w35und driver. Most
of them were unused so I just killed them off completely.

Cc: Lars Lindley <lindley@coyote.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:44:55 -07:00
Pekka Enberg 5fb108555b staging: w35und: Kill dead HAL macros in wbhal_f.h
Fixes an uninitialized variable access in _rx_iq_calibration_loop_winbond():

    CC [M]  drivers/staging/winbond/phy_calibration.o
  drivers/staging/winbond/phy_calibration.c: In function ‘_rx_iq_calibration_loop_winbond’:
  drivers/staging/winbond/phy_calibration.c:1138: warning: ‘val’ is used uninitialized in this function

Cc: Lars Lindley <lindley@coyote.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:44:55 -07:00
Jonathan Cameron 10ba8ea9bd staging: iio: sysfs abi documentation. Add _type and _index attrs
Also remove no unused precision attr.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:44 -07:00
Jonathan Cameron 3215e31cc3 staging: iio: remove deprecated form of scan_el attribute naming.
This has been replaced by a separate _index attribute

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:44 -07:00
Jonathan Cameron d16061bb67 staging: iio: sca3000 add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:43 -07:00
Jonathan Cameron 77b3d3facf staging: iio: max1363 add _index attribute registration
Also fixes a missing NULL to terminate one of the attribute arrays.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:43 -07:00
Jonathan Cameron 67dd265d44 staging: iio: adis16400 add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:43 -07:00
Jonathan Cameron de9b493efb staging: iio: adis16350 add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:43 -07:00
Jonathan Cameron 474437496a staging: iio: adis16300 add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:42 -07:00
Jonathan Cameron c045e44dfc staging: iio: adis16260 add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:42 -07:00
Jonathan Cameron 6d2174f438 staging: iio: adis16240 add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:42 -07:00
Jonathan Cameron 49624fa833 staging: iio: adis16209 add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:42 -07:00
Jonathan Cameron 13a091abb7 staging: iio: lis3l02dq add _index attribute registration
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:42 -07:00
Jonathan Cameron fc89b38db0 staging: iio: amend macros for SCAN_EL creation to add separate index attr
As Manuel Stahl observed, putting data into the naming of an attribute
(beyond what it is for) breaks the one value per attribute rule (in spirit
at least).  Hence we introduce a separate _index attribute for each scan
element to tell userspace the ordering in output from the buffer.

This will generate a lot of sparse warnings as all drivers will have unused
iio_const_attrs created.  The rest of the set will clean these up.

The final patch will remove the old indexing method. It is not here so
as to maintain one or other interface for all devices as this set
progresses.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:41 -07:00
Jonathan Cameron 44f270de71 staging: iio: Remove unused bit_count from struct iio_scan_el
The job this was intended to do (never implemented) is now done
by explicit definition of _type attributes in all drivers

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:41 -07:00
Jonathan Cameron 5df2145c8c staging: iio: adis16400 add _type attributes for all scan elements
The bit depth of 14 for the supply adc on the datasheet is highly
suspicious.  Confirmation requested from Analog.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:41 -07:00
Jonathan Cameron 3b401a96d5 staging: iio: adis16350 add _type attributes for all scan elements
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:41 -07:00
Jonathan Cameron 88b76d1da5 staging: iio: adis16300 add _type attributes for all scan elements
Note some of the in driver type specifications do not match the
data sheet.  I am assuming the datasheet is correct. This bug
would not have been apparent in the driver as these values were
unusued.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:40 -07:00
Jonathan Cameron 357f0209b4 staging: iio: adis16260 add _type attributes for all scan elements
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:40 -07:00
Jonathan Cameron ef26b83090 staging: iio: sca3000 add _type attributes for all scan elements
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:40 -07:00
Jonathan Cameron be3ebd1f16 staging: iio: adis16240 add _type attributes for all scan elements
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:40 -07:00
Jonathan Cameron 6a4429c85e staging: iio: adis16209 add _type attributes for all scan elements
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:40 -07:00
Jonathan Cameron 8d9c636b60 staging: iio: max1363 add _type attributes for all scan elements
As both signed and unsigned in attributes exist, each element must
be fully specified.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:39 -07:00
Jonathan Cameron 6a36e618b4 staging: iio: lis3l02dq add _type attributes for all scan elements
Also, adds a macro to make defining such attributes simple.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:34:39 -07:00
Henry Ptasinski cf2b448852 staging: brcm80211: add fullmac driver
This patch to the existing bcm80211 directory in the staging tree adds fullmac
driver support for the BCM4329 SDIO chip from Broadcom.  Configuration of the
mac80211 driver or the fullmac driver can be done through menuconfig.

Signed-off-by: Henry Ptasinski <henryp@broadcom.com>
Signed-off-by: Nohee Ko <noheek@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 10:29:31 -07:00
Markus Grabner c7fcf25525 Staging: line6: workaround for null pointer bug
Signed-off-by: Markus Grabner <grabner@icg.tugraz.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:04:35 -07:00
Vasiliy Kulikov 340362abb9 staging: spectra: off by one
g_pBlockTable has only DeviceInfo.wDataBlockNum elements.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:03:41 -07:00
Vasiliy Kulikov b1f5f54e91 staging: keucr: check kmalloc() return value
kmalloc() may fail, if so return error code.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:03:41 -07:00
Pavan Savoy 83ef41f085 staging: ti-st: mv headers to ti_wilink_st
move all the header information to ti_wilink_st.h.
This header would then not only serve the local modules like the st_core.c,
st_kim.c and st_ll.c but also the external modules/protocol drivers that are
dependent on the shared transport driver.
Modify the source files to include the new header ti_wilink_st.h,

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:02:54 -07:00
Pavan Savoy 5d702ea319 staging: ti-st: set right the data types
replace uint and family by a much more proper u8/u16 types.
This is required specifically for data members of structures coming
in from the chip and data members parsed from the binary firmware file.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:02:54 -07:00
Vipin Mehta 9b906a33e0 staging: ath6kl: Fixing a race condition during initialization
The commit fixes a race condition in the initialization portion of the
driver. The problem was observed while testing with the kernel in the
staging-next tree. The wait on the ready event is signalled prematurely
before setting the arVersion.wlan_ver and arVersion.abi_ver. The code
waiting on this semaphore checks for the validity of these values and
hence may proceed with an un-updated values of these fields. The wakeup
signal is now sent after these values are set.

Signed-off-by: Vipin Mehta <vmehta@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:02:02 -07:00
Vipin Mehta 103281df0b staging: ath6kl: Fixing a compile error
The commit fixes a compilation error that was encountered while using
a specific kernel configuration file. The problem was the use of some
functions defined in <linux/semaphore.h> without including the header
file explicitly. It was probably working before because of the
dependency getting implicitly satisfied via some other header file.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Vipin Mehta <vmehta@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:02:02 -07:00
Vipin Mehta 86fc4c897e staging: ath6kl: Removing duplicate includes
Eliminating the inclusion of the same header file more than once.
The files being removed are already included by osapi_linux.h.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Vipin Mehta <vmehta@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:02:01 -07:00
Maurice Dawson 8522e70b44 Staging: comedi: fix printk() coding style issue in adl_pci9111.c
This is a patch to the adl_pci9111.c file that fixes all, printk() should
include KERN-facility level, warnings found by the checkpatch.pl tool

Signed-off-by: Maurice Dawson <mauricedawson2699@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:01:24 -07:00
Charles Clément 4f10d883be Staging: vt6655: remove unused update_BssList definition
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 17:01:24 -07:00
Marek Lindner 037dafa867 Staging: batman-adv: Introduce update_primary_addr to update mac address
set_primary_if is currently misused to update the mac address in vis
packets. This unneeded and introduces overhead due to other operations
which must be done when updating the primary interface.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:51 -07:00
Sven Eckelmann 7e8158b341 Staging: batman-adv: Track references of batman_if in set_primary_if
set_primary_if exchanges the current primary interfaces with a new one.
This is a new reference and thus we have to count it and decrease the
count of the old primary interface.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:50 -07:00
Sven Eckelmann 399fb5b445 Staging: batman-adv: count batman_if list queries as reference
The return of get_batman_if_by_netdev and get_active_batman_if leaks a
pointer from the rcu protected list of interfaces. We must protect it to
prevent a too early release of the memory. Those functions must increase
the reference counter before rcu_read_unlock or it may be to late to
prevent a free.

hardif_add_interface must also increase the reference count for the
returned batman_if to make the behaviour consistent.

Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:50 -07:00
Sven Eckelmann 47f621dddc Staging: batman-adv: Use refcnt to track usage count of batman_if
get_batman_if_by_netdev and get_active_batman_if may leak data from the
rcu protected list of interfaces. The rcu protected list of all gateway
nodes leaks the actual data outside the read-side critical area. This is
not valid as we may free the data using a call_rcu created callback
after we unlock using rcu_read_unlock. A workaround is to provide a
reference count to be sure that the memory isn't freed to early.

It is currently only to implement the already existing functionality and
doesn't provide the full tracking of all usage cases.

Additionally, we must hardif_hold inside the
rcu_read_lock()..rcu_read_unlock() before we attach to the structure
which "leaks" it. When another function now removed it from its usage
context (primary_if, usage on stack, ...) then we must hardif_put it. If
it is decremented to zero then we can issue the call_rcu to the freeing
function. So "put" is not allowed inside an rcu_read_lock.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:50 -07:00
Sven Eckelmann 16f9530e99 Staging: batman-adv: Use synchronize_rcu instead of call_rcu
It is recommended [1] to use synchronize_rcu to simplify the code -
especially when otherwise extra locking is needed to protect other code
from picking stale elements. It also protects us for emitting to many
callbacks which may results in OOM conditions.

The only reason not to use it, would be in performance critical sections
or when we are not allowed to block.

[1] Documentation/RCU/checklist.txt

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:49 -07:00
Sven Eckelmann 952c699c06 Staging: batman-adv: Remove unneeded rcu_read_lock
Regions which do not use rcu functions don't need to protected by
rcu_read_lock. If we want to protect data from being freed than it must
be covered by the same read-side critical section or otherwise the grace
period may already ended and freed the memory before we called
rcu_read_lock again.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:49 -07:00
Sven Eckelmann 2250840111 Staging: batman-adv: Always protect list_for_each_entry_rcu with RCU
receive_bat_packet is not called with rcu_read_lock so we must ensure by
ourself that we protect list_for_each_entry_rcu using the correct RCU
locks.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:49 -07:00
Sven Eckelmann af2ac7bfec Staging: batman-adv: Introduce if_list_lock to protect if_list
The update critical sections of if_list must be protected by a locking
primitive other than RCU. The iterator must also be protected by the
chosen locking mechanism.

The rtnl_lock in hardif_remove_interfaces must also be moved outside the
iterator primitive to ensure that we don't deadlock the kernel due to
differently nested locks in hardif_remove_interfaces and hard_if_event.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:49 -07:00
Sven Eckelmann 67c3b70593 Staging: batman-adv: wait for call_rcu before unloading module
synchronize_rcu respective synchronize_net only waits for the rcu grace
period to elapse and we may fail to finish the calls which were made to
call_rcu in that time. In result the module could be unloaded during the
execution of the RCU callbacks.

rcu_barrier[1] will now wait for all outstanding RCU callbacks to finish
before continuing.

[1] Documentation/RCU/rcubarrier.txt

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:48 -07:00
Sven Eckelmann 2d77bb592f Staging: batman-adv: Mark debugfs files as nonseekable
We don't allow to seek in the debugfs socket and log files. Thus we
should mark the file descriptor as nonseekable.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:48 -07:00
Sven Eckelmann 93b3d9d578 Staging: batman-adv: Move mailing list address to .org
The official mailing list is run on lists.open-mesh.org and it should be
avoided to sent them to lists.open-mesh.net to reduce the number of
receipents and double posts.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:48 -07:00
Sven Eckelmann 1612ae996e Staging: batman-adv: checkpatch cleanup of comments
checkpatch now detects the start of a comment and warns about usage of
multiple spaces at the beginning of a line. We have to replace the '   '
in multiple lines comments by ' * ' to fix it.

Checkpatch also wants a comment after a definition of a spinlock_t which
describes what it protects. It is currently not possible to add it
before the actual struct which includes the spinlock.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:47 -07:00
Haiyang Zhang 430a8e9a33 staging: hv: Remove camel cases of vmbus packet buffer structures
Remove camel cases of vmbus packet buffer structures
 Remove camel cases of:
 struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER
 struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:22:40 -07:00
Andy Shevchenko 369ae8be42 staging: octeon: '&pointer[0]' to 'pointer' fix
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:10:57 -07:00
Andy Shevchenko a3cf4b42ce staging: rt2870: '&pointer[0]' to 'pointer' fix
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:10:56 -07:00
Andy Shevchenko e7cde7b312 staging: vt6655: '&pointer[0]' to 'pointer' fix
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:10:56 -07:00
Andy Shevchenko 97d2354518 staging: ath6kl: '&pointer[0]' to 'pointer' fix
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:10:56 -07:00
Andy Shevchenko b01d467ddd staging: cxt1e1: '&pointer[0]' to 'pointer' fix
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:10:56 -07:00
Andy Shevchenko cfd1015a7a staging: otus: '&pointer[0]' to 'pointer' fix
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:10:56 -07:00
Andy Shevchenko a5ed57a3ec staging: rtl8712: '&pointer[0]' to 'pointer' fix
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:10:56 -07:00
Andy Shevchenko db5c53d15b staging: wlags49_h2: '&pointer[0]' to 'pointer' fix
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:10:55 -07:00
Andy Shevchenko 1c919d90e1 staging: rt2860: '&pointer[0]' to 'pointer' fix
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:10:55 -07:00
Joe Perches 03a6cddbb8 staging: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 13:02:37 -07:00
Charles Clément a09eae8550 Staging: vt665x: remove unused DEF definition
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 13:02:36 -07:00
Pavan Savoy dfb7ef7d84 staging: ti-st: fix kim platform device id
Platform devices tend to have id as -1 when only 1 device exist and
a value >=0 when multiple devices exist, since we plan to store all
these platform devices if multiple exist, there was a requirement to
have id to be >=0.
The patch fixes this problem.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:54:45 -07:00
Andy Shevchenko 48c51a8cf4 staging: brcm80211: use string native library
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:51:56 -07:00
Andy Shevchenko 3fb4e3d1ff staging: brcm80211: use native ctype library
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:51:56 -07:00
Agustin March a7b47b9bb2 staging: usbip: resolved a space in a comment
Removed a space in a comments lines at #459

Signed-off-by: Agustin March <agustin.march@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:36 -07:00
Joe Perches 3760c621fd staging: msm: Remove pr_<level> uses of KERN_<level>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:36 -07:00
Al Cho a871869245 staging: keucr: fix keucr lost disconnect
keucr lost the disconnect,
so keucr crash when plug-in and then plug-out SD-card quickly.

unmark the part of usb disconnect

Signed-off-by: Al Cho <acho@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:35 -07:00
Clelia V. Korol b411f12174 staging: vt6656: Fixed indentation with spaces
Fixed the last 5 lines, indented with spaces, replacing spaces with tabs.

Signed-off-by: Clelia V. Korol <cvkorol@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:35 -07:00
Ema Cuevas c3aca01be6 staging: vt6656: removed dummy errors like extra spaces
As reported by checkpatch.

Signed-off-by: Ema Cuevas <emacupk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:35 -07:00
matias cd74ea33e3 staging: vt6656: delete some parenthesis
I remove parenthesis for a return variable, and also delete a space and tab the code line

Signed-off-by: matias <munozmatiasn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:35 -07:00
Emanuel Mariano Ravera 357bcdfb45 staging: vt6656: Space Added after definition of Variable MSG_LEVEL_INFO
Added an space after the definition of the variable MSG_LEVEL_INFO on line 43

Signed-off-by: Emanuel Mariano Ravera <ravera.emanuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:35 -07:00
Diego H. Iglesias b168ae4d4b staging: vt6656: removed not required parentheses.
Removed not required parentheses in return statements.

Signed-off-by: Diego H. Iglesias <diegohi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:34 -07:00
Vasiliy Kulikov 2503a26554 staging: comedi: fix signess bug
ai_count and ao_counter are unsigned, check for < 0 doesn't make sense.
Cast them to int.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:34 -07:00
Vasiliy Kulikov cae16a1742 staging: crystalhd: fix signed bug
chd_dec_major is unsigned, so check chd_dec_major < 0 doesn't make sense.
Since it is used as signed, declare it as int.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:34 -07:00
Vasiliy Kulikov 3850a8ae43 staging: solo6010: fix signess bug
video_nr is unsigned, so check video_nr >= 0 doesn't make sense.
The only "negative" value may be -1, so explicitly check for it.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:37:33 -07:00
Randy Dunlap 2427924cb0 staging: ST_BT depends on RFKILL
Fix kconfig unmet dependency warning:

warning: (ST_BT && STAGING && !STAGING_EXCLUDE_BUILD && BT) selects TI_ST which has unmet direct dependencies (RFKILL)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:29:32 -07:00
Randy Dunlap 5fe1f1edb9 staging/bcm: fix build for CONFIG_PM not enabled
Handle build case of CONFIG_PM not being enabled.

drivers/staging/bcm/InterfaceInit.c:280: error: 'struct usb_device' has no member named 'autosuspend_delay'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:29:32 -07:00
Randy Dunlap 3e8acee461 staging/bcm: fix printk format warnings
Fix lots of printk format warnings in bcm.  Here is a sample of them:

drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int'
drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 4 has type 'long int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 3 has type 'long int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 4 has type 'long int'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:29:32 -07:00
Randy Dunlap e23f773ee4 staging/keucr: fix build when CONFIG_PM is not enabled
keucr driver has a build error when CONFIG_PM is not enabled, so fix that.

drivers/staging/keucr/usb.c:42: error: 'struct us_data' has no member named 'suspend_resume_hook'
drivers/staging/keucr/usb.c:43: error: 'struct us_data' has no member named 'suspend_resume_hook'
drivers/staging/keucr/usb.c:64: error: 'struct us_data' has no member named 'suspend_resume_hook'
drivers/staging/keucr/usb.c:65: error: 'struct us_data' has no member named 'suspend_resume_hook'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Al Cho <acho@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:29:31 -07:00
Randy Dunlap 7311530035 staging/keucr: update TODO list and ask question about it
Update keucr TODO with additional work items.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Al Cho <acho@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:29:31 -07:00
Andy Shevchenko fa1ae16c97 staging: ath6kl: use '%pM' format to print MAC address
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:26:13 -07:00
Andy Shevchenko d225eef71c staging: octeon: use '%pM' format to print MAC address
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:26:13 -07:00
Andy Shevchenko 28dc55bc9a staging: otus: use '%pM' format to print MAC address
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:26:12 -07:00
Andy Shevchenko ada543b76a staging: rt2870: use '%pM' format to print MAC address
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:26:12 -07:00
Andy Shevchenko 0ce53f3d15 staging: rtl8712: use '%pM' format to print MAC address
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:26:11 -07:00
Andy Shevchenko ff5cb20b7b staging: cxt1e1: use '%pMF' format to print MAC address
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:26:11 -07:00
Andy Shevchenko 3c02dc22a2 staging: vt6655: use '%pM' format to print MAC address
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:26:11 -07:00