platform/kernel/linux-rpi.git
6 years agostaging: mt7621-mmc: Remove variable num form msdc_dma_setup
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:52 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove variable num form msdc_dma_setup

The variable num in msdc_dma_setup is only used for a BUG_ON
statement, so it can be removed by inlining the condition.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused field sglen from msdc_dma
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:51 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused field sglen from msdc_dma

The field sglen from struct msdc_dma is once set and never read, so
remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused field sg from msdc_dma
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:50 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused field sg from msdc_dma

The field sg from struct msdc_dma is once set and never read, so
remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Refactor dma setup process
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:49 +0000 (16:14 +0200)]
staging: mt7621-mmc: Refactor dma setup process

Current code uses two functions for dma setup, msdc_dma_config and
msdc_dma_setup. By now msdc_dma_setup is nearly empty and mainly calls
msdc_dma_config, so the later one can be inline into the first
one. While doing this there is also some refactoring done.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused field mode from msdc_dma
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:48 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused field mode from msdc_dma

The field mode of struct msdc_dma has no remaining use, so remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove DMA basic mode code
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:47 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove DMA basic mode code

The driver currently only uses DMA linked mode and the upstream
driver does the same, so remove the basic mode code.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove register debugging structures
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:46 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove register debugging structures

Current code has structures for all the registers of the device, but
these are never used and there are also masks for all of them, so
these structures do not contain any useful information.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused macro sdr_write8
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:45 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused macro sdr_write8

The macro sdr_write8 is never used, so remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused macro sdr_read8
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:44 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused macro sdr_read8

The macro sdr_read8 is never used, so remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Replace sdr_read32 with readl
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:43 +0000 (16:14 +0200)]
staging: mt7621-mmc: Replace sdr_read32 with readl

The current code uses a macro (sdr_read32) for reading from hardware,
but it is only a readl, so replace it to get nearer to upstream code.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Replace sdr_write32 with writel
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:42 +0000 (16:14 +0200)]
staging: mt7621-mmc: Replace sdr_write32 with writel

The current code uses a macro (sdr_write32) for writing to hardware,
but it is only a writel with switched arguments, so replace it to get
nearer to upstream code.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused macro msdc_rxfifocnt
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:41 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused macro msdc_rxfifocnt

The macro msdc_rxfifocnt is never used, so remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused macro msdc_txfifocnt
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:40 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused macro msdc_txfifocnt

The macro msdc_txfifocnt is never used, so remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused macro msdc_fifo_read32
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:39 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused macro msdc_fifo_read32

The macro msdc_fifo_read32 is never used, so remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused macro msdc_fifo_write32
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:38 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused macro msdc_fifo_write32

The macro msdc_fifo_write32 is never used, so remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused macro msdc_fifo_read8
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:37 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused macro msdc_fifo_read8

The macro msdc_fifo_read8 is never used, so remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused macro msdc_fifo_write8
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:36 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused macro msdc_fifo_write8

The macro msdc_fifo_write8 is never used, so remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused variable in msdc_command_resp
Christian Lütke-Stetzkamp [Sat, 16 Jun 2018 14:14:35 +0000 (16:14 +0200)]
staging: mt7621-mmc: Remove unused variable in msdc_command_resp

The variable resp in msdc_command_resp is once set and never read,
delete it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-pinctrl: replace ENOSYS with better fitting error code
Sergio Paracuellos [Fri, 8 Jun 2018 12:16:34 +0000 (14:16 +0200)]
staging: mt7621-pinctrl: replace ENOSYS with better fitting error code

This commit replaces ENOSYS return with ENOTSUPP silencing the
following checkpatch warning:

WARNING: ENOSYS means 'invalid syscall nr' and nothing else
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-pinctrl: remove unnecessary 'out of memory' message
Sergio Paracuellos [Fri, 8 Jun 2018 12:16:33 +0000 (14:16 +0200)]
staging: mt7621-pinctrl: remove unnecessary 'out of memory' message

Messages when memory allocation fails are not needed at all
and checkpatch script complains about them. Remove one in this
driver code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-pinctrl: replace 'unsigned' types with 'unsigned int'
Sergio Paracuellos [Fri, 8 Jun 2018 12:16:32 +0000 (14:16 +0200)]
staging: mt7621-pinctrl: replace 'unsigned' types with 'unsigned int'

This commit replaces all 'unsigned' type declarations along
the driver code in favour of the preferred one 'unsigned int'.
This also silence checkpatch script warnings about this issue.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-pinctrl: add SPDX identifier
Sergio Paracuellos [Fri, 8 Jun 2018 12:16:31 +0000 (14:16 +0200)]
staging: mt7621-pinctrl: add SPDX identifier

It's good to have SPDX identifiers in driver files to make it easier to
audit the kernel tree for correct licenses.

Fix up the one of staging mt7621-pinctrl file to have a proper SPDX
identifier, based on the license text in the file itself. The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: add SPDX identifiers
Michael Straube [Mon, 25 Jun 2018 21:41:56 +0000 (23:41 +0200)]
staging: rtl8188eu: add SPDX identifiers

This satisfies a checkpatch warning and is the preferred
method for notating the license.

The SPDX identifier is a legally binding shorthand, which
can be used instead of the full boiler plate text.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192u: Correction of spelling mistake in comment.
John Whitmore [Sun, 24 Jun 2018 15:34:54 +0000 (16:34 +0100)]
staging: rtl8192u: Correction of spelling mistake in comment.

