Anton Vorontsov [Wed, 16 May 2012 12:43:19 +0000 (05:43 -0700)]
staging: android: persistent_ram: Prepare for modular builds
This is a transition patch to keep things bisectable, just moves
some routines under '#ifndef MODULE'. The code inside the #ifndef
will go away soon, but so far we must support pstore and ram_console.
So, we are about to use persistent_ram with pstore, with the ability
to compile persistent_ram routines as modules. Some parts of
persistent_ram uses memblock_reserve() routine, which is should be
only used built-in code, and thus it is not exported.
These persistent_ram bits are only used by Android's ram_console,
which is always built-in.
Without this patch, we won't able to compile persistent_ram as a
module:
staging: comedi: refactor adv_pci1710 driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written and
removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor adv_pci1_dio driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written and
removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor adl_pci9118 driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
While moving the struct boardtype, convert it to C99 initializers
to improve code readability. This results is a slight increase in
the total lines of code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor amplc_pci224 driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor amplc_pci230 driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor cb_pcidas64 driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor cb_pcidas driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor cb_pcidda driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor cb_pcidio driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor cb_pcimdas driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor cb_pcimdda driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor comedi_bond driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor comedi_parport driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor comedi_test driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor das16m1 driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Refactor some of the other functions to remove the remaining
forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor das6402 driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor dt2801 driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Refactor some of the other functions to remove the remaining
forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor dt2811 driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Refactor some of the other functions to remove the remaining
forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor gsc_hpdi driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor ii_pci20kc driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor ni_pcidio driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written
and removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor ni_at_a2150 driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor ni_at_ao driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor ni_atmio16d driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor ni_atmio driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive to the end of the source. This is more
typical of how other drivers are written and removes the need
for the forward declarations.
Convert the driver to use the module_comedi_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sage Ahn [Tue, 15 May 2012 04:20:36 +0000 (13:20 +0900)]
staging: gdm72xx: Add GCT GDM72xx WiMAX driver.
This patch provides the kernel driver for the GDM72xx WiMAX chips
developed by GCT Semiconductor, Inc., which enables mobile WiMAX
connection on the Linux host.
staging: comedi: refactor ni_pcimio driver and use module_comedi_pci_driver
Move the module_init/module_exit routines and the associated
struct comedi_drive and struct pci_driver to the end of the
source. This is more typical of how other drivers are written and
removes the need for the forward declarations.
Convert the driver to use the module_comedi_pci_driver() macro
which makes the code smaller and a bit simpler.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: Use module_comedi_pci_driver and standardize drivers
Convert the refactored comedi pci drivers to use the
module_comedi_pci_driver() macro which makes the code
smaller and a bit simpler.
In the process, rename some of the symbols in the driver
to standardize the comedi pci drivers.
Based on the driver {name}:
1) Rename the comedi_driver to {name}_driver.
2) Use a static string {name} for the comedi_driver.driver_name.
3) Rename the pci probe/remove functions to {name)_pci_probe/remove.
4) Rename the pci id_table to {name}_pci_table.
5) Add the static string {name} for the pci_driver.name.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: Add helper macro for comedi pci driver boilerplate
Introduce the module_comedi_pci_driver macro, and the
associated register/unregister functions, which is a
convenience macro for comedi pci driver modules similar
to module_platform_driver. It is intended to be used by
drivers where the init/exit section does nothing but
register/unregister the comedi driver and associated pci
driver. By using this macro it is possible to eliminate
a few lines of boilerplate code per comedi pci driver.
Add a check to make sure that the pci_driver->name is
set. Once all the comedi pci drivers have been fixed this
will be removed.
Also, when registering the pci driver check for failure
and unregister the comedi driver.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
When calling adis16350_spi_read_all and adis16400_spi_read_burst we pass the
device struct of embedded in the IIO device only to look up the IIO device from
the device struct again right away. This patch changes the code to pass the IIO
device directly.
When calling ade7758_spi_read_burst we pass the device struct of embedded in the
IIO device only to look up the IIO device from the device struct again right
away. This patch changes the code to pass the IIO device directly.
When calling adis16260_read_ring_data we pass the device struct of embedded in
the IIO device only to look up the IIO device from the device struct again right
away. This patch changes the code to pass the IIO device directly.
When calling __lis3l02dq_write_data_ready_config we pass the device struct of
embedded in the IIO device only to look up the IIO device from the device struct
again right away. This patch changes the code to pass the IIO device directly.
When calling adis16240_read_ring_data we pass the device struct of embedded in
the IIO device only to look up the IIO device from the device struct again right
away. This patch changes the code to pass the IIO device directly.
When calling adis16209_read_ring_data we pass the device struct of embedded in
the IIO device only to look up the IIO device from the device struct again right
away. This patch changes the code to pass the IIO device directly.
When calling adis16204_read_ring_data we pass the device struct of embedded in
the IIO device only to look up the IIO device from the device struct again right
away. This patch changes the code to pass the IIO device directly.
When calling adis16203_read_ring_data we pass the device struct of embedded in
the IIO device only to look up the IIO device from the device struct again right
away. This patch changes the code to pass the IIO device directly.
This patch adds a helper function for retriving a iio_dev struct from a device
struct. Currently we open-code this in two different ways. One is using
dev_get_drvdata on the device and the other is using container_of. The new
helper function uses the container_of solution as it creates slightly smaller
code and also will eventually free up the drvdata pointer for usage by invidual
drivers.
Larry Finger [Fri, 11 May 2012 16:33:43 +0000 (11:33 -0500)]
staging: r8712u: Remove needless test for NULL
In commit ee6aeff, a swatch warning was fixed by moving some code inside
an if block that is executed only when the pointer padapter is not NULL.
In fact, padapter can never be NULL and the corect fix should have been
the removal of the test of padapter.
Reported-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Magenheimer [Thu, 10 May 2012 19:06:21 +0000 (12:06 -0700)]
ramster: switch over to zsmalloc and crypto interface
RAMster does many zcache-like things. In order to avoid major
merge conflicts at 3.4, ramster used lzo1x directly for compression
and retained a local copy of xvmalloc, while zcache moved to the
new zsmalloc allocator and the crypto API.
This patch moves ramster forward to use zsmalloc and crypto.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: register sysfs device attributes with driver core
Currently the sysfs device attributes are created by the comedi
core after each comedi device is created. This can lead to a race
condition where userspace gets an add event before the files are
created.
Register the device attributes with the comedi class so that the
driver core handles creating them and we avoid the race.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Anton Vorontsov [Sat, 12 May 2012 00:17:54 +0000 (17:17 -0700)]
staging: android: persistent_ram: Make it possible to use memory outside of bootmem
This includes devices' memory (e.g. framebuffers or memory mapped
EEPROMs on a local bus), as well as the normal RAM that we don't use
for the main memory.
For the normal (but unused) ram we could use kmaps, but this assumes
highmem support, so we don't bother and just use the memory via
ioremap.
As a side effect, the following hack is possible: when used together
with pstore_ram (new ramoops) module, we can limit the normal RAM region
with mem= and then point ramoops to use the rest of the memory, e.g.
mem=128M ramoops.mem_address=0x8000000
Sure, we could just reserve the region with memblock_reserve() early in
the arch/ code, and then register a pstore_ram platform device pointing
to the reserved region. It's still a viable option if platform wants
to do so.
Also, we might want to use IO accessors in case of a real device,
but for now we don't bother (the old ramoops wasn't using it either, so
at least we don't make things worse).
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Factor out vmap logic out of persistent_ram_buffer_map(), this will
make the code a bit more understandable when we'll add support for
non-bootmem memory.
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The routine just creates a persistent ram zone at a specified address.
For persistent_ram_init_ringbuffer() we'd need to add a
'struct persistent_ram' to the global list, and associate it with a
device. We don't need all this complexity in pstore_ram, so we introduce
the simple function.
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Anton Vorontsov [Sat, 12 May 2012 00:17:17 +0000 (17:17 -0700)]
persistent_ram: Fix buffer size clamping during writes
This is a longstanding bug, almost unnoticeable when calling
persistent_ram_write() for small buffers.
But when called for large data buffers, the write routine behaves
incorrectly, as the size may never update: instead of clamping
the size to the maximum buffer size, buffer_size_add_clamp() returns
an error (which is never checked by the write routine, btw).
To fix this, we now use buffer_size_add() that actually clamps the
size to the max value.
Also remove buffer_size_add_clamp(), it is no longer needed.
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Acked-by: Colin Cross <ccross@android.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tim Bird [Thu, 10 May 2012 22:11:36 +0000 (15:11 -0700)]
staging: android: logger: Allocate logs dynamically at boot (v3)
This changes the log initialization to be dynamic, but still
at boot time. These changes are a predecessor to implementing
runtime allocation and freeing of logs, to make the Android logger
less hard-coded.
Change from a fixed set of static log structures, to allocation
at init time into a list. Return proper error numbers on log
allocation failure.
Cc: Brian Swetland <swetland@google.com> Signed-off-by: Tim Bird <tim.bird@am.sony.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Gortmaker [Thu, 10 May 2012 03:10:54 +0000 (23:10 -0400)]
staging: delete all duplicated endian crap from rtl8712 driver
This driver had headers like big_endian.h, little_endian.h, swab.h
and yet we can throw them all in the trash can and the thing
still builds on x86-64 and ppc, just by deleting the references
to the deleted files.
Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Paul Gortmaker [Thu, 10 May 2012 02:53:32 +0000 (22:53 -0400)]
staging: wean rtl8712 off of its ancient duplicate of ip.h
This driver should not be carrying around ancient copies of
headers like <linux/ip.h> for its own use. Mapping it onto
the mainline one uncovers no build issues.
Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Paul Gortmaker [Thu, 10 May 2012 02:42:45 +0000 (22:42 -0400)]
staging: wean rtl8712 off of its ancient duplicate of if_ether.h
This driver should not be carrying around ancient copies of
headers like <linux/if_ether.h> for its own use. Mapping it
onto the mainline one uncovers no build issues.
Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>