GitHub/moto-9609/android_kernel_motorola_exynos9610.git
8 years agoiio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8
William Breathitt Gray [Wed, 28 Sep 2016 18:00:01 +0000 (14:00 -0400)]
iio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8

The ACCES 104-QUAD-8 is a general purpose quadrature encoder
counter/interface board. The 104-QUAD-8 is capable of monitoring the
outputs of eight encoders via four on-board LSI/CSI LS7266R1 24-bit
dual-axis quadrature counter chips. Core functions handled by the
LS7266R1, such as direction and total count, are available.

Performing a write to a counter's IIO_CHAN_INFO_RAW sets the counter and
also clears the counter's respective error flag. Although the counters
have a 25-bit range, only the lower 24 bits may be set, either directly
or via a counter's preset attribute. Interrupts are not supported by
this driver.

This driver adds IIO support for the ACCES 104-QUAD-8 and ACCES
104-QUAD-4. The base port addresses for the devices may be configured
via the base array module parameter.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: Implement counter channel type and info constants
William Breathitt Gray [Wed, 28 Sep 2016 17:59:49 +0000 (13:59 -0400)]
iio: Implement counter channel type and info constants

Quadrature encoders, such as rotary encoders and linear encoders, are
devices which are capable of encoding the relative position and
direction of motion of a shaft. This patch introduces several IIO
constants for supporting quadrature encoder counter devices.

  IIO_COUNT: Current count (main data provided by the counter device)
  IIO_INDEX: Counter device index value

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: pressure: Add driver for Honeywell ABP family
Marcin Malagowski [Mon, 26 Sep 2016 17:23:06 +0000 (19:23 +0200)]
iio: pressure: Add driver for Honeywell ABP family

This patch adds minimal driver for the Honeywell Amplified Basic
Pressure sensors series. Sensors are pretty simple but are
available in many variants:
- psi/mbar/kPa output,
- analog/i2c/spi,
- gage/differential measurement,
- different measure ranges etc.

Refer to datasheets for more details:
http://sensing.honeywell.com/honeywell-sensing-basic-board-mount-pressure-sensors-abp-series-datasheet-323005128-c-en.pdf
http://sensing.honeywell.com/index.php%3Fci_id%3D45841

Driver internals:
- i2c only. measure request is done by the SMBUS QUICK cmd, so if the i2c
  bus doesn't support it, it is required to send a dummy byte to trigger
  measurement,
- since iio sysfs expects kilopascals, mbar-variants are treated as their
  respective kPa-s, hence i2c id-table has doubled entries in one line:
{ "abp060mg", ABP006KG }, { "abp006kg", ABP006KG },
- psi-variants have prescaled values in config,
- no temperature reads yet.

Work remained:
- optional temperature channel,
- SPI support,
- DT binding.

Changes since v1:
- mutex is now locked in read_raw(),
- corrected error codes,
- fixed coding style issues,
- renamed few defines and functions abp -> abp060mg
(some structs left as they were to keep the sensible meaning).

Signed-off-by: Marcin Malagowski <mrc@bourne.st>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: iio: isl29018: check if the chip is in a suspended state
Brian Masney [Tue, 27 Sep 2016 00:20:20 +0000 (20:20 -0400)]
staging: iio: isl29018: check if the chip is in a suspended state

Add a check to isl29018_write_raw() to ensure that the chip is not in a
suspended state. This makes the code consistent with what is present
in isl29018_read_raw().

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: iio: isl29018: change isl29018_read_raw() to only have one exit point
Brian Masney [Tue, 27 Sep 2016 00:20:19 +0000 (20:20 -0400)]
staging: iio: isl29018: change isl29018_read_raw() to only have one exit point

When the chip is in a suspended state, isl29018_read_raw() will return
-EBUSY. Change the function so that it only has a single exit point.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: iio: isl29018: fixed race condition in in_illuminance_scale_available_show()
Brian Masney [Tue, 27 Sep 2016 00:20:18 +0000 (20:20 -0400)]
staging: iio: isl29018: fixed race condition in in_illuminance_scale_available_show()

in_illuminance_scale_available_show() references the
isl29018_chip->int_time variable in three places inside a for loop.
The value of the int_time variable can be updated by the
isl29018_set_integration_time() function, which is called by the
isl29018_write_raw() function. isl29018_write_raw() locks a
mutex specific to this driver when the integration time variable is
updated.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: iio: isl29018: use IIO_DEVICE_ATTR_{RO, RW} macros
Brian Masney [Tue, 27 Sep 2016 00:20:17 +0000 (20:20 -0400)]
staging: iio: isl29018: use IIO_DEVICE_ATTR_{RO, RW} macros

Use the IIO_DEVICE_ATTR_RO and IIO_DEVICE_ATTR_RW macros to
create the device attributes.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoinclude: linux: iio: add IIO_ATTR_{RO, WO, RW} and IIO_DEVICE_ATTR_{RO, WO, RW} macros
Brian Masney [Tue, 27 Sep 2016 00:20:16 +0000 (20:20 -0400)]
include: linux: iio: add IIO_ATTR_{RO, WO, RW} and IIO_DEVICE_ATTR_{RO, WO, RW} macros