Simple spelling correction.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192u: Correct if statement - Coding Style
John Whitmore [Sun, 24 Jun 2018 15:34:53 +0000 (16:34 +0100)]
staging: rtl8192u: Correct if statement - Coding Style

Corrected the coding style of if statement.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192u: Remove braces from single statement blocks - Style
John Whitmore [Sun, 24 Jun 2018 15:34:52 +0000 (16:34 +0100)]
staging: rtl8192u: Remove braces from single statement blocks - Style

Removed the unrequired braces from single statement blocks - Coding Style.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192u: Truncate block comments to 80 character length - Style
John Whitmore [Sun, 24 Jun 2018 15:34:50 +0000 (16:34 +0100)]
staging: rtl8192u: Truncate block comments to 80 character length - Style

Where possible truncation of block comments to the 80 character length
preferred by the coding style.

In a previous version of this commit some of the comments were contentious so
those have not been touched in this version.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192u: Correct indentation of switch statement - Coding Style
John Whitmore [Sun, 24 Jun 2018 15:34:48 +0000 (16:34 +0100)]
staging: rtl8192u: Correct indentation of switch statement - Coding Style

Removed an extra indentation from the code of the various case options in a
switch statement.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192u: change block comments to prefered style - Coding Style
John Whitmore [Sun, 24 Jun 2018 15:34:47 +0000 (16:34 +0100)]
staging: rtl8192u: change block comments to prefered style - Coding Style

Some of the comment blocks are commening out code so have been left for the
moment.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging:rtl8192e Cleanup comparison to NULL
Janani Sankara Babu [Mon, 18 Jun 2018 16:05:45 +0000 (12:05 -0400)]
Staging:rtl8192e Cleanup comparison to NULL

This patch replaces the comparison of var to NULL with !var

Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging:rtl8192e Fix Comparison to true is error prone
Janani Sankara Babu [Mon, 18 Jun 2018 16:05:29 +0000 (12:05 -0400)]
Staging:rtl8192e Fix Comparison to true is error prone

This patch removes the comaprison to bool value in the code

Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging:rtl8192e Fix Comparison to False is error prone
Janani Sankara Babu [Mon, 18 Jun 2018 16:05:09 +0000 (12:05 -0400)]
Staging:rtl8192e Fix Comparison to False is error prone

This patch removes comparison to False and boolean values in the code
which can be written as !var

Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agortl8192u/rtl819x_BAProc.c: Adjust spaces to coding guidelines
Fabian Bläse [Sun, 17 Jun 2018 21:02:31 +0000 (23:02 +0200)]
rtl8192u/rtl819x_BAProc.c: Adjust spaces to coding guidelines

This patch improves spacing according to the coding guidelines,
mainly around braces.

This patch fixes errors reported by checkpatch.

Signed-off-by: Fabian Bläse <fabian.blaese@fau.de>
Signed-off-by: Maximilian Ott <maximilian.o.ott@fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agortl8192u/rtl819x_Qos.h: Adjust spaces to coding guidelines
Fabian Bläse [Sun, 17 Jun 2018 21:02:30 +0000 (23:02 +0200)]
rtl8192u/rtl819x_Qos.h: Adjust spaces to coding guidelines

This patch improves spacing according to the coding guidelines,
mainly around braces.

This patch fixes errors reported by checkpatch.

Signed-off-by: Fabian Bläse <fabian.blaese@fau.de>
Signed-off-by: Maximilian Ott <maximilian.o.ott@fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: Fix a possible sleep-in-atomic-context bug in rtw_disassoc_cmd()
Jia-Ju Bai [Wed, 20 Jun 2018 10:01:19 +0000 (18:01 +0800)]
staging: rtl8188eu: Fix a possible sleep-in-atomic-context bug in rtw_disassoc_cmd()

The driver may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.16.7 are:

[FUNC] kzalloc(GFP_KERNEL)
drivers/staging/rtl8188eu/core/rtw_cmd.c, 502:
kzalloc in rtw_disassoc_cmd
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c, 256:
rtw_disassoc_cmd in rtw_set_802_11_ssid
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c, 235:
spin_lock_bh in rtw_set_802_11_ssid

[FUNC] kzalloc(GFP_KERNEL)
drivers/staging/rtl8188eu/core/rtw_cmd.c, 502:
kzalloc in rtw_disassoc_cmd
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c, 352:
rtw_disassoc_cmd in rtw_set_802_11_infrastructure_mode
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c, 336:
spin_lock_bh in rtw_set_802_11_infrastructure_mode

To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.

This bug is found by my static analysis tool (DSAC-2) and checked by
my code review.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge tag 'iio-for-4.19a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Mon, 25 Jun 2018 23:47:37 +0000 (07:47 +0800)]
Merge tag 'iio-for-4.19a' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First set of IIO new device support, features and cleanups in the 4.19 cycle

The usual mixed bunch.  Particular good to see is the generic
touch screen driver.  Will be interesting to see if this works
for other ADCs without major changes.

Core features
* Channel types
  - New position relative channel type primarily for touch screen
    sensors to feed the generic touchscreen driver.

New device support
* ad5586
  - Add support for the AD5311R DAC.

* Generic touch screen driver as an IIO consumer.
  - Note this is in input, but due to dependencies is coming through
    the IIO tree.
  - Specific support for this added to the at91-sama5d2 ADC.
  - Various necessary DT bindings added.

Staging Drops
* ADIS16060 gyro
  - A device with a very odd interface that was never cleanly supported.
    It's now very difficult to get, so unlikely it'll ever be fixed up.

Cleanups and minor features and fixes
* core
  - Fix y2038 timestamp issues now the core support is in place.
