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>
Dan Carpenter [Thu, 10 May 2012 15:18:36 +0000 (18:18 +0300)]
Staging: ipack: returning a freed pointer
If ipack_device_register() returns an error, then we returned a freed
pointer. The caller doesn't use it, but it means we return success to
the user instead of returning an error code.
I kind of rewrote the error handling in this function as a cleanup.
Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: refactor dt282x driver to remove forward declarations
Move the struct comedi_driver and variables 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 dt3000 driver to remove forward declarations
Move the module_init/module_exit routines and the associated
struct comedi_driver and other variables to the end of the source.
This is more typical of how other drivers are written.
Also, refactor a couple of the pci helper functions used during the
attach. The removes the need for the forward declarations.
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 dyna_pci10xx driver to remove forward declarations
Move the struct comedi_driver and associated variables to the
end of the source. This is more typical of how other drivers are
written and removes the need for the forward declarations.
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 the icp_multi driver to remove forward declarations
Move the setup_channel_list function forward in the souce and the
struct comedi_driver and associated variables to the end of the
source. This is more typical of how other drivers are written and
removes the need for the forward declarations.
Remove the unnecessary comments for the attach/detach functions.
Change the initialization of struct boardtype to c99 syntax and
remove the comments.
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 jr3_pci driver to remove forward declarations
Move the struct comedi_driver and associated variables to the
end of the source. This is more typical of how other drivers are
written and removes the need for the forward declarations.
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 me4000 driver to remove forward declarations
Move the struct comedi_driver, attach/detach functions, and
associated variables to the end of the source. This is more
typical of how other drivers are written and removes the need
for most of the forward declarations.
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 me_daq driver to remove forward declarations
Move the module_init/module_exit routines and the associated
struct comedi_driver and other variables to the end of the source.
This is more typical of how other drivers are written and removes
the need for the forward declarations.
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 mpc624 driver and use module_comedi_driver
Move the struct comedi_driver and associated attach/detach
routines 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 mpc8260cpm driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_driver and other variables 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 multiq3 driver and use module_comedi_driver
Move the struct comedi_driver to the end of the source. 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: partial refactor of s626 driver to remove forward declarations
Move the module_init/module_exit routines and the associated
struct comedi_driver and other variables to the end of the source.
This is more typical of how other drivers are written and removes
the need for the forward declarations.
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 ssv_dnp driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated
struct comedi_driver and other variables 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 unioxx5 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: remove debug tracing in vmk80xx driver
The vmk80xx driver uses a non-existant Kconfig symbol to enable
function call debug tracing. This output is really just noise
and doesn't serve any useful purpose. Remove all it's uses in
the 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>
Minchan Kim [Thu, 3 May 2012 06:40:39 +0000 (15:40 +0900)]
staging: zsmalloc: rename zspage_order with zspage_pages
zspage_order defines how many pages are needed to make a zspage.
So _order_ is rather awkward naming. It already deceive Jonathan
- http://lwn.net/Articles/477067/
" For each size, the code calculates an optimum number of pages (up to 16)"
Let's change from _order_ to _pages_ and some function names.
Axel Lin [Thu, 3 May 2012 01:50:51 +0000 (09:50 +0800)]
IIO: industrialio-core: Use simple_open
Use simple_open to replace iio_debugfs_open.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
vme: vme_ca91cx42.c: local functions should not be exposed globally
Functions not referenced outside of a source file should be marked
static to prevent them from being exposed globally.
Quiets the sparse warnings:
warning: symbol 'ca91cx42_alloc_consistent' was not declared. Should it be static?
warning: symbol 'ca91cx42_free_consistent' was not declared. Should it be static?
vme: vme_tsi148.c: local functions should not be exposed globally
Functions not referenced outside of a source file should be marked
static to prevent them from being exposed globally.
Quiets the sparse warnings:
warning: symbol 'tsi148_alloc_consistent' was not declared. Should it be static?
warning: symbol 'tsi148_free_consistent' was not declared. Should it be static?
staging: comedi: Add helper macro for comedi_driver boilerplate
Introduce the module_comedi_driver macro which is a convenience
macro for comedi 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. By using
this macro it is possible to eliminate a few lines of boilerplate
code per 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>