Add new macros: IIO_ATTR_RO, IIO_ATTR_WO, IIO_ATTR_RW,
IIO_DEVICE_ATTR_RO, IIO_DEVICE_ATTR_WO and IIO_DEVICE_ATTR_RW to reduce
the amount of boiler plate code that is needed for creating new
attributes. This mimics the *_RO, *_WO, and *_RW macros that are found
in include/linux/device.h and include/linux/sysfs.h.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: Declare event_attrs field of iio_info structure as const
Bhumika Goyal [Sat, 1 Oct 2016 09:57:18 +0000 (15:27 +0530)]
iio: Declare event_attrs field of iio_info structure as const

The event_attrs field of iio_info structure is only initialized once
whenever an object of iio_info is created. After that this field
is never modified again anywhere in the kernel. So, declare event_attrs
field of iio_info as a const struct attribute_group.
Checked for occurences throughout the kernel using grep and
coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoStaging:iio:light:tsl2583: constify attribute_group structures
Bhumika Goyal [Mon, 26 Sep 2016 05:01:39 +0000 (10:31 +0530)]
Staging:iio:light:tsl2583: constify attribute_group structures

Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before: drivers/staging/iio/light/tsl2583.o
   text    data     bss     dec     hex filename
   6529    1052       0    7581    1d9d
drivers/staging/iio/light/tsl2583.o

File size after: drivers/staging/iio/light/tsl2583.o
   text    data     bss     dec     hex filename
   6593     988       0    7581    1d9d
drivers/staging/iio/light/tsl2583.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoStaging:iio:adc:ad7280a: constify attribute_group structures
Bhumika Goyal [Mon, 26 Sep 2016 05:01:38 +0000 (10:31 +0530)]
Staging:iio:adc:ad7280a: constify attribute_group structures

Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before: drivers/staging/iio/adc/ad7280a.o
   text    data     bss     dec     hex filename
   6487     584     776    7847    1ea7
drivers/staging/iio/adc/ad7280a.o

File size after: drivers/staging/iio/adc/ad7280a.o
   text    data     bss     dec     hex filename
   6551     544     776    7871    1ebf
drivers/staging/iio/adc/ad7280a.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: iio: isl29018: fix comparison between signed and unsigned integers
Brian Masney [Sun, 25 Sep 2016 11:41:07 +0000 (07:41 -0400)]
staging: iio: isl29018: fix comparison between signed and unsigned integers

Fixes warning found by make W=2:
warning: comparison between signed and unsigned integer expressions

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: iio: isl29018: made error handling consistent
Brian Masney [Sun, 25 Sep 2016 11:41:06 +0000 (07:41 -0400)]
staging: iio: isl29018: made error handling consistent

Changed the processing of IIO_CHAN_INFO_INT_TIME in isl29018_write_raw()
to unlock the mutex and return at the end of the function if invalid
input is passed in. This makes the error handling code consistent with
the processing of IIO_CHAN_INFO_CALIBSCALE and IIO_CHAN_INFO_SCALE
within the same function.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: iio: isl29018: remove unused variable and defines
Brian Masney [Sun, 25 Sep 2016 11:41:05 +0000 (07:41 -0400)]
staging: iio: isl29018: remove unused variable and defines

Removes unused variable and associated #defines that was found using
make W=1.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agodrivers: iio: magnetometer: Fix sparse endianness warnings cast to restricted __be16
Sandhya Bankar [Sun, 25 Sep 2016 13:03:17 +0000 (18:33 +0530)]
drivers: iio: magnetometer: Fix sparse endianness warnings cast to restricted __be16

Fix the following sparse endianness warnings:

drivers/iio/magnetometer/ak8975.c:716:16: warning: cast to restricted __le16
drivers/iio/magnetometer/ak8975.c:837:19: warning: cast to restricted __le16
drivers/iio/magnetometer/ak8975.c:838:19: warning: cast to restricted __le16
drivers/iio/magnetometer/ak8975.c:839:19: warning: cast to restricted __le16

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: potentiostat: add LMP91000 support
Matt Ranostay [Sun, 25 Sep 2016 04:03:00 +0000 (21:03 -0700)]
iio: potentiostat: add LMP91000 support

Add support for the LMP91000 potentiostat which is used for chemical
sensing applications.

Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: adc: ti-adc161s626: add regulator support
Matt Ranostay [Sun, 18 Sep 2016 22:42:15 +0000 (15:42 -0700)]
iio: adc: ti-adc161s626: add regulator support

Allow IIO_CHAN_INFO_SCALE and IIO_CHAN_INFO_OFFSET attributes for
processing by checking voltage from a regulator.

Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: inkern: add iio_read_channel_offset helper
Matt Ranostay [Sat, 24 Sep 2016 06:04:07 +0000 (23:04 -0700)]
iio: inkern: add iio_read_channel_offset helper

Allow access to underlying channel IIO_CHAN_INFO_OFFSET from a consumer.

Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agodrivers: iio: light: Fix sparse warnings
Sandhya Bankar [Sat, 24 Sep 2016 16:14:55 +0000 (21:44 +0530)]
drivers: iio: light: Fix sparse warnings

Fixing below warnings:

drivers/iio/light/max44000.c:217:18: warning: cast to restricted __be16
drivers/iio/light/max44000.c:217:18: warning: cast to restricted __be16
drivers/iio/light/max44000.c:217:18: warning: cast to restricted __be16
drivers/iio/light/max44000.c:217:18: warning: cast to restricted __be16

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:adc: Add support for AD7766/AD7767
Lars-Peter Clausen [Fri, 23 Sep 2016 15:19:44 +0000 (17:19 +0200)]
iio:adc: Add support for AD7766/AD7767

Add support for the AD7766, AD7766-1, AD7766-2, AD7767, AD7767-1, AD7767-2
Analog to Digital converters. It's a family of single channel 24-bit SAR
ADCs. They are all digital interface compatible and the main difference is
the internal decimation rate and analog performance. For communication with
the host processor a SPI interface is used.

In addition the part has a data ready pin that is pulsed for one MCLK cycle
when a conversion has completed and can be used as a IIO trigger.

Datasheets:
http://www.analog.com/media/en/technical-documentation/data-sheets/AD7766.pdf
http://www.analog.com/media/en/technical-documentation/data-sheets/AD7767.pdf

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:max1027: Use iio_trigger_validate_own_device() helper
Lars-Peter Clausen [Fri, 23 Sep 2016 15:19:43 +0000 (17:19 +0200)]
iio:max1027: Use iio_trigger_validate_own_device() helper

Use the new iio_trigger_validate_own_device() to verify that the trigger
can only be attached to the matching IIO device rather than using a custom
variant.

While the implementation of iio_trigger_validate_own_device() and the
custom variant and are not identical their behaviour is.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:mma8452: Use new iio_trigger_validate_own_device() helper
Lars-Peter Clausen [Fri, 23 Sep 2016 15:19:42 +0000 (17:19 +0200)]
iio:mma8452: Use new iio_trigger_validate_own_device() helper

Use the new iio_trigger_validate_own_device() to verify that the trigger
can only be attached to the matching IIO device rather than using a custom
variant.

While the implementation of iio_trigger_validate_own_device() and the
custom variant and are not identical their behaviour is.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:trigger: Add helper function to verify that a trigger belongs to the same device
Lars-Peter Clausen [Fri, 23 Sep 2016 15:19:41 +0000 (17:19 +0200)]
iio:trigger: Add helper function to verify that a trigger belongs to the same device

Some triggers can only be attached to the IIO device that corresponds to
the same physical device. Currently each driver that requires this
implements its own trigger validation function.

Introduce a new helper function called iio_trigger_validate_own_device()
that can be used to do this check. Having a common implementation avoids
code duplication and unnecessary boiler-plate code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agodrivers: iio: dac: Fix sparse warning
Sandhya Bankar [Fri, 23 Sep 2016 19:20:22 +0000 (00:50 +0530)]
drivers: iio: dac: Fix sparse warning

Fixing below warnings:

drivers/iio/dac/ad5592r.c:58:41: warning: incorrect type in argument 2 (different base types)
drivers/iio/dac/ad5592r.c:58:41:    expected unsigned short [usertype] *buf
drivers/iio/dac/ad5592r.c:58:41:    got restricted __be16 *<noident>
drivers/iio/dac/ad5592r.c:62:41: warning: incorrect type in argument 2 (different base types)
drivers/iio/dac/ad5592r.c:62:41:    expected unsigned short [usertype] *buf
drivers/iio/dac/ad5592r.c:62:41:    got restricted __be16 *<noident>
drivers/iio/dac/ad5592r.c:92:41: warning: incorrect type in argument 2 (different base types)
drivers/iio/dac/ad5592r.c:92:41:    expected unsigned short [usertype] *buf
drivers/iio/dac/ad5592r.c:92:41:    got restricted __be16 *<noident>
drivers/iio/dac/ad5592r.c:110:41: warning: incorrect type in argument 2 (different base types)
drivers/iio/dac/ad5592r.c:110:41:    expected unsigned short [usertype] *buf
drivers/iio/dac/ad5592r.c:110:41:    got restricted __be16 *<noident>

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agodrivers: iio: max1027: Fix sparse warning: "dubious: x | !y"
Sandhya Bankar [Fri, 23 Sep 2016 20:04:48 +0000 (01:34 +0530)]
drivers: iio: max1027: Fix sparse warning: "dubious: x | !y"

Fixing below warning:
drivers/iio/adc/max1027.c:241:34: warning: dubious: x | !y .

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: Use kmalloc_array() in iio_scan_mask_set()
Markus Elfring [Fri, 23 Sep 2016 20:30:32 +0000 (22:30 +0200)]
iio: Use kmalloc_array() in iio_scan_mask_set()

A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: accel: mma7660: fix non static symbol warning
Wei Yongjun [Sat, 24 Sep 2016 12:01:54 +0000 (12:01 +0000)]
iio: accel: mma7660: fix non static symbol warning

Fixes the following sparse warning:

drivers/iio/accel/mma7660.c:42:11: warning:
 symbol 'mma7660_nscale' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agotools: iio: iio_generic_buffer: fix argument '?' option