* 104-quad-8
  - Provide some defines for magic numbers to help readability.
  - Fix an off by one error in register selection
* ad7606
  - Put in a missing function parameter name in a prototype.
* adis16023
  - Use generic sign_extend function rather than local version.
* adis16240
  - Use generic sign_extend funciton rather than local version.
* at91-sama5d2
  - Drop dependency on HAS_DMA now this is handled elsewhere.  Will
    improve build test coverage.
  - Add oversampling ratio control.  Note there is a minor ABI change
    here to increase the apparent depth to 14 bits so as to allow
    for transparent provision of different oversampling ratios that
    drop the actual bit depth to 13 or 12 bits.
* hx711
  - Add a MAINTAINERS entry for this device.
* inv_mpu6050
  - Replace the timestamp fifo 'special' code with generic timestamp
    handling.
  - Switch to using local store of timestamp divider rather than rate
    as that is more helpful for accurate time measurement.
  - Fix an unaligned access that didn't seem to be causing any trouble.
  - Use the fifo overflow bit to track the overflow status rather than
    a software counter.
  - New timestamping mechanism to deal with missed sample interrupts.
* stm32-adc
  - Drop HAS_DMA build dependency.
* sun4i-gpadc
  - Select REGMAP_IRQ a very rarely hit build issue fix.

6 years agoiio: adc: at91-sama5d2_adc: add support for oversampling resolution
Eugen Hristev [Thu, 21 Jun 2018 07:56:21 +0000 (10:56 +0300)]
iio: adc: at91-sama5d2_adc: add support for oversampling resolution

This implements oversampling support for the SAMA5d2 ADC device.
Enabling oversampling : OSR can improve resolution from 12 bits to
13 or 14 bits.
Changing the channel specification to have 14 bits, and we shift the value
1 bit to the left if we have oversampling for just one extra bit, and two
bits to the left if we have no oversampling (old support).
From this commit on, the converted values for all the voltage channels
change to 14 bits real data, with most insignificant two bits always zero
if oversampling is not enabled.
sysfs object oversampling_ratio has been enabled and
oversampling_ratio_available will list possible values (1 or 4 or 16) having
1 as default (no oversampling, 1 sample for each conversion).
Special care was required for the triggered buffer scenario (+ DMA), to
adjust the values accordingly.
Touchscreen measurements supported by this driver are not affected by
oversampling, they are still on 12 bits (scale handing is already included
in the driver).

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: use timespec64 based interfaces for iio_get_time_ns()
Arnd Bergmann [Mon, 18 Jun 2018 15:31:36 +0000 (17:31 +0200)]
iio: use timespec64 based interfaces for iio_get_time_ns()

We have replacements for all the deprecated timespec based interfaces now,
so this can finally convert iio_get_time_ns() to consistently use the
nanosecond or timespec64 based interfaces instead, avoiding the y2038
overflow.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging:iio:accel:adis16240: sign extend function replace hard code duplication
Karim Eshapa [Mon, 18 Jun 2018 17:44:50 +0000 (19:44 +0200)]
staging:iio:accel:adis16240: sign extend function replace hard code duplication

Use sign_extend32 kernel function instead of code duplication,
Safe also for 16 bit. and remove declaration of bits variable not needed.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: Remove depends on HAS_DMA in case of platform dependency
Geert Uytterhoeven [Fri, 22 Jun 2018 11:05:01 +0000 (13:05 +0200)]
iio: adc: Remove depends on HAS_DMA in case of platform dependency

Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
In most cases this other symbol is an architecture or platform specific
symbol, or PCI.

Generic symbols and drivers without platform dependencies keep their
dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
cannot work anyway.

This simplifies the dependencies, and allows to improve compile-testing.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: hx711: add maintainer for driver
Andreas Klinger [Sat, 23 Jun 2018 18:55:18 +0000 (20:55 +0200)]
iio: hx711: add maintainer for driver

add a maintainer for driver hx711

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoStaging: comedi: comedi_compat32.h: fixed missing or malformed SPDX-License-Identifier
ankit patel [Fri, 15 Jun 2018 18:42:13 +0000 (13:42 -0500)]
Staging: comedi: comedi_compat32.h: fixed missing or malformed SPDX-License-Identifier

Fixed SPDX-License-Identifier comment on first line

Signed-off-by: ankit patel <ankit.mayurbhai.patel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: comedi: comedi_pci.h: fixed missing or malformed SPDX-License-Identifier
ankit patel [Fri, 15 Jun 2018 18:42:14 +0000 (13:42 -0500)]
Staging: comedi: comedi_pci.h: fixed missing or malformed SPDX-License-Identifier

Fixed SPDX-License-Identifier comment on first line

Signed-off-by: ankit patel <ankit.mayurbhai.patel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: comedi: comedi_pcmcia.h: fixed missing or malformed SPDX-License-Identifier
ankit patel [Fri, 15 Jun 2018 18:42:15 +0000 (13:42 -0500)]
Staging: comedi: comedi_pcmcia.h: fixed missing or malformed SPDX-License-Identifier

Fixed SPDX-License-Identifier comment on first line

Signed-off-by: ankit patel <ankit.mayurbhai.patel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: comedi: comedilib.h: fixed missing or malformed SPDX-License-Identifier
ankit patel [Fri, 15 Jun 2018 18:42:16 +0000 (13:42 -0500)]
Staging: comedi: comedilib.h: fixed missing or malformed SPDX-License-Identifier

Fixed SPDX-License-Identifier comment on first line

