GitHub/moto-9609/android_kernel_motorola_exynos9610.git
12 years agopstore/ram: Add console messages handling
Anton Vorontsov [Sat, 26 May 2012 13:20:23 +0000 (06:20 -0700)]
pstore/ram: Add console messages handling

The console log size is configurable via ramoops.console_size
module option, and the log itself is available via
<pstore-mount>/console-ramoops file.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Factor ramoops_get_next_prz() out of ramoops_pstore_read()
Anton Vorontsov [Sat, 26 May 2012 13:20:22 +0000 (06:20 -0700)]
pstore/ram: Factor ramoops_get_next_prz() out of ramoops_pstore_read()

This will help make code clearer when we'll add support for other
message types.

The patch also changes return value from -EINVAL to 0 in case of
end-of-records. The exact value doesn't matter for pstore (it should
be just <= 0), but 0 feels more correct.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Factor dmesg przs initialization out of probe()
Anton Vorontsov [Sat, 26 May 2012 13:20:21 +0000 (06:20 -0700)]
pstore/ram: Factor dmesg przs initialization out of probe()

This will help make code clearer when we'll add support for other
message types.

This also makes probe() much shorter and understandable, plus
makes mem/record size checking a bit easier.

Implementation detail: we now use a paddr pointer, this will
be used for allocating persistent ram zones for other message
types.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Give proper names to dump-related variables
Anton Vorontsov [Sat, 26 May 2012 13:20:20 +0000 (06:20 -0700)]
pstore/ram: Give proper names to dump-related variables

We're about to add support for other message types, so let's rename
some variables to not be confused later.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore: Add console log messages support
Anton Vorontsov [Sat, 26 May 2012 13:20:19 +0000 (06:20 -0700)]
pstore: Add console log messages support