Mugunthan V N [Wed, 21 Sep 2016 16:57:58 +0000 (22:27 +0530)]
tools: iio: iio_generic_buffer: fix argument '?' option

When help ('?') option is passed to the command, the help text
printed but not from '?' switch case of getopt_long() but as a
invalid argument as below. Fix this by adding '?' to opt_String
of getopt_long().

root@am437x-evm:~# ./iio_generic_buffer -?
./iio_generic_buffer: invalid option -- '?'
Usage: generic_buffer [options]...
Capture, convert and output data from IIO device buffer
  -a         Auto-activate all available channels
...

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:pressure: zpa2326: remove redundant "DEBUG" ifdef
Arnd Bergmann [Thu, 22 Sep 2016 09:42:30 +0000 (11:42 +0200)]
iio:pressure: zpa2326: remove redundant "DEBUG" ifdef

The -Wempty-body gcc warning triggers in the newly added zpa2326 driver:

drivers/iio/pressure/zpa2326.c: In function 'zpa2326_dequeue_pressure':
drivers/iio/pressure/zpa2326.c:578:3: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

The use of an empty statement behind 'if (...)' is harmless here, but
it shows that the dev_dbg() macro is not used correctly: when the "DEBUG"
macro is not set, dev_dbg() already defaults to a no-operation, though
one that lets the compiler know that the arguments are used, and lets
it check the format string.

Fixing this also simplifies the driver.