Signed-off-by: ankit patel <ankit.mayurbhai.patel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: comedi: comedi.h: fixed missing or malformed SPDX-License-Identifier
ankit patel [Fri, 15 Jun 2018 18:42:12 +0000 (13:42 -0500)]
Staging: comedi: comedi.h: fixed missing or malformed SPDX-License-Identifier

Fixed SPDX-License-Identifier comment on first line

Signed-off-by: ankit patel <ankit.mayurbhai.patel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: goldfish: Fix checkpatch CHECK in goldfish_audio.c
Roman Kiryanov [Fri, 15 Jun 2018 22:57:21 +0000 (15:57 -0700)]
staging: goldfish: Fix checkpatch CHECK in goldfish_audio.c

Fix "CHECK: Alignment should match open parenthesis"

Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: goldfish: Clear audio read buffer status after each read
Joshua Lang [Mon, 4 Jun 2018 21:08:22 +0000 (14:08 -0700)]
staging: goldfish: Clear audio read buffer status after each read

The buffer_status field is interrupt updated. After every read request,
the buffer_status read field should be reset so that on the next loop
iteration we don't read a stale value and read data before the
device is ready.

Signed-off-by: Joshua Lang <joshualang@google.com>
Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: goldfish: Enable ACPI-based enumeration for goldfish audio
Yu Ning [Mon, 4 Jun 2018 21:08:21 +0000 (14:08 -0700)]
staging: goldfish: Enable ACPI-based enumeration for goldfish audio

Add an ACPI id to make goldfish audio to support ACPI enumeration.

Signed-off-by: Yu Ning <yu.ning@intel.com>
Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: goldfish: Replace read and write macros with functions
Roman Kiryanov [Mon, 4 Jun 2018 21:08:19 +0000 (14:08 -0700)]
staging: goldfish: Replace read and write macros with functions

Functions are less error-prone and generate cleaner compilation.

Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: drop test
Julia Lawall [Wed, 6 Jun 2018 23:34:02 +0000 (01:34 +0200)]
staging: rtl8723bs: drop test

The test selects between two identical values, so it doesn't look useful.
It turns out that the tested expression can only be true anyway, so drop
the test, the corresponding parameter, and the corresponding argument at
the only call site.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e,e1;
@@

* e ? e1 : e1
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: Fix "Alwyas"->"Always"
Sabin Mihai Rapan [Sat, 2 Jun 2018 09:04:14 +0000 (11:04 +0200)]
staging: rtlwifi: Fix "Alwyas"->"Always"

Trivial fix to spelling mistake in comment text.

Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: Fix "writen"->"written"
Sabin Mihai Rapan [Sat, 2 Jun 2018 09:04:13 +0000 (11:04 +0200)]
staging: rtlwifi: Fix "writen"->"written"

Trivial fix to spelling mistake in comment text.

Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: Fix "Trafic"->"Traffic"
Sabin Mihai Rapan [Sat, 2 Jun 2018 09:04:12 +0000 (11:04 +0200)]
staging: rtlwifi: Fix "Trafic"->"Traffic"

Trivial fix to spelling mistake in comment text.

Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: make a couple of pointers static
Colin Ian King [Wed, 6 Jun 2018 08:06:00 +0000 (09:06 +0100)]
staging: vc04_services: make a couple of pointers static

The pointers vchiq_dbg_dir and vchiq_dbg_clients are local to the
source and do not need to be in global scope, so make them static.

Cleans up sparse warnings:
warning: symbol 'vchiq_dbg_dir' was not declared. Should it be static?
warning: symbol 'vchiq_dbg_clients' was not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Update driver to use drm_dev_register.
Fabio Rafael da Rosa [Mon, 4 Jun 2018 02:24:45 +0000 (23:24 -0300)]
staging: vboxvideo: Update driver to use drm_dev_register.

The use of load and unload hooks is deprecated. DRM drivers should
use drm_dev_alloc|drm_dev_init and drm_dev_register for initialization
and publishing.

Signed-off-by: Fabio Rafael da Rosa <fdr@pid42.net>
Reviewed-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: move 'txq_spinlock_flags' from 'wilc' structure to local variable
Ajay Singh [Mon, 4 Jun 2018 05:29:10 +0000 (10:59 +0530)]
staging: wilc1000: move 'txq_spinlock_flags' from 'wilc' structure to local variable

Cleanup patch to remove 'txq_spinlock_flags' element in 'wilc' and used
local variable 'flag' in wilc_wlan_txq_filter_dup_tcp_ack().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove 'rxq_entries' from 'wilc' struct
Ajay Singh [Mon, 4 Jun 2018 05:29:09 +0000 (10:59 +0530)]
staging: wilc1000: remove 'rxq_entries' from 'wilc' struct

Removed unnecessary 'rxq_entries' element from 'wilc' struct, as its
value is not used.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: use list_head to maintain 'rxq_entry_t elements in rx queue
Ajay Singh [Mon, 4 Jun 2018 05:29:08 +0000 (10:59 +0530)]
staging: wilc1000: use list_head to maintain 'rxq_entry_t elements in rx queue

Make use of 'list_head' data structure to maintain the rx buffer queue.
Modified wilc_wlan_rxq_add() to add the element at the tail by using
list_head API and wilc_wlan_rxq_remove() to remove the element from
head.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: use list_head to maintain 'txq_entry_t' elements of tx queue
Ajay Singh [Mon, 4 Jun 2018 05:29:07 +0000 (10:59 +0530)]
staging: wilc1000: use list_head to maintain 'txq_entry_t' elements of tx queue