Pstore doesn't support logging kernel messages in run-time, it only
dumps dmesg when kernel oopses/panics. This makes pstore useless for
debugging hangs caused by HW issues or improper use of HW (e.g.
weird device inserted -> driver tried to write a reserved bits ->
SoC hanged. In that case we don't get any messages in the pstore.

Therefore, let's add a runtime logging support: PSTORE_TYPE_CONSOLE.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoMerge branch 'staging-linus' into staging-next
Greg Kroah-Hartman [Wed, 13 Jun 2012 23:57:09 +0000 (16:57 -0700)]
Merge branch 'staging-linus' into staging-next

We need this for the pstore fixes that went into the staging-linus branch, so
that things apply properly for the pstore/android code merge.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/inode: Make pstore_fill_super() static
Anton Vorontsov [Sat, 26 May 2012 13:07:53 +0000 (06:07 -0700)]
pstore/inode: Make pstore_fill_super() static

There's no reason to extern it. The patch fixes the annoying sparse
warning:

CHECK   fs/pstore/inode.c
fs/pstore/inode.c:264:5: warning: symbol 'pstore_fill_super' was not
declared. Should it be static?

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Should zap persistent zone on unlink
Anton Vorontsov [Sat, 26 May 2012 13:07:52 +0000 (06:07 -0700)]
pstore/ram: Should zap persistent zone on unlink

Otherwise, unlinked file will reappear on the next boot.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram_core: Factor persistent_ram_zap() out of post_init()
Anton Vorontsov [Sat, 26 May 2012 13:07:51 +0000 (06:07 -0700)]
pstore/ram_core: Factor persistent_ram_zap() out of post_init()

A handy function that we will use outside of ram_core soon. But
so far just factor it out and start using it in post_init().

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram_core: Do not reset restored zone's position and size
Anton Vorontsov [Sat, 26 May 2012 13:07:50 +0000 (06:07 -0700)]
pstore/ram_core: Do not reset restored zone's position and size

Otherwise, the files will survive just one reboot, and on a subsequent
boot they will disappear.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agopstore/ram: Should update old dmesg buffer before reading
Anton Vorontsov [Sat, 26 May 2012 13:07:49 +0000 (06:07 -0700)]
pstore/ram: Should update old dmesg buffer before reading

Without the update, we'll only see the new dmesg buffer after the
reboot, but previously we could see it right away. Making an oops
visible in pstore filesystem before reboot is a somewhat dubious
feature, but removing it wasn't an intentional change, so let's
restore it.

For this we have to make persistent_ram_save_old() safe for calling
multiple times, and also extern it.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: android: alarm: remove unnecessary goto statement
Devendra Naga [Sat, 19 May 2012 18:53:26 +0000 (00:23 +0530)]
staging: android: alarm: remove unnecessary goto statement

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: Kconfig: cleanup depends on logic
H Hartley Sweeten [Wed, 13 Jun 2012 00:37:10 +0000 (17:37 -0700)]
staging: comedi: Kconfig: cleanup depends on logic

All of the config options for comedi depend on COMEDI being
selected. Wrap everything in an 'if COMEDI/endif' block and
remove all the individual 'depends on COMEDI' in the Kconfig.

Also, remove the redundant && ISA/PCI/PCMCIA/USB for the if
blocks with those driver types.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: speakup: fixed checkpatch and sparse warnings in selection.c
Chris Yungmann [Wed, 13 Jun 2012 16:39:55 +0000 (12:39 -0400)]
staging: speakup: fixed checkpatch and sparse warnings in selection.c

Signed-off-by: Chris Yungmann <yungmann.chris@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: keucr: scsiglue: fixed a do while coding style issue
William Blair [Wed, 13 Jun 2012 05:16:49 +0000 (01:16 -0400)]
Staging: keucr: scsiglue: fixed a do while coding style issue

Added a do ... while (0) to a multi statement macro and reformatted a similar macro.

Signed-off-by: William Blair <wdblair@bu.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging bcm: spelling of suppress in code
Peter Meerwald [Wed, 13 Jun 2012 18:44:35 +0000 (20:44 +0200)]
staging bcm: spelling of suppress in code

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging bcm: spelling of suppress in comments
Peter Meerwald [Wed, 13 Jun 2012 18:44:34 +0000 (20:44 +0200)]
staging bcm: spelling of suppress in comments

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: remove check for PCI_SUPPORT_VER1
H Hartley Sweeten [Tue, 12 Jun 2012 22:58:29 +0000 (15:58 -0700)]
staging: comedi: remove check for PCI_SUPPORT_VER1

This symbol is not defined in the kernel. It appears to be left
over from the 2.4 kernel.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: cleanup iio/iio.h
Peter Meerwald [Tue, 12 Jun 2012 13:38:48 +0000 (15:38 +0200)]
iio: cleanup iio/iio.h

indentation of parameter description,
fix parameter name (@dev -> @indio_dev) in comments,
IIO device info structure -> IIO device structure

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: mark struct iio_enum elements with @ in comment
Peter Meerwald [Tue, 12 Jun 2012 13:38:47 +0000 (15:38 +0200)]
iio: mark struct iio_enum elements with @ in comment

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: clarify channel and indexed in struct iio_chan_spec
Peter Meerwald [Tue, 12 Jun 2012 13:38:46 +0000 (15:38 +0200)]
iio: clarify channel and indexed in struct iio_chan_spec

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: fix typos in iio.h
Peter Meerwald [Tue, 12 Jun 2012 13:38:45 +0000 (15:38 +0200)]
iio: fix typos in iio.h

v2:
* "used in in-kernel" (Jonathan Cameron)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: nitpicking on sysfs-bus-iio
Peter Meerwald [Tue, 12 Jun 2012 13:31:27 +0000 (15:31 +0200)]
iio: nitpicking on sysfs-bus-iio

v2: address comments by Jonathan Cameron
* add more output power down modes
* spelling of etc.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: drop comment about 'real' channels
Peter Meerwald [Tue, 12 Jun 2012 12:39:37 +0000 (14:39 +0200)]
iio: drop comment about 'real' channels

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: ad9523: Fix argument type mismatch
Michael Hennerich [Mon, 11 Jun 2012 07:51:04 +0000 (09:51 +0200)]
iio: ad9523: Fix argument type mismatch

drivers/iio/frequency/ad9523.c:378 ad9523_vco_out_map()
 warn: value 2 can't fit into 1 'out'

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: add mcp4725 I2C DAC driver
Peter Meerwald [Fri, 8 Jun 2012 16:06:45 +0000 (18:06 +0200)]
iio: add mcp4725 I2C DAC driver

v5:
* fix warnings (Jonathan Cameron)

v4:
* remove unused indio_dev pointer in mcp4725_data (Jonathan Cameron)
* use u16 instead of unsigned short in mcp4725_data (Jonathan Cameron)
* #include mcp4725.h from linux/iio/dac/

v3:
* move from staging to drivers/iio
* switch to chan_spec
* dev_get_drvdata() -> dev_to_iio_dev()
* annotate probe() and remove() with __devinit and __devexit

v2 (based on comments from Jonathan Cameron and Lars-Peter Clausen):
* did NOT switch to chan_spec yet
* rebase to staging-next tree, update iio header locations
* dropped dac.h #include, not needed
* strict_strtol() -> kstrtol()
* call iio_device_unregister() in remove()
* everything in one patch

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: frequency: adf4350: using an uninitialized variable
Dan Carpenter [Fri, 8 Jun 2012 06:54:32 +0000 (09:54 +0300)]
iio: frequency: adf4350: using an uninitialized variable

GCC complains that we use an uninitialized variable if the user passes
an invalid parameter to adf4350_read().  I decided that we should return
-EINVAL instead in that case.

However, when I looked up at adf4350_write() it returned -ENODEV for
that condition.  In the end, I decided the -EINVAL was the right thing
and I change adf4350_write() to match.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: frequency: adf4350: fix an initialization
Dan Carpenter [Fri, 8 Jun 2012 06:55:37 +0000 (09:55 +0300)]
iio: frequency: adf4350: fix an initialization

Sparse complains about this:
drivers/iio/frequency/adf4350.c:58:29: warning: Initializer entry defined twice
drivers/iio/frequency/adf4350.c:59:10:   also defined here

It looks like '|' was intended here instead of ','.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: max517: mark probe() and remove() with __devinit and __devexit
Peter Meerwald [Fri, 8 Jun 2012 06:54:18 +0000 (08:54 +0200)]
iio: max517: mark probe() and remove() with __devinit and __devexit

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Roland Stigge <stigge@antcom.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: remove indio_dev pointer from max517_data
Peter Meerwald [Fri, 8 Jun 2012 06:54:17 +0000 (08:54 +0200)]
iio: remove indio_dev pointer from max517_data

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Roland Stigge <stigge@antcom.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoiio: frequency: ad9523: unlock on error in ad9523_reg_access()
Dan Carpenter [Fri, 8 Jun 2012 06:54:03 +0000 (09:54 +0300)]
iio: frequency: ad9523: unlock on error in ad9523_reg_access()

There was a return path which got missed accidentally.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cleanup comedi_alloc_subdevices
H Hartley Sweeten [Tue, 12 Jun 2012 18:59:55 +0000 (11:59 -0700)]
staging: comedi: cleanup comedi_alloc_subdevices

Access the individual comedi_subdevices using a pointer instead
of directly accessing as an array. This is how the rest of the
comedi core accesses them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: propogate error code from comedi_alloc_subdevices
H Hartley Sweeten [Tue, 12 Jun 2012 18:59:33 +0000 (11:59 -0700)]
staging: comedi: propogate error code from comedi_alloc_subdevices

comedi_alloc_subdevices can fail with -EINVAL or -ENOMEM. When it
does fail make sure to pass the proper error code back.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: remove the "Allocate the subdevice..." comments
H Hartley Sweeten [Tue, 12 Jun 2012 18:59:15 +0000 (11:59 -0700)]
staging: comedi: remove the "Allocate the subdevice..." comments

These comments are redundant. The function name 'comedi_alloc_subdevices'
provides this information.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <ian@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: remove the comed_alloc_subdevices "allocation failed" messages
H Hartley Sweeten [Tue, 12 Jun 2012 18:58:45 +0000 (11:58 -0700)]
staging: comedi: remove the comed_alloc_subdevices "allocation failed" messages

Remove all the "allocation failed" debug messages that are displayed
when the comedi_alloc_subdevices call fails.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbot <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: only set dev->n_subdevices when kcalloc succeedes
H Hartley Sweeten [Tue, 12 Jun 2012 18:58:27 +0000 (11:58 -0700)]
staging: comedi: only set dev->n_subdevices when kcalloc succeedes

It's possible for the kcalloc in comedi_alloc_subdevices to fail.
Only set the dev->n_subdevices variable if the allocation is
successful.

Since the core sets dev->n_subdevices, remove all the places in the
drivers where this variable was getting set.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: sanity check num_subdevices parameter in comedi_alloc_subdevices
H Hartley Sweeten [Tue, 12 Jun 2012 18:57:45 +0000 (11:57 -0700)]
staging: comedi: sanity check num_subdevices parameter in comedi_alloc_subdevices

It's possible for a couple of the comedi drivers to incorrectly call
comedi_alloc_subdevices with num_subdevices = 0. Add a sanity check
before doing the kcalloc.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbot@mev.co.uk>
Cc: Frank Mori Hess <kmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: change type of num_subdevices parameter to comedi_alloc_subdevices
H Hartley Sweeten [Tue, 12 Jun 2012 18:57:27 +0000 (11:57 -0700)]
staging: comedi: change type of num_subdevices parameter to comedi_alloc_subdevices

The n_subdevices variable of struct comedi_device is an int type.
Change the type of the comedi_alloc_subdevices 'num_subdevices' from
an unsigned int to an int to match it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: gdm72xx: Simplify spinlock fix for gdm_usb_send_complete
Ben Chan [Tue, 12 Jun 2012 18:23:32 +0000 (11:23 -0700)]
staging: gdm72xx: Simplify spinlock fix for gdm_usb_send_complete

This patch simplifies the previous patch (commit
dd13c86b0dae86efdde98119ffd7348e80719ade) for fixing the spinlock
recursion issue on several call sites of gdm_usb_send_complete.

Signed-off-by: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: Android: Fix NULL pointer related warning in alarm-dev.c file
Sachin Kamat [Tue, 5 Jun 2012 09:35:13 +0000 (15:05 +0530)]
staging: Android: Fix NULL pointer related warning in alarm-dev.c file

Fixes the following sparse warning:
drivers/staging/android/alarm-dev.c:259:35: warning: Using plain integer as NULL pointer

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: Android: Fix some checkpatch warnings
Sachin Kamat [Tue, 5 Jun 2012 11:10:10 +0000 (16:40 +0530)]
staging: Android: Fix some checkpatch warnings

Warnings reported by checkpatch.pl have been fixed.

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: export alloc_subdevices as comedi_alloc_subdevices
H Hartley Sweeten [Tue, 12 Jun 2012 00:45:15 +0000 (17:45 -0700)]
staging: comedi: export alloc_subdevices as comedi_alloc_subdevices

Move the inline alloc_subdevices() function from comedidev.h
to drivers.c and rename it to comedi_alloc_subdevices(). The
function is large enough to warrant being an exported symbol
rather than being an inline in every driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging "sep" Fix typos found while reading.
Justin P. Mattock [Mon, 11 Jun 2012 14:48:46 +0000 (07:48 -0700)]
staging "sep" Fix typos found while reading.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging:iio:ad7298: Fix linker error due to missing IIO kfifo buffer
Lars-Peter Clausen [Mon, 11 Jun 2012 13:09:21 +0000 (15:09 +0200)]
staging:iio:ad7298: Fix linker error due to missing IIO kfifo buffer

The ad7298 drivers buffer implementation uses the IIO kfifo buffer, so it needs
to select IIO_KFIFO_BUF. Otherwise (if no other driver selects the symbol) the
following linker error will occur:

drivers/built-in.o: In function `ad7298_register_ring_funcs_and_init':
(.text+0x245cf2): undefined reference to `iio_kfifo_allocate'
drivers/built-in.o: In function `ad7298_register_ring_funcs_and_init':
(.text+0x245d7d): undefined reference to `iio_kfifo_free'
drivers/built-in.o: In function `ad7298_ring_cleanup':
(.text+0x245dcd): undefined reference to `iio_kfifo_free'

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoRevert "staging: usbip: bugfix for stack corruption on 64-bit architectures"
Greg Kroah-Hartman [Tue, 12 Jun 2012 18:10:50 +0000 (11:10 -0700)]
Revert "staging: usbip: bugfix for stack corruption on 64-bit architectures"

This reverts commit 08224262adefb5e6460888b2490a96e1bc28aef5 as it's
just not right.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable <stable@vger.kernel.org>
Cc: Bart Westgeest <bart@elbrys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: ipack: delete sysfs from to-do list.
Samuel Iglesias Gonsalvez [Tue, 12 Jun 2012 09:37:46 +0000 (11:37 +0200)]
Staging: ipack: delete sysfs from to-do list.

As we have already got rid of sysfs files in the tpci200 driver, it is needed
to delete that mention in the TODO file.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: keucr: init: fixed a brace coding style issue
William Blair [Sun, 10 Jun 2012 19:10:33 +0000 (15:10 -0400)]
Staging: keucr: init: fixed a brace coding style issue

Fixed a coding style issue.

Signed-off-by: William Blair <wdblair@bu.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: usb: gadget: Configurable Composite Gadget depends on BLOCK
Andrzej Pietrasiewicz [Mon, 11 Jun 2012 09:11:59 +0000 (11:11 +0200)]
staging: usb: gadget: Configurable Composite Gadget depends on BLOCK

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: ipack: remove pr_fmt definition.
Samuel Iglesias Gonsalvez [Mon, 11 Jun 2012 06:56:36 +0000 (08:56 +0200)]
Staging: ipack: remove pr_fmt definition.

As there is no pr_* function used here, pr_fmt is not needed.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: sm7xxfb: sm7xx becomes sm7xxfb
Javier M. Mellid [Sun, 10 Jun 2012 11:12:24 +0000 (13:12 +0200)]
staging: sm7xxfb: sm7xx becomes sm7xxfb

Rename sm7xx driver to sm7xxfb. Fix Kconfig and Makefile to fit the new
change.

Changes are coherent with the rest of stable framebuffer drivers. TODO
updated.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: sm7xx: update comments and clarify supported chips
Javier M. Mellid [Sun, 10 Jun 2012 11:12:23 +0000 (13:12 +0200)]
staging: sm7xx: update comments and clarify supported chips

This patch updates/adds comments in order to clarify devices and Lynx
families supported for this driver.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: sm7xx: code improvement
Javier M. Mellid [Sun, 10 Jun 2012 11:12:22 +0000 (13:12 +0200)]
staging: sm7xx: code improvement

This patch simplifies code. It erases redundant code under little endian
compilations.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: rtl8187se, rtl8192e: fix '&' vs '|' bugs
Dan Carpenter [Sat, 9 Jun 2012 17:05:16 +0000 (20:05 +0300)]
Staging: rtl8187se, rtl8192e: fix '&' vs '|' bugs

The original code is equivalent to:

wrqu->retry.flags = 0x1000 & 0x0002;

so it just sets .flags to zero.  We should be ORing the values together
like r8192_wx_get_retry() does in drivers/staging/rtl8192u/r8192U_wx.c.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: rts5139: Fix typo in rts5139
Masanari Iida [Fri, 8 Jun 2012 15:19:17 +0000 (00:19 +0900)]
staging: rts5139: Fix typo in rts5139

Correct spelling typo in rts5139/rts51x_chip.h, rts51x_scsi.h

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: Fix typo in winbond
Masanari Iida [Fri, 8 Jun 2012 15:13:57 +0000 (00:13 +0900)]
staging: Fix typo in winbond

Correct spelling typo in winbond/mto.c and mds_s.h

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: gdm72xx: Fix spinlock recursion on gdm_usb_send_complete
Ben Chan [Thu, 7 Jun 2012 06:01:26 +0000 (23:01 -0700)]
staging: gdm72xx: Fix spinlock recursion on gdm_usb_send_complete

This patch fixes a spinlock recursion bug on several call sites of
gdm_usb_send_complete by not calling spin_lock_irqsave on
urb->context->tx_cxt->lock when the lock has already been acquired.

Signed-off-by: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: bcm: Return -ENOMEM instead of -1 when memory not acquired in nmv.c
Kevin McKinney [Fri, 8 Jun 2012 03:52:42 +0000 (23:52 -0400)]
Staging: bcm: Return -ENOMEM instead of -1 when memory not acquired in nmv.c

This patch changes the return statement on two
conditions where memory could not be acquired.
It returns -ENOMEM instead of -1.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: bcm: Use udelay instead of msleep for delays in nvm.c
Kevin McKinney [Thu, 7 Jun 2012 02:54:31 +0000 (22:54 -0400)]
Staging: bcm: Use udelay instead of msleep for delays in nvm.c

This patch uses udelay instead of msleep for delays
because msleep can sleep up to 20ms for any value
less than 20.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: bcm: Fix ERROR: return is not a function, parentheses are not required.
Kevin McKinney [Thu, 7 Jun 2012 02:54:30 +0000 (22:54 -0400)]
Staging: bcm: Fix ERROR: return is not a function, parentheses are not required.

This patch fixes the following error reported
by checkpatch.pl in nvm.c: "ERROR: return is
not a function, parentheses are not required".

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: bcm: Correctly format all comments in nvm.c
Kevin McKinney [Thu, 7 Jun 2012 02:54:29 +0000 (22:54 -0400)]
Staging: bcm: Correctly format all comments in nvm.c

This patch correctly formats all comments as reported
by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: bcm: Properly format braces in nvm.c
Kevin McKinney [Thu, 7 Jun 2012 02:54:28 +0000 (22:54 -0400)]
Staging: bcm: Properly format braces in nvm.c

This patch cuddles braces as reported
by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: bcm: Fix all whitespace issues in nvm.c
Kevin McKinney [Thu, 7 Jun 2012 02:54:27 +0000 (22:54 -0400)]
Staging: bcm: Fix all whitespace issues in nvm.c

This patch resolves all whitespace issues as reported
by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: wlags49_h2: remove direct declarations of KERN_<LEVEL> prefixes
Joe Perches [Wed, 6 Jun 2012 21:46:44 +0000 (14:46 -0700)]
staging: wlags49_h2: remove direct declarations of KERN_<LEVEL> prefixes

Use the standard KERN_<LEVEL> #defines instead of "<.>"

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Henk de Groot <pe1dnn@amsat.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/wlan-ng: prsim2fw.c coding style cleanup
Devendra Naga [Tue, 5 Jun 2012 19:42:06 +0000 (01:12 +0530)]
staging/wlan-ng: prsim2fw.c coding style cleanup

this patch fixes the coding style problems found by using checkpatch.pl

drivers/staging/wlan-ng/prism2fw.c:175: ERROR: "foo * bar" should be "foo *bar"
drivers/staging/wlan-ng/prism2fw.c:210: WARNING: line over 80 characters
drivers/staging/wlan-ng/prism2fw.c:596: WARNING: line over 80 characters
drivers/staging/wlan-ng/prism2fw.c:658: ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/wlan-ng: cfg80211.c coding style cleanup
Devendra Naga [Tue, 5 Jun 2012 19:40:50 +0000 (01:10 +0530)]
staging/wlan-ng: cfg80211.c coding style cleanup

there are warnings that are reported by checkpatch.pl
fixed the following problems

drivers/staging/wlan-ng/cfg80211.c:130: WARNING: line over 80 characters
drivers/staging/wlan-ng/cfg80211.c:366: WARNING: line over 80 characters
drivers/staging/wlan-ng/cfg80211.c:543: WARNING: line over 80 characters
drivers/staging/wlan-ng/cfg80211.c:665: WARNING: line over 80 characters
drivers/staging/wlan-ng/cfg80211.c:692: WARNING: line over 80 characters
drivers/staging/wlan-ng/cfg80211.c:735: WARNING: line over 80 characters

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: "sbe-2t3e3" Fix typos in sbe-2t3e3
Justin P. Mattock [Mon, 4 Jun 2012 14:46:52 +0000 (07:46 -0700)]
staging: "sbe-2t3e3" Fix typos in sbe-2t3e3

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/gdm72xx: Remove version.h includes
Devendra Naga [Sun, 27 May 2012 20:23:22 +0000 (01:53 +0530)]
staging/gdm72xx: Remove version.h includes

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: rts5139: sd_cprm: fix coding style and deprecation issues
Adnan Ali [Tue, 29 May 2012 14:21:20 +0000 (15:21 +0100)]
Staging: rts5139: sd_cprm: fix coding style and deprecation issues

This commit fixes coding style and deprecation issues which
includes long lines, braces with single statments in if condition
and deprecated min() function.

Signed-off-by: Adnan Ali <adnan.ali@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: gdm72xx: gdm_usb: fix deprecated function kernel_thread
Adnan Ali [Thu, 31 May 2012 10:32:48 +0000 (11:32 +0100)]
Staging: gdm72xx: gdm_usb: fix deprecated function kernel_thread

This commit fixes deprecated function kernel_thread by replacing
it with kthread_run.

Signed-off-by: Adnan Ali <adnan.ali@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: ramster: r2net: fix coding style issues
Adnan Ali [Tue, 29 May 2012 10:33:03 +0000 (11:33 +0100)]
Staging: ramster: r2net: fix coding style issues

This commit fixes coding style issues related to string splite
across multiple lines.

Signed-off-by: Adnan Ali <adnan.ali@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: sep: fix coding style issues
Adnan Ali [Mon, 28 May 2012 16:11:29 +0000 (17:11 +0100)]
Staging: sep: fix coding style issues

This commit fixes coding style issues related to string split
across the lines and space before tab at start of line.

Signed-off-by: Adnan Ali <adnan.ali@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: cptm1217: clearpad_tm1217: fix coding style issues
Adnan Ali [Mon, 28 May 2012 15:07:49 +0000 (16:07 +0100)]
Staging: cptm1217: clearpad_tm1217: fix coding style issues

This commit fixes coding style issues including quoted string
across multiple lines.

Signed-off-by: Adnan Ali <adnan.ali@codethink.co.uk>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: usbip: Updated comment describing VHCI_NPORTS
Bart Westgeest [Mon, 11 Jun 2012 20:57:30 +0000 (16:57 -0400)]
staging: usbip: Updated comment describing VHCI_NPORTS

Updated out-of-date comment describing VHCI_NPORT

Signed-off-by: Bart Westgeest <bart@elbrys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: usbip: bugfix for stack corruption on 64-bit architectures
Bart Westgeest [Mon, 11 Jun 2012 16:13:08 +0000 (12:13 -0400)]
staging: usbip: bugfix for stack corruption on 64-bit architectures

Previously a 6 byte array (buf) was erroneously cast to a 8 byte long
(event_bits) on 64-bit architectures which caused a stack corruption.

Signed-off-by: Bart Westgeest <bart@elbrys.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: disable pci device on pci remove function.
Miguel Gómez [Wed, 6 Jun 2012 14:22:07 +0000 (16:22 +0200)]
Staging: xgifb: disable pci device on pci remove function.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: disable pci device if there's an error after enabling it.
Miguel Gómez [Wed, 6 Jun 2012 14:22:06 +0000 (16:22 +0200)]
Staging: xgifb: disable pci device if there's an error after enabling it.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: reorder the code a bit to be more module friendly
Miguel Gómez [Wed, 6 Jun 2012 14:22:05 +0000 (16:22 +0200)]
Staging: xgifb: reorder the code a bit to be more module friendly

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: xgifb: Remove #ifdef MODULE
Miguel Gómez [Wed, 6 Jun 2012 14:22:04 +0000 (16:22 +0200)]
Staging: xgifb: Remove #ifdef MODULE

Check for MODULE is not needed. In a static compilation the parameters
definition is valid and module_exit() does nothing.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_pci224: Replace NULLFUNC
Ian Abbott [Fri, 8 Jun 2012 09:39:42 +0000 (10:39 +0100)]
staging: comedi: amplc_pci224: Replace NULLFUNC

The source code defines a macro NULLFUNC

  #define NULLFUNC 0

and uses it as a generic null function pointer constant.  This is
superfluous.  Just use NULL instead.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_pci230: Replace NULLFUNC
Ian Abbott [Fri, 8 Jun 2012 09:40:05 +0000 (10:40 +0100)]
staging: comedi: amplc_pci230: Replace NULLFUNC

The source code defines a macro NULLFUNC

  #define NULLFUNC 0

and uses it as a generic null function pointer constant.  This is
superfluous.  Just use NULL instead.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_pci230: add a missing unlock
Dan Carpenter [Fri, 8 Jun 2012 06:52:58 +0000 (09:52 +0300)]
staging: comedi: amplc_pci230: add a missing unlock

This side of the if else statement returned with the lock held and IRQs
disabled.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: serial2002: quiet NULL pointer sparse noise
H Hartley Sweeten [Fri, 8 Jun 2012 00:14:25 +0000 (17:14 -0700)]
staging: comedi: serial2002: quiet NULL pointer sparse noise

Quiet a number of sparse warnings in this file:

warning: Using plain integer as NULL pointer

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>
12 years agostaging: comedi: pcl816: if test should use logical OR not bitwise OR
H Hartley Sweeten [Fri, 8 Jun 2012 00:25:35 +0000 (17:25 -0700)]
staging: comedi: pcl816: if test should use logical OR not bitwise OR

This quiets a couple sparse warnings about:

warning: dubious: !x | !y
warning: dubious: x | !y

Also, remove the unnecessary parentheses abound the variables.

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>
12 years agostaging: comedi: adl_pci9118: if test should use logical AND not bitwise AND
H Hartley Sweeten [Fri, 8 Jun 2012 00:31:19 +0000 (17:31 -0700)]
staging: comedi: adl_pci9118: if test should use logical AND not bitwise AND

This quiets a couple sparse warnings about:

warning: dubious: !x & y

Also, remove the unnecessary parentheses around the variables.

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>
12 years agostaging: comedi: refactor comedi_fops to remove most of the forward declarations
H Hartley Sweeten [Fri, 8 Jun 2012 00:05:27 +0000 (17:05 -0700)]
staging: comedi: refactor comedi_fops to remove most of the forward declarations

Move the comedi_unlocked_ioctl function in order to remove most of
the forward declarations in this file.

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>
12 years agodrivers/staging/comedi/drivers/me4000.c: adjust suspicious bit operation
Julia Lawall [Wed, 6 Jun 2012 21:41:36 +0000 (23:41 +0200)]
drivers/staging/comedi/drivers/me4000.c: adjust suspicious bit operation

TRIG_ROUND_NEAREST is 0, so a bit-and with it is always false.  The
value TRIG_ROUND_MASK covers the bits of the TRIG_ROUND constants, so
first pick those bits and then make the test using ==.

The same is done for TRIG_ROUND_UP for symmetry, even though bit-and would
be sufficient in this case.

This problem was found using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: ni_labpc: unlock spinlock on command error
H Hartley Sweeten [Tue, 5 Jun 2012 18:12:18 +0000 (11:12 -0700)]
staging: comedi: ni_labpc: unlock spinlock on command error

When starting the acquisition the labpc_ai_cmd function was
exiting without unlocking the spinlock. This results in a
sparse warning:

warning: context imbalance in 'labpc_ai_cmd' - different lock contexts for basic block

Add the missing spin_unlock_irqrestore calls.

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>
12 years agostaging: comedi: cleanup sysfs functions
H Hartley Sweeten [Tue, 5 Jun 2012 17:18:02 +0000 (10:18 -0700)]
staging: comedi: cleanup sysfs functions

Make the comedi sysfs functions a bit more concise by shortening
some of the verbose variable names and reusing some of the
variables that were used for intermediate calculations.

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>
12 years agostaging: comedi: describe comedi_recognize()
Ian Abbott [Wed, 6 Jun 2012 14:17:02 +0000 (15:17 +0100)]
staging: comedi: describe comedi_recognize()

Add a comment to comedi_recognize() to describe what it does as it's a
bit confusing.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: das08: Reduce conditional compilation
Ian Abbott [Wed, 6 Jun 2012 12:43:55 +0000 (13:43 +0100)]
staging: comedi: das08: Reduce conditional compilation

This code is used by some combination of the CONFIG_COMEDI_DAS08_CS,
CONFIG_COMEDI_DAS08_ISA, and CONFIG_COMEDI_DAS08_PCI and contains a lot
of conditional compilation.

Remove most of the conditional compilation, relying on the compiler to
optimize out unused static functions and data.  Use the '__maybe_unused'
tag for those functions that cause compiler warnings as a result of
this.

Also change the DO_COMEDI_DRIVER_REGISTER macro from a conditionally
defined macro to a manifest constant macro to allow it to be tested
outside the preprocessor (although this is not currently needed).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/comedi: fix build for USB not enabled
Randy Dunlap [Mon, 11 Jun 2012 23:35:50 +0000 (16:35 -0700)]
staging/comedi: fix build for USB not enabled

Calls to optional subsystems cannot be made indiscriminately.
Enclose all of the usb helper functions inside
#if IS_ENABLED(CONFIG_USB)
to fix these build errors.

(The pci helper functions are OK since there are stubs in
linux/pci.h for the called functions when PCI is not enabled.
Possibly the same could be done for the called USB functions.)

ERROR: "usb_deregister" [drivers/staging/comedi/comedi.ko] undefined!
ERROR: "usb_register_driver" [drivers/staging/comedi/comedi.ko] undefined!

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: Delete if_strip.h
Paul Bolle [Fri, 8 Jun 2012 10:22:46 +0000 (12:22 +0200)]
staging: Delete if_strip.h

Commit f80a3f62383bf673c310926d55142d51f118926d ("Staging: strip: delete
the driver") left if_strip.h unused: nothing in the tree includes it
anymore. It is still exported, but since nothing in the kernel uses
struct MetricomAddress, that seems pointless. Delete this header too.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: usbip: userspace: include headers in release tarballs
Natanael Copa [Fri, 1 Jun 2012 08:14:02 +0000 (10:14 +0200)]
staging: usbip: userspace: include headers in release tarballs

The header files should be included in generated tarballs for archives.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: zram: conventions, __aligned() attribute
Sam Hansen [Thu, 7 Jun 2012 23:03:48 +0000 (16:03 -0700)]
staging: zram: conventions, __aligned() attribute

Using the __aligned() attribute in favor of __attribute__((aligned(size)))

Signed-off-by: Sam Hansen <solid.se7en@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: zram: conventions pr_warning -> pr_warn()
Sam Hansen [Thu, 7 Jun 2012 23:03:47 +0000 (16:03 -0700)]
staging: zram: conventions pr_warning -> pr_warn()

Porting zram to use the pr_warn() function instead of the deprecated
pr_warning().

Signed-off-by: Sam Hansen <solid.se7en@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: zsmalloc documentation
Nitin Gupta [Sun, 10 Jun 2012 00:41:14 +0000 (17:41 -0700)]
staging: zsmalloc documentation

Documentation of various struct page fields
used by zsmalloc.

Changes for v2:
- Regroup descriptions as suggested by Konrad

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: zram: remove special handle of uncompressed page
Minchan Kim [Fri, 8 Jun 2012 06:39:27 +0000 (15:39 +0900)]
staging: zram: remove special handle of uncompressed page

xvmalloc can't handle PAGE_SIZE page so that zram have to
handle it specially but zsmalloc can do it so let's remove
unnecessary special handling code.

Quote from Nitin
"I think page vs handle distinction was added since xvmalloc could not
handle full page allocation. Now that zsmalloc allows full page
allocation, we can just use it for both cases. This would also allow
removing the ZRAM_UNCOMPRESSED flag. The only downside will be slightly
slower code path for full page allocation but this event is anyways
supposed to be rare, so should be fine."

1. This patch reduces code very much.

 drivers/staging/zram/zram_drv.c   |  104 +++++--------------------------------
 drivers/staging/zram/zram_drv.h   |   17 +-----
 drivers/staging/zram/zram_sysfs.c |    6 +--
 3 files changed, 15 insertions(+), 112 deletions(-)

2. change pages_expand with bad_compress so it can count
   bad compression(above 75%) ratio.

3. remove zobj_header which is for back-reference for defragmentation
   because firstly, it's not used at the moment and zsmalloc can't handle
   bigger size than PAGE_SIZE so zram can't do it any more without redesign.

Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: zram: fix random data read
Minchan Kim [Fri, 8 Jun 2012 06:39:26 +0000 (15:39 +0900)]
staging: zram: fix random data read

fd1a30de makes a bug that it uses (struct page *) as zsmalloc's handle
although it's a uncompressed page so that it can access random page,
return random data or even crashed by get_first_page in zs_map_object.

Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: zsmalloc: zsmalloc: use unsigned long instead of void *
Minchan Kim [Fri, 8 Jun 2012 06:39:25 +0000 (15:39 +0900)]
staging: zsmalloc: zsmalloc: use unsigned long instead of void *

We should use unsigned long as handle instead of void * to avoid any
confusion. Without this, users may just treat zs_malloc return value as
a pointer and try to deference it.

This patch passed compile test(zram, zcache and ramster) and zram is
tested on qemu.

changelog
  * from v2
- remove hval pointed out by Nitin
- based on next-20120607
  * from v1
- change zcache's zv_create return value
- baesd on next-20120604

Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: et131x: fix | vs & typos
Dan Carpenter [Sat, 9 Jun 2012 09:17:01 +0000 (12:17 +0300)]
Staging: et131x: fix | vs & typos

These two places seem like they should be using bitwise OR instead of
bitwise AND.  The first one is a noop which is equivalent to:

imr |= (0x0100 & 0x0004 & 0x0001);

The second is sets lcr2 to zero instead of just clearing the high bits.

lcr2 &= (0x00F0 & 0x000F);

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>