Fixes: 03b262f2bbf4 ("iio:pressure: initial zpa2326 barometer support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: accel: sca3000_core: avoid potentially uninitialized variable
Arnd Bergmann [Thu, 22 Sep 2016 09:43:42 +0000 (11:43 +0200)]
iio: accel: sca3000_core: avoid potentially uninitialized variable

The newly added __sca3000_get_base_freq function handles all valid
modes of the SCA3000_REG_ADDR_MODE register, but gcc notices
that any other value (i.e. 0x00) causes the base_freq variable to
not get initialized:

drivers/staging/iio/accel/sca3000_core.c: In function 'sca3000_write_raw':
drivers/staging/iio/accel/sca3000_core.c:527:23: error: 'base_freq' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This adds explicit error handling for unexpected register values,
to ensure this cannot happen.

Fixes: e0f3fc9b47e6 ("iio: accel: sca3000_core: implemented IIO_CHAN_INFO_SAMP_FREQ")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoStaging: speakup: kobjects: Add space around the operator.
Sandhya Bankar [Thu, 22 Sep 2016 09:57:30 +0000 (15:27 +0530)]
Staging: speakup: kobjects: Add space around the operator.

This issue was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: speakup: varhandlers: Add space around the operator.
Sandhya Bankar [Thu, 22 Sep 2016 09:53:55 +0000 (15:23 +0530)]
Staging: speakup: varhandlers: Add space around the operator.

This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: slicoss: Move NULL test closer to assignment
Rehas Sachdeva [Wed, 21 Sep 2016 18:36:51 +0000 (00:06 +0530)]
staging: slicoss: Move NULL test closer to assignment

Move the test to check if a variable is NULL, to right after it is being
assigned, rather than some statements later.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: ks7010: Remove unnecessary variable used to store return value
sayli karnik [Wed, 21 Sep 2016 18:17:55 +0000 (23:47 +0530)]
staging: ks7010: Remove unnecessary variable used to store return value

This patch removes an unnecessary variable used to store return values
in order to reduce memory usage.
Done using coccinelle:
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
return
- ret
+ C
;

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: octeon-usb: Remove unnecessary assignment
Rehas Sachdeva [Wed, 21 Sep 2016 18:08:00 +0000 (23:38 +0530)]
staging: octeon-usb: Remove unnecessary assignment

Remove 'x=a;' from a consecutive double assignment of the form 'x=a; x=b;'.
Issue detected by the semantic patch found here:
https://github.com/coccinelle/coccinellery/blob/master/write2/write2.cocci

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging:rtl8188eu: Fix multiple blank lines
Yannis Damigos [Wed, 21 Sep 2016 17:24:54 +0000 (20:24 +0300)]
Staging:rtl8188eu: Fix multiple blank lines

This patch fixes multiple black lines issue found by checkpatch.pl

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: Remove unnecessary parentheses
Rehas Sachdeva [Tue, 20 Sep 2016 13:11:18 +0000 (18:41 +0530)]
staging: sm750fb: Remove unnecessary parentheses

Remove unnecessary parentheses from right side of an assignment. Issue
detected by the following Coccinelle semantic patch:

@r@
identifier x;
expression e1, e2;
@@

- x = (e1 << e2);
+ x = e1 << e2;

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: Use BIT(x) macro
Rehas Sachdeva [Tue, 20 Sep 2016 12:06:29 +0000 (17:36 +0530)]
staging: sm750fb: Use BIT(x) macro

Replaces left shift operation (1 << d) by BIT(x) macro.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: xgifb: Remove unused variable and if statement
Rehas Sachdeva [Tue, 20 Sep 2016 14:10:14 +0000 (19:40 +0530)]
staging: xgifb: Remove unused variable and if statement

Setting the variable 'refresh_rate = 60;' has no use to the rest of the
function. Hence the if statement setting it and the variable itself can be
removed. This was detected using the following Coccinelle semantic patch:

@@
type T;
identifier i;
constant C;
@@
(
extern T i;
|
- T i;
  <+... when != i
- i = C;
  ...+>
)

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: speakup: Remove unnecessary parentheses
Katie Dunne [Wed, 21 Sep 2016 22:13:20 +0000 (15:13 -0700)]
staging: speakup: Remove unnecessary parentheses

Issue found by checkpatch.

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: add maintainer for uart and log protocol drivers
David Lin [Thu, 22 Sep 2016 01:57:23 +0000 (18:57 -0700)]
staging: greybus: add maintainer for uart and log protocol drivers

Add myself as greybus uart and log protocol driver maintainer.

Signed-off-by: David Lin <dtwlin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: uart.c: fix alignment to match open parenthesis
Chaehyun Lim [Thu, 22 Sep 2016 01:56:44 +0000 (10:56 +0900)]
staging: greybus: uart.c: fix alignment to match open parenthesis

Fixes checkpatch.pl warning:
CHECK: Alignment should match open parenthesis

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: uart.c: change 'unsigned' to 'unsigned int'
Chaehyun Lim [Thu, 22 Sep 2016 01:56:43 +0000 (10:56 +0900)]
staging: greybus: uart.c: change 'unsigned' to 'unsigned int'

Fixes checkpatch.pl warning:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: audio_codec.c: code indent should use tabs where possible
Richard Groux [Wed, 21 Sep 2016 17:05:31 +0000 (19:05 +0200)]
staging: greybus: audio_codec.c: code indent should use tabs where possible

Minor error spotted by checkpatch.pl in greybus
code indent should use tabs where possible

Signed-off-by: Richard Groux <rgroux@sauron-mordor.net>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: audio_codec.c: space required before the open brace
Richard Groux [Wed, 21 Sep 2016 17:05:29 +0000 (19:05 +0200)]
staging: greybus: audio_codec.c: space required before the open brace

Minor error spotted by checkpatch.pl in greybus
space required before the open brace '{'

Signed-off-by: Richard Groux <rgroux@sauron-mordor.net>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: arche-platform: compress return logic into one line
Eva Rachel Retuya [Wed, 21 Sep 2016 05:07:04 +0000 (13:07 +0800)]
staging: greybus: arche-platform: compress return logic into one line

Modify return statement to use the value being returned directly instead of
assigning it first to 'ret' and returning this variable. Coccinelle semantic
patch used:

@@
expression e;
local idexpression ret;
@@

-ret =
+return
e;
-return ret;

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: audio: delete unnecessary parentheses
Eva Rachel Retuya [Wed, 21 Sep 2016 05:03:24 +0000 (13:03 +0800)]
staging: greybus: audio: delete unnecessary parentheses

Eliminate unneeded parentheses around the right hand side of an assignment.
Coccinelle semantic patch used:

@@
expression e1, e2;
identifier v;
@@

(
 v = (e1 == e2)
|
 v = (e1 != e2)
|
 v = (e1 <= e2)
|
 v = (e1 >= e2)
|
 v =
- (
e1
- )
)

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: camera: simplify NULL test
Eva Rachel Retuya [Wed, 21 Sep 2016 04:59:29 +0000 (12:59 +0800)]
staging: greybus: camera: simplify NULL test

Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for consistency.
Coccinelle semantic patch used:

@@
identifier func;
expression x;
statement Z;
@@

x = func(...);

if (
(
+ !
x
- == NULL
|
+ !
- NULL ==
x
)
   ) Z

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: most: replace MOST_CH_ISOC_AVP with MOST_CH_ISOC
Andrey Shvetsov [Wed, 21 Sep 2016 12:49:10 +0000 (14:49 +0200)]
staging: most: replace MOST_CH_ISOC_AVP with MOST_CH_ISOC

This patch replaces the enum value MOST_CH_ISOC_AVP with the more
appropriate MOST_CH_ISOC.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: most: clean up configuration strings
Christian Gromm [Wed, 21 Sep 2016 12:49:09 +0000 (14:49 +0200)]
staging: most: clean up configuration strings

This patch adds the strings 'rx', 'tx' and 'isoc' to the list of accepted
identifiers when setting up a channel configuration. To keep consistency it
removes the prefix "dir_" from strings returned by the attributes
set_direction and available_directions and it removes the suffix "_avp"
from the string "isoc_avp" returned by the attributes set_datatype and
available_datatypes.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: most: core: remove trailing zero from text property
Andrey Shvetsov [Wed, 21 Sep 2016 12:49:08 +0000 (14:49 +0200)]
staging: most: core: remove trailing zero from text property

This patch removes trailing zeros from the strings returned by the
attributes available_datatypes and available_directions.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: most: make function most_submit_mbo return void
Christian Gromm [Wed, 21 Sep 2016 12:49:05 +0000 (14:49 +0200)]
staging: most: make function most_submit_mbo return void

Function most_submit_mbo() causes an exception only if either the pointer
mbo or mbo->context equals NULL. From the underlying architecture's point
of view both cases must _not_ come true and would happen only, if something
has tampered with the pointers. This would render runtime code unable to
recover anyway. So, instead trying to hide that things are already
critically out of control we're better off with a WARN_ON() assertion.

This patch replaces the return type of the function most_submit_mbo() with
'void' and adds a WARN_ONCE() assertion. Additionally, code calling the
function is adapted accordingly.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wlan-ng: fixed block comment formatting
Juliana Rodrigues [Thu, 22 Sep 2016 03:24:40 +0000 (00:24 -0300)]
staging: wlan-ng: fixed block comment formatting

This patch fixes a checkpatch warning in
a block comment by adapting it to the community
preferred coding style.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wlan-ng: fixed alignment not matching
Juliana Rodrigues [Thu, 22 Sep 2016 05:49:50 +0000 (02:49 -0300)]
staging: wlan-ng: fixed alignment not matching

This patch fixes a checkpatch warning by moving
arguments to the right and aligning them to their open
parenthesis.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wlan-ng: fixed parenthesis alignment
Juliana Rodrigues [Thu, 22 Sep 2016 05:50:56 +0000 (02:50 -0300)]
staging: wlan-ng: fixed parenthesis alignment

This patch fixes a checkpatch warning by moving
arguments to the right and aligning them to the open
parenthesis above.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wlan-ng: fixed block comment trailing
Juliana Rodrigues [Thu, 22 Sep 2016 06:01:28 +0000 (03:01 -0300)]
staging: wlan-ng: fixed block comment trailing

Moved trailing */ to a new line and added * to subsequent lines on a
block comment.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: add maintainer for greybus platform drivers
Vaibhav Hiremath [Wed, 21 Sep 2016 10:58:13 +0000 (16:28 +0530)]
staging: greybus: add maintainer for greybus platform drivers

Add Vaibhav Hiremath as a Maintainer of Greybus platform
drivers.

Signed-off-by: Vaibhav Hiremath <hvaibhav.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: fix up camera Kconfig dependancies
Greg Kroah-Hartman [Wed, 21 Sep 2016 10:35:13 +0000 (12:35 +0200)]
staging: greybus: fix up camera Kconfig dependancies

CONFIG_MEDIA is not a thing, but CONFIG_MEDIA_SUPPORT is, so use that.

Reported-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: include: remove unused ULTRA_CHANNELCLI_STRING
David Kershner [Tue, 20 Sep 2016 20:29:02 +0000 (16:29 -0400)]
staging: unisys: include: remove unused ULTRA_CHANNELCLI_STRING

The inline ULTRA_CHANNELCLI_STRING is not being used so remove it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: include: remove unused spar_channel_client_release_os
David Kershner [Tue, 20 Sep 2016 20:29:01 +0000 (16:29 -0400)]
staging: unisys: include: remove unused spar_channel_client_release_os

The function spar_channel_client_release_os is not being
used so remove it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: include: remove unused spar_channel_client_acquire_os
David Kershner [Tue, 20 Sep 2016 20:29:00 +0000 (16:29 -0400)]
staging: unisys: include: remove unused spar_channel_client_acquire_os

The function spar_channel_client_acquire_os is not being used so
remove it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: include: remove unused function pathname_last_n_nodes
David Kershner [Tue, 20 Sep 2016 20:28:59 +0000 (16:28 -0400)]
staging: unisys: include: remove unused function pathname_last_n_nodes

The function pathname_last_n_nodes is not used, get rid of it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visorhba: remove prototypes for visorhba_main.c
David Kershner [Tue, 20 Sep 2016 17:14:05 +0000 (13:14 -0400)]
staging: unisys: visorhba: remove prototypes for visorhba_main.c

Remove not needed prototypes in visorhba.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: remove poll_for_irq prototype
David Kershner [Tue, 20 Sep 2016 15:42:06 +0000 (11:42 -0400)]
staging: unisys: visornic: remove poll_for_irq prototype

Remove poll_for_irq prototype not needed.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: remove visornic_poll prototype
David Kershner [Tue, 20 Sep 2016 15:42:05 +0000 (11:42 -0400)]
staging: unisys: visornic: remove visornic_poll prototype

Remove visornic_poll prototype, because it is not needed.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: remove visornic debugfs protoyptes
David Kershner [Tue, 20 Sep 2016 15:42:04 +0000 (11:42 -0400)]
staging: unisys: visornic: remove visornic debugfs protoyptes

Remove visornic debugfs prototypes, they are not needed.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: remove prototypes
David Kershner [Tue, 20 Sep 2016 15:42:03 +0000 (11:42 -0400)]
staging: unisys: visornic: remove prototypes

Remove unneeded prototypes from visornic_main.c

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: add maintainer for greybus audio protocol driver
Vaibhav Agarwal [Wed, 21 Sep 2016 08:47:05 +0000 (14:17 +0530)]
staging: greybus: add maintainer for greybus audio protocol driver

Add Vaibhav as maintainer of some Greybus Audio protocol drivers.

Signed-off-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ptlrpc: re-export lustre_swab_lov_mds_md
James Simmons [Tue, 20 Sep 2016 17:31:09 +0000 (13:31 -0400)]
staging: lustre: ptlrpc: re-export lustre_swab_lov_mds_md

Being over zealous in removing unused EXPORT_SYMBOLs the function
lustre_swab_lov_mds_md exports were removed. They need to be
exported so this patch restores those EXPORT_SYMBOLS. Same
mistake was done when porting to the upstream client.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/14545
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6486
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: greybus: add Viresh as maintainer of few greybus protocol drivers
Viresh Kumar [Wed, 21 Sep 2016 06:40:16 +0000 (12:10 +0530)]
staging: greybus: add Viresh as maintainer of few greybus protocol drivers

Add Viresh Kumar as Maintainer of some of the Greybus protocol drivers.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rts5208: Remove space after cast
Rehas Sachdeva [Tue, 20 Sep 2016 11:16:24 +0000 (16:46 +0530)]
staging: rts5208: Remove space after cast

Removes unnecessary space after a cast. Issue found by checkpatch.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rts5208: Use BIT(x) macro
Rehas Sachdeva [Tue, 20 Sep 2016 11:16:05 +0000 (16:46 +0530)]
staging: rts5208: Use BIT(x) macro

Replaces left shift operation (1 << x) by BIT(x). Issue found by checkpatch.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rts5208: Put constant on right side of comparison
Rehas Sachdeva [Tue, 20 Sep 2016 11:15:48 +0000 (16:45 +0530)]
staging: rts5208: Put constant on right side of comparison

Replaces position of constant from left to right side of a comparison.
Additionally, modifies logical continuations to be on the previous line and
fixes alignment to match open parenthesis. Issues found by checkpatch.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rts5208: Fix indentation
Rehas Sachdeva [Tue, 20 Sep 2016 11:15:33 +0000 (16:45 +0530)]
staging: rts5208: Fix indentation

Fixes indentation by removing unnecessary TAB. Issue found by checkpatch.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rts5208: Add spaces around operators
Rehas Sachdeva [Tue, 20 Sep 2016 11:15:04 +0000 (16:45 +0530)]
staging: rts5208: Add spaces around operators

Adds spaces on either side of arithmetic and relational operators like
'-', '<' and '*'. Issue found by checkpatch.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rts5208: Remove unnecessary parentheses
Rehas Sachdeva [Tue, 20 Sep 2016 11:14:51 +0000 (16:44 +0530)]
staging: rts5208: Remove unnecessary parentheses

Removes unnecessary parentheses from an expression of the form &(x).
Issue found by checkpatch.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: Use vma_pages function on vma object instead of explicit computation
sayli karnik [Mon, 19 Sep 2016 21:51:38 +0000 (03:21 +0530)]
staging: comedi: Use vma_pages function on vma object instead of explicit computation

This patch uses vma_pages function on vma object instead of explicit
computation.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: vt6655: baseband: Remove unnecessary space after a cast
Sandhya Bankar [Mon, 19 Sep 2016 12:14:43 +0000 (17:44 +0530)]
Staging: vt6655: baseband: Remove unnecessary space after a cast

No space is necessary after a cast. This issue was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: vt6655: card: Remove unnecessary space after a cast
Sandhya Bankar [Mon, 19 Sep 2016 12:17:21 +0000 (17:47 +0530)]
Staging: vt6655: card: Remove unnecessary space after a cast

No space is necessary after a cast. This issue was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: Add spaces around '|'
Rehas Sachdeva [Mon, 19 Sep 2016 13:56:32 +0000 (19:26 +0530)]
staging: sm750fb: Add spaces around '|'

Adds spaces on either side of a '|'. Issue found by checkpatch.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wlan-ng: Remove unnecessary variable usage
Rehas Sachdeva [Mon, 19 Sep 2016 19:35:54 +0000 (01:05 +0530)]
staging: wlan-ng: Remove unnecessary variable usage

Instead of storing the return value into a variable and then returning it, we
can club the two into a single return statement. This change was made using
the following semantic patch by Coccinelle:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: most: hdm-usb: convert pr_warn() to dev_warn()
Eva Rachel Retuya [Tue, 20 Sep 2016 03:09:05 +0000 (11:09 +0800)]
staging: most: hdm-usb: convert pr_warn() to dev_warn()

Replace pr_warn() call with its respective dev_warn() counterpart.
Semantic patch used to detect and apply the transformation:

@a@
identifier dev;
expression E;
@@

struct device *dev = E;
<+... when != dev == NULL
- pr_warn(
+ dev_warn(dev,
...);
...+>

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: media: cxd2099: replace printk with dev_info
Eva Rachel Retuya [Tue, 20 Sep 2016 07:00:49 +0000 (15:00 +0800)]
staging: media: cxd2099: replace printk with dev_info

Use dev_info() instead of printk(). Majority of the conversion was done
previously on this commit:
011b2aa [media] staging/media: Use dev_ printks in cxd2099/cxd2099.[ch]

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: media: bcm2048: Merge assignment with return
Rehas Sachdeva [Tue, 20 Sep 2016 08:00:24 +0000 (13:30 +0530)]
staging: media: bcm2048: Merge assignment with return

Instead of storing the return value into a variable and then returning it, we
can club the two into a single return statement. This change was made using
the following semantic patch by Coccinelle:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: media: davinci_vpfe: Merge assignment with return
Rehas Sachdeva [Tue, 20 Sep 2016 08:00:47 +0000 (13:30 +0530)]
staging: media: davinci_vpfe: Merge assignment with return

Instead of storing the return value into a variable and then returning it, we
can club the two into a single return statement. This change was made using
the following semantic patch by Coccinelle:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: Add space around operator.
Sandhya Bankar [Mon, 19 Sep 2016 11:30:16 +0000 (17:00 +0530)]
Staging: rts5208: Add space around operator.

Add space around operator. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: rtsx: Use x instead of x != NULL.
Sandhya Bankar [Mon, 19 Sep 2016 09:15:04 +0000 (14:45 +0530)]
Staging: rts5208: rtsx: Use x instead of x != NULL.

Use x instead of x != NULL. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: ms: Use x instead of x != NULL.
Sandhya Bankar [Mon, 19 Sep 2016 09:12:24 +0000 (14:42 +0530)]
Staging: rts5208: ms: Use x instead of x != NULL.

Use x instead of x != NULL. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: rtsx_card.c: Fixed brace style issues
Cathal Mullaney [Sun, 18 Sep 2016 19:08:45 +0000 (20:08 +0100)]
Staging: rts5208: rtsx_card.c: Fixed brace style issues

Fixed several minor brace coding style issues.

Signed-off-by: Cathal Mullaney <chuckleberryfinn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: ks7010: michael_mic: Use "foo *bar" instead of "foo * bar".
Sandhya Bankar [Tue, 20 Sep 2016 07:41:39 +0000 (13:11 +0530)]
Staging: ks7010: michael_mic: Use "foo *bar" instead of "foo * bar".

This issue was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: ks7010: Use "foo *bar" instead of "foo * bar".
Sandhya Bankar [Tue, 20 Sep 2016 07:39:58 +0000 (13:09 +0530)]
Staging: ks7010: Use "foo *bar" instead of "foo * bar".

This issue was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: ks7010: Use "foo *bar" instead of "foo * bar"
Sandhya Bankar [Tue, 20 Sep 2016 06:45:15 +0000 (12:15 +0530)]
Staging: ks7010: Use "foo *bar" instead of "foo * bar"

This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: ks7010: Use sizeof structure *pointer over sizeof structure in kzalloc()
Sandhya Bankar [Tue, 20 Sep 2016 06:25:47 +0000 (11:55 +0530)]
Staging: ks7010: Use sizeof structure *pointer over sizeof structure in kzalloc()

This issue was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: ks7010: Remove unnecessary variable used to store return value
sayli karnik [Sun, 18 Sep 2016 20:16:34 +0000 (01:46 +0530)]
staging: ks7010: Remove unnecessary variable used to store return value

This patch removes an unnecessary variable used to store return values in order
to reduce memory usage.
Done using coccinelle:
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
return
- ret
+ C
;

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: ks7010: fixes typo in ks_hostif.c
Hariharan R [Mon, 19 Sep 2016 00:16:03 +0000 (20:16 -0400)]
staging: ks7010: fixes typo in ks_hostif.c

Fixes typo,
FAILUER -> FAILURE
Recieve -> Receive

Signed-off-by: Hariharan R <hariharanrangasamy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: fsl-mc: Use !x instead of x == NULL.
Sandhya Bankar [Sat, 17 Sep 2016 23:37:21 +0000 (05:07 +0530)]
Staging: fsl-mc: Use !x instead of x == NULL.

Use !x instead of x == NULL. This issue was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: octeon: Add missing of_node_put after calling of_parse_phandle.
Sandhya Bankar [Sun, 18 Sep 2016 17:32:33 +0000 (23:02 +0530)]
Staging: octeon: Add missing of_node_put after calling of_parse_phandle.

of_node_put needs to be called when the device node which is got
from of_parse_phandle is no longer used.
This patch is found by below coccinelle script:

@@
expression e,e1,e2;
@@
*e = of_parse_phandle(...)
... when != of_node_put(e)
    when != true e == NULL
    when != e2 = e
e = e1

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: i4l: act2000: Move assignment out of if statement
sayli karnik [Mon, 19 Sep 2016 14:32:40 +0000 (20:02 +0530)]
staging: i4l: act2000: Move assignment out of if statement

This patch places assignments which are inside the if condition, above it.
Done using coccinelle:

@@
statement s;
expression e;
identifier id;
@@
- if ((id = e))
+ id = e;
+ if (id)
        s

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: i4l: Remove unused variable
Sandhya Bankar [Sun, 18 Sep 2016 19:01:12 +0000 (00:31 +0530)]
Staging: i4l: Remove unused variable

Remove unused variable.

This change is made by below coccinelle script:
@@
type T;
identifier i;
constant C;
@@
(
extern T i;
|
- T i;
  <+... when != i
- i = C;
  ...+>
)

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: i4l: Use !x instead of x == NULL.
Sandhya Bankar [Sun, 18 Sep 2016 00:08:34 +0000 (05:38 +0530)]
Staging: i4l: Use !x instead of x == NULL.

Use !x instead of x == NULL. This issue was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>