Use list_head data structure for the doubly linked list instead of own
implementation.
Only 'txq_head' is required, so removed the txq_tail pointer from
'wilc' structure.

Following functions are modified to provide data using list_head API's
wilc_wlan_txq_remove()
wilc_wlan_txq_remove_from_head()
wilc_wlan_txq_add_to_tail()
wilc_wlan_txq_add_to_head()
wilc_wlan_txq_get_first()
wilc_wlan_txq_get_next()

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: gdm724x: use match_string() helper
Yisheng Xie [Wed, 6 Jun 2018 02:21:11 +0000 (10:21 +0800)]
Staging: gdm724x: use match_string() helper

match_string() returns the index of an array for a matching string,
which can be used instead of open coded variant.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Quytelda Kahja <quytelda@tamalin.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rts5208: add error handling into rtsx_probe
Anton Vasilyev [Wed, 13 Jun 2018 17:34:43 +0000 (20:34 +0300)]
staging: rts5208: add error handling into rtsx_probe

If rtsx_probe() fails to allocate dev->chip, then release_everything()
will crash on uninitialized dev->cmnd_ready complete.

Patch adds error handling into rtsx_probe.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: clocking-wizard: prefer 'help' in Kconfig
Kyle Buzby [Mon, 11 Jun 2018 03:09:30 +0000 (22:09 -0500)]
staging: clocking-wizard: prefer 'help' in Kconfig

Fixes the checkpatch warning:

WARNING: prefer 'help' over '---help---' for new help texts
+config COMMON_CLK_XLNX_CLKWZRD

Signed-off-by: Kyle Buzby <kyle.buzby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192u: remove redundant variables
Kenneth Lu [Sun, 10 Jun 2018 08:17:52 +0000 (16:17 +0800)]
staging: rtl8192u: remove redundant variables

Clean up W=1 warning: variable set but not used.

Signed-off-by: Kenneth Lu <kuohsianglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: remove unnecessary parentheses - Coding Style
John Whitmore [Fri, 8 Jun 2018 13:01:37 +0000 (14:01 +0100)]
staging: rtl8192e: remove unnecessary parentheses - Coding Style

Remove unneccessary parentheses, and removed unnecessary (void *) cast

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Optimise Comparison to NULL tests - Coding Style
John Whitmore [Wed, 6 Jun 2018 11:40:02 +0000 (12:40 +0100)]
staging: rtl8192e: Optimise Comparison to NULL tests - Coding Style

Change comparison to NULL to better adhere to coding standard.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Correct declaration of HTResetIOTSetting - Coding Style
John Whitmore [Wed, 6 Jun 2018 11:40:01 +0000 (12:40 +0100)]
staging: rtl8192e: Correct declaration of HTResetIOTSetting - Coding Style

Declaration of function was spread over three lines.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Remove unrequired space at start of line - Coding Style
John Whitmore [Wed, 6 Jun 2018 11:40:00 +0000 (12:40 +0100)]
staging: rtl8192e: Remove unrequired space at start of line - Coding Style

Function HTIOTActIsDisableMCS14 contained spurious space at start of line.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Correct alignment of if statements - Coding Style
John Whitmore [Wed, 6 Jun 2018 11:39:59 +0000 (12:39 +0100)]
staging: rtl8192e: Correct alignment of if statements - Coding Style

Function HTIOTPeerDetermine used incorrect indentation in if statements.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Remove unnecessary return statements - Coding style
John Whitmore [Wed, 6 Jun 2018 11:39:58 +0000 (12:39 +0100)]
staging: rtl8192e: Remove unnecessary return statements - Coding style

Return statments from void functions are not required by the coding standard.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Addition of prefered spacing - Coding style
John Whitmore [Wed, 6 Jun 2018 11:39:57 +0000 (12:39 +0100)]
staging: rtl8192e: Addition of prefered spacing - Coding style

Added spaces around various operators, as preferred by coding style.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Add and remove blank lines - Coding style
John Whitmore [Wed, 6 Jun 2018 11:39:56 +0000 (12:39 +0100)]
staging: rtl8192e: Add and remove blank lines - Coding style

Simple addition & removal of blank lines as required

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: fix race condition in pi433_ioctl
Hugo Lefeuvre [Thu, 14 Jun 2018 01:04:38 +0000 (21:04 -0400)]
staging: pi433: fix race condition in pi433_ioctl

In the PI433_IOC_WR_TX_CFG case in pi433_ioctl, instance->tx_cfg is
modified via

copy_from_user(&instance->tx_cfg, argp, sizeof(struct pi433_tx_cfg)))

without any kind of synchronization. In the case where two threads
would execute this same command concurrently the tx_cfg field might
enter in an inconsistent state.

Additionally: if ioctl(PI433_IOC_WR_TX_CFG) and write() execute
concurrently the tx config might be modified while it is being
copied to the fifo, resulting in potential data corruption.

Fix: Get instance->tx_cfg_lock before modifying tx config in the
PI433_IOC_WR_TX_CFG case in pi433_ioctl.

Also, do not copy data directly from user space to instance->tx_cfg.
Instead use a temporary buffer allowing future checks for correctness
of copied data and simpler code.

Signed-off-by: Hugo Lefeuvre <hle@owl.eu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-pci: Fix coding style error
Abdun Nihaal [Sat, 9 Jun 2018 13:07:42 +0000 (18:37 +0530)]
staging: mt7621-pci: Fix coding style error

This patch removes space after * to fix the following checkpatch error:

ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-spi: Remove unnecessary braces {} from single statement if block.
Sankalp Negi [Sat, 2 Jun 2018 18:37:31 +0000 (00:07 +0530)]
staging: mt7621-spi: Remove unnecessary braces {} from single statement if block.

The patch fixes following checkpatch.pl issue:
WARNING : braces {} are not necessary for single statement blocks

Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-spi: Add a space before open paranthesis.
Sankalp Negi [Sat, 2 Jun 2018 18:37:30 +0000 (00:07 +0530)]
staging: mt7621-spi: Add a space before open paranthesis.

The patch fixes following checkpatch.pl issue:
ERROR : space required before the open parenthesis

Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-spi: Use tabs for indentation instead of spaces.
Sankalp Negi [Sat, 2 Jun 2018 18:37:29 +0000 (00:07 +0530)]
staging: mt7621-spi: Use tabs for indentation instead of spaces.

The patch fixes following checkpatch.pl issue:
ERROR : code indent should use tabs where possible

Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-spi: Fix line over 80 characters by refactoring.
Sankalp Negi [Sat, 2 Jun 2018 18:37:28 +0000 (00:07 +0530)]
staging: mt7621-spi: Fix line over 80 characters by refactoring.

The patch fixes following checkpatch.pl issue:
WARNING : line over 80 characters

Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-spi: Indent case labels and switch at the same level.
Sankalp Negi [Sat, 2 Jun 2018 18:37:27 +0000 (00:07 +0530)]
staging: mt7621-spi: Indent case labels and switch at the same level.

The patch fixes following checkpatch.pl issue:
ERROR : switch and case should be at the same indent

Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-dts: convert to gpio-keys
NeilBrown [Wed, 6 Jun 2018 22:04:21 +0000 (08:04 +1000)]
staging: mt7621-dts: convert to gpio-keys

Now that gpio-interrupts work correctly, we
can use gpio-keys instead of gpio-keys-polled
for the single push-button on the gbpc-1.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-dts: correct various clock frequencies.
NeilBrown [Wed, 6 Jun 2018 22:04:21 +0000 (08:04 +1000)]
staging: mt7621-dts: correct various clock frequencies.

The MT7621 documentation says that the sys clock - also known
as OCP clock for the Open Core Protocol - can be configured to
1/3 or 1/4 of the CPU clock.
Testing on my hardware, using the fact that the SPI clock is
based on the OCP clock and measuring transfer rates, shows
a clock of a little over 200MHz with a CPU clock of 900MHz.
So assume 1/4 is the default.

Also, the nor-flash in the gbpc1 is documented as accepting 50MHz
for request requests, and higher for other requests.  So set
maximum to 50MHz.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-spi: revised half-duplex message handling
NeilBrown [Wed, 6 Jun 2018 22:04:21 +0000 (08:04 +1000)]
staging: mt7621-spi: revised half-duplex message handling

The mt7621 SPI engine has a 32 byte buffer and the driver
currently only allows 32-byte read requests and 36 bytes writes
(there is a 4byte op/addr buffer).

This is an unnecessary limitation.  As the SPI clock is controlled
by the host it is quite acceptable to send a larger message in
multiple smaller transactions.  As long as Chip Select is kept asserted
the whole time, the SPI engine can be run multiple times for
a single SPI message.

This patch factors out the transaction logic and calls for each
transfer in the message.  A write transfer might leave bytes in the
buffer to be combined with a following read transfer, as this is
a common pattern.

With this in place, we can remove the current max_transfer_size limit.

In testing, this increases the read throughput for a NOR flash chip
from 1.4MB/s to 2.3MB/s, a 50% improvement.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-spi: change mt7621_spi_wait_till_ready to take struct mt7621_spi
NeilBrown [Wed, 6 Jun 2018 22:04:21 +0000 (08:04 +1000)]
staging: mt7621-spi: change mt7621_spi_wait_till_ready to take struct mt7621_spi

All callers have a 'struct mt7621_spi' and that is all
mt7621_spi_wait_till_ready() needs.  So just pass it
instead of the spi_device.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-pci: use rt_sysc_?32() to access system-control register.
NeilBrown [Wed, 6 Jun 2018 22:04:20 +0000 (08:04 +1000)]
staging: mt7621-pci: use rt_sysc_?32() to access system-control register.

This driver currently has internal knowledge ofthe address
of system-control registers and accesses them by dereferencing
a constant pointer.

It is cleaner to use rt_sysc_r32(), rt_sysc_w32(), rt_sysc_m32()
which is a more standard interface.
So change the defined names to offsets instead of pointers,
and use these functions.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: speakup: refactor synths array to use a list
Justin Skists [Mon, 4 Jun 2018 09:52:12 +0000 (10:52 +0100)]
staging: speakup: refactor synths array to use a list

The synths[] array is a collection of synths acting like a list.
There is no need for synths to be an array, so refactor synths[] to use
standard kernel list_head API, instead, and modify the usages to suit.
As a side-effect, the maximum number of synths has also become redundant.

Signed-off-by: Justin Skists <justin.skists@juzza.co.uk>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: Improved readability of function comedi_nsamples_left.
Chris Opperman [Wed, 13 Jun 2018 17:14:35 +0000 (19:14 +0200)]
staging: comedi: Improved readability of function comedi_nsamples_left.

Improve readability of comedi_nsamples_left:
a) Reduce nesting by using more return statements.
b) Declare variables scans_left and samples_left at start of function.
c) Change type of scans_Left to unsigned long long to avoid cast.

Signed-off-by: Chris Opperman <eklikeroomys@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: drivers: ni_mio_common: add names to function pointer parameters.
Giulio Benetti [Tue, 12 Jun 2018 14:54:09 +0000 (16:54 +0200)]
staging: comedi: drivers: ni_mio_common: add names to function pointer parameters.

Checkpatch.pl complains about packbits function pointer that lacks
parameters name.

Add parameter names to packbits function pointer.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: drivers: cb_pcimdda: fix warning on quoted string split across lines.
Giulio Benetti [Tue, 12 Jun 2018 14:54:08 +0000 (16:54 +0200)]
staging: comedi: drivers: cb_pcimdda: fix warning on quoted string split across lines.

Checkpatch.pl complains about "quoted string split across lines" for
string in MODULE_DESCRIPTION().

Put string on only one line.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: drivers: daqboard2000: make bool bit-field unsigned int bit-fields.
Giulio Benetti [Tue, 12 Jun 2018 14:50:33 +0000 (16:50 +0200)]
staging: comedi: drivers: daqboard2000: make bool bit-field unsigned int bit-fields.

Checkpatch complains on bool bitfields to be an int or u8/u16/u32
bitfield.

Make bool bit-fields to be unsigned int bit-fields.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: drivers: amplc_pci230: make bool bit-field unsigned int bit-fields.
Giulio Benetti [Tue, 12 Jun 2018 14:50:32 +0000 (16:50 +0200)]
staging: comedi: drivers: amplc_pci230: make bool bit-field unsigned int bit-fields.

Checkpatch complains on bool bitfields to be an int or u8/u16/u32
bitfield.

Make bool bit-fields to be unsigned int bit-fields.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: drivers: amplc_dio200_common: make bool bit-field unsigned int bit...
Giulio Benetti [Tue, 12 Jun 2018 14:50:31 +0000 (16:50 +0200)]
staging: comedi: drivers: amplc_dio200_common: make bool bit-field unsigned int bit-fields.

Checkpatch complains on bool bitfields to be an int or u8/u16/u32
bitfield.

Make bool bit-fields to be unsigned int bit-fields.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: drivers: amplc_dio200: make bool bit-field unsigned int bit-fields.
Giulio Benetti [Tue, 12 Jun 2018 14:50:30 +0000 (16:50 +0200)]
staging: comedi: drivers: amplc_dio200: make bool bit-field unsigned int bit-fields.

Checkpatch complains on bool bitfields to be an int or u8/u16/u32
bitfield.

Make bool bit-fields to be unsigned int bit-fields.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: comedidev: make bool bit-field unsigned int bit-fields.
Giulio Benetti [Tue, 12 Jun 2018 14:50:29 +0000 (16:50 +0200)]
staging: comedi: comedidev: make bool bit-field unsigned int bit-fields.

Checkpatch complains on bool bitfields to be an int or u8/u16/u32
bitfield.

Make bool bit-fields to be unsigned int bit-fields.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: comedi_fops: make bool bit-field unsigned int bit-fields.
Giulio Benetti [Tue, 12 Jun 2018 14:50:28 +0000 (16:50 +0200)]
staging: comedi: comedi_fops: make bool bit-field unsigned int bit-fields.

Checkpatch complains on bool bitfields to be an int or u8/u16/u32
bitfield.

Make bool bit-fields to be unsigned int bit-fields.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoLinux 4.18-rc1
Linus Torvalds [Sat, 16 Jun 2018 23:04:49 +0000 (08:04 +0900)]
Linux 4.18-rc1

6 years agoMerge tag 'for-linus-20180616' of git://git.kernel.dk/linux-block
Linus Torvalds [Sat, 16 Jun 2018 20:37:55 +0000 (05:37 +0900)]
Merge tag 'for-linus-20180616' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "A collection of fixes that should go into -rc1. This contains:

   - bsg_open vs bsg_unregister race fix (Anatoliy)

   - NVMe pull request from Christoph, with fixes for regressions in
     this window, FC connect/reconnect path code unification, and a
     trace point addition.

   - timeout fix (Christoph)

   - remove a few unused functions (Christoph)

   - blk-mq tag_set reinit fix (Roman)"

* tag 'for-linus-20180616' of git://git.kernel.dk/linux-block:
  bsg: fix race of bsg_open and bsg_unregister
  block: remov blk_queue_invalidate_tags
  nvme-fabrics: fix and refine state checks in __nvmf_check_ready
  nvme-fabrics: handle the admin-only case properly in nvmf_check_ready
  nvme-fabrics: refactor queue ready check
  blk-mq: remove blk_mq_tagset_iter
  nvme: remove nvme_reinit_tagset
  nvme-fc: fix nulling of queue data on reconnect
  nvme-fc: remove reinit_request routine
  blk-mq: don't time out requests again that are in the timeout handler
  nvme-fc: change controllers first connect to use reconnect path
  nvme: don't rely on the changed namespace list log
  nvmet: free smart-log buffer after use
  nvme-rdma: fix error flow during mapping request data
  nvme: add bio remapping tracepoint
  nvme: fix NULL pointer dereference in nvme_init_subsystem
  blk-mq: reinit q->tag_set_list entry only after grace period

6 years agoMerge tag 'docs-broken-links' of git://linuxtv.org/mchehab/experimental
Linus Torvalds [Sat, 16 Jun 2018 20:25:18 +0000 (05:25 +0900)]
Merge tag 'docs-broken-links' of git://linuxtv.org/mchehab/experimental

Pull documentation fixes from Mauro Carvalho Chehab:
 "This solves a series of broken links for files under Documentation,
  and improves a script meant to detect such broken links (see
  scripts/documentation-file-ref-check).

  The changes on this series are:

   - can.rst: fix a footnote reference;

   - crypto_engine.rst: Fix two parsing warnings;

   - Fix a lot of broken references to Documentation/*;

   - improve the scripts/documentation-file-ref-check script, in order
     to help detecting/fixing broken references, preventing
     false-positives.

  After this patch series, only 33 broken references to doc files are
  detected by scripts/documentation-file-ref-check"

* tag 'docs-broken-links' of git://linuxtv.org/mchehab/experimental: (26 commits)
  fix a series of Documentation/ broken file name references
  Documentation: rstFlatTable.py: fix a broken reference
  ABI: sysfs-devices-system-cpu: remove a broken reference
  devicetree: fix a series of wrong file references
  devicetree: fix name of pinctrl-bindings.txt
  devicetree: fix some bindings file names
  MAINTAINERS: fix location of DT npcm files
  MAINTAINERS: fix location of some display DT bindings
  kernel-parameters.txt: fix pointers to sound parameters
  bindings: nvmem/zii: Fix location of nvmem.txt
  docs: Fix more broken references
  scripts/documentation-file-ref-check: check tools/*/Documentation
  scripts/documentation-file-ref-check: get rid of false-positives
  scripts/documentation-file-ref-check: hint: dash or underline
  scripts/documentation-file-ref-check: add a fix logic for DT
  scripts/documentation-file-ref-check: accept more wildcards at filenames
  scripts/documentation-file-ref-check: fix help message
  media: max2175: fix location of driver's companion documentation
  media: v4l: fix broken video4linux docs locations
  media: dvb: point to the location of the old README.dvb-usb file
  ...

6 years agoMerge tag 'fsnotify_for_v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 16 Jun 2018 20:06:18 +0000 (05:06 +0900)]
Merge tag 'fsnotify_for_v4.18-rc1' of git://git./linux/kernel/git/jack/linux-fs

Pull fsnotify updates from Jan Kara:
 "fsnotify cleanups unifying handling of different watch types.

  This is the shortened fsnotify series from Amir with the last five
  patches pulled out. Amir has modified those patches to not change
  struct inode but obviously it's too late for those to go into this
  merge window"

* tag 'fsnotify_for_v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  fsnotify: add fsnotify_add_inode_mark() wrappers
  fanotify: generalize fanotify_should_send_event()
  fsnotify: generalize send_to_group()
  fsnotify: generalize iteration of marks by object type
  fsnotify: introduce marks iteration helpers
  fsnotify: remove redundant arguments to handle_event()
  fsnotify: use type id to identify connector object type

6 years agoMerge tag 'fbdev-v4.18' of git://github.com/bzolnier/linux
Linus Torvalds [Sat, 16 Jun 2018 20:00:24 +0000 (05:00 +0900)]
Merge tag 'fbdev-v4.18' of git://github.com/bzolnier/linux

Pull fbdev updates from Bartlomiej Zolnierkiewicz:
 "There is nothing really major here, few small fixes, some cleanups and
  dead drivers removal:

   - mark omapfb drivers as orphans in MAINTAINERS file (Tomi Valkeinen)

   - add missing module license tags to omap/omapfb driver (Arnd
     Bergmann)

   - add missing GPIOLIB dependendy to omap2/omapfb driver (Arnd
     Bergmann)

   - convert savagefb, aty128fb & radeonfb drivers to use msleep & co.
     (Jia-Ju Bai)

   - allow COMPILE_TEST build for viafb driver (media part was reviewed
     by media subsystem Maintainer)

   - remove unused MERAM support from sh_mobile_lcdcfb and shmob-drm
     drivers (drm parts were acked by shmob-drm driver Maintainer)

   - remove unused auo_k190xfb drivers

   - misc cleanups (Souptick Joarder, Wolfram Sang, Markus Elfring, Andy
     Shevchenko, Colin Ian King)"

* tag 'fbdev-v4.18' of git://github.com/bzolnier/linux: (26 commits)
  fb_omap2: add gpiolib dependency
  video/omap: add module license tags
  MAINTAINERS: make omapfb orphan
  video: fbdev: pxafb: match_string() conversion fixup
  video: fbdev: nvidia: fix spelling mistake: "scaleing" -> "scaling"
  video: fbdev: fix spelling mistake: "frambuffer" -> "framebuffer"
  video: fbdev: pxafb: Convert to use match_string() helper
  video: fbdev: via: allow COMPILE_TEST build
  video: fbdev: remove unused sh_mobile_meram driver
  drm: shmobile: remove unused MERAM support
  video: fbdev: sh_mobile_lcdcfb: remove unused MERAM support
  video: fbdev: remove unused auo_k190xfb drivers
  video: omap: Improve a size determination in omapfb_do_probe()
  video: sm501fb: Improve a size determination in sm501fb_probe()
  video: fbdev-MMP: Improve a size determination in path_init()
  video: fbdev-MMP: Delete an error message for a failed memory allocation in two functions
  video: auo_k190x: Delete an error message for a failed memory allocation in auok190x_common_probe()
  video: sh_mobile_lcdcfb: Delete an error message for a failed memory allocation in two functions
  video: sh_mobile_meram: Delete an error message for a failed memory allocation in sh_mobile_meram_probe()
  video: fbdev: sh_mobile_meram: Drop SUPERH platform dependency
  ...

6 years agostaging:iio:accel:adis16203: sign extend function rather code duplication
Karim Eshapa [Tue, 12 Jun 2018 16:48:38 +0000 (18:48 +0200)]
staging:iio:accel:adis16203: sign extend function rather code duplication

Use sign_extend32 kernel function instead of code duplication.
This function is also safe for 16 bits.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>