platform/kernel/linux-starfive.git
6 years agostaging: lustre: discard cfs_block_sigsinv()
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: discard cfs_block_sigsinv()

cfs_block_sigsinv() and cfs_restore_sigs() are simple
wrappers which save a couple of line of code and
hurt readability for people not familiar with them.
They aren't used often enough to be worthwhile,
so discard them and open-code the functionality.

The sigorsets() call isn't needed as or-ing with current->blocked is
exactly what sigprocmask(SIG_BLOCK) does.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: move LERRCHKSUM() to libcfs_debug.h
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: move LERRCHKSUM() to libcfs_debug.h

This macro is only used for debug messages, so use
it to the debug code.
Also improve the documentation slightly.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: discard CFS_TICK
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: discard CFS_TICK

This undocumented macro seems to represent "a small amount of time".
Sometimes it is used as-is, some times it is multiplied by 5 for no
obvious reason.
It does not appear that there is any connection between the different
places it is used - they all just want a short period for different
purposes and of different durarions.

So discard CFS_TICK and lets each use-site just use whatever number
of jiffies seems appropriate in that case.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: discard LOWEST_BIT_SET()
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: discard LOWEST_BIT_SET()

This macro is only used once to test if a value is
a power of two.  So use is_power_of_2() instead and
discard the macro.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: discard cfs_cap_t, use kernel_cap_t
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: discard cfs_cap_t, use kernel_cap_t

lustre only sends 32bits of capabilities in on-the-wire RPC calls.
It current strips off higher bits and uses a 32bit cfs_cap_t
throughout.
Though there is a small memory cost, it is cleaner to use
kernel_cap_t throughout and only truncate when marshalling
data for RPC calls.

So this patch replaces cfs_cap_t with kernel_cap_t throughout,
and where a cfs_cap_t was previous stored in a __u32, we now
store cap.cap[0] instead.

With this, we can remove include/linux/libcfs/curproc.h

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: simplify capability dropping.
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: simplify capability dropping.

Lustre has a 'squash credentials' concept similar to the "anon_uid"
for nfsd.  When accessing a file with squashed credentials, we
need to also drop capabilities.
Linux has cap_drop_fs_set() and cap_drop_nfsd_set().  Rather than
taking a completely different approach, this patch changes lustre
to use this same cap_drop_*_set() approach.

With this change we also drop CAP_MKNOD and CAP_MAC_OVERRIDE
which are probably appropriate, and don't drop
CAP_SYS_ADMIN or CAP_SYS_BOOT which should be irrelevant for
file permission checking

Calling both cap_drop_*_set() seems a bit clumsy, but gets
the job done.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove current_pid() and current_comm()
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: remove current_pid() and current_comm()

Just use current->pid and current->comm directly, instead
of having wrappers.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove conditional compilation from libcfs_cpu.c
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: remove conditional compilation from libcfs_cpu.c

libcfs_cpu.c manages CPU partitions.  In the !CONFIG_SMP case, most
of this disappears and 'static inline's from libcfs_cpu.h are used.
However we still allocate a 'struct cfs_cpt_table' and keep some
dummy data in it.  This is a bit pointless.

This patch removes all the !CONFIG_SMP code from libcfs_cpu.c and
conditionally compiles the whole file only when CONFIG_SMP.
We no longer allocate a 'struct cfs_cpt_table' on !CONFIG_SMP,
and don't even declare a structure.  The name "cfs_cpt_tab"
becomes always "NULL", which allows some code to be optimized away.

This means that cfs_cpt_tab can sometimes be NULL, so we need to
discard the assertion that it isn't.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: rename cfs_cpt_table to cfs_cpt_tab
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: rename cfs_cpt_table to cfs_cpt_tab

The variable "cfs_cpt_table" has the same name as
the structure "struct cfs_cpt_table".
This makes it hard to use #define to make one disappear
on a uni-processor build, but keep the other.
So rename the variable to cfs_cpt_tab.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: move files out of lustre/lnet/libcfs/linux/
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: move files out of lustre/lnet/libcfs/linux/

There is no longer any value in having this separate
subdirectory, so promote the files in it.
Also tidy the Makefile a little to use the common "*-obj-y"
macro name.  This will allow individual files to be conditionally
compiled.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: refactor libcfs initialization.
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: refactor libcfs initialization.

Many lustre modules depend on libcfs having initialized
properly, but do not explicit check that it did.
When lustre is built as discrete modules, this does not
cause a problem because if the libcfs module fails
initialization, the other modules don't even get loaded.

When lustre is compiled into the kernel, all module_init()
routines get run, so they need to check the required initialization
succeeded.

This patch splits out the initialization of libcfs into a new
libcfs_setup(), and has all modules call that.

The misc_register() call is kept separate as it does not allocate any
resources and if it fails, it fails hard - no point in retrying.
Other set-up allocates resources and so is best delayed until they
are needed, and can be worth retrying.

Ideally, the initialization would happen at mount time (or similar)
rather than at load time.  Doing this requires each module to
check dependencies when they are activated rather than when
they are loaded.  Achieving that is a much larger job that would
have to progress in stages.

For now, this change ensures that if some initialization in libcfs
fails, other modules will fail-safe.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: osc: tidy up osc_init()
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: osc: tidy up osc_init()

A module_init() function that registers the services
of the module should do that last, after all other
initialization has succeeded.
This patch moves the class_register_type() call to the
end and ensures everything else that might have been
set up, is cleaned up on error.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: comedidev.h: Fix SPDX-License-Identifier tag style
Nishad Kamdar [Thu, 24 May 2018 17:44:40 +0000 (23:14 +0530)]
staging: comedi: comedidev.h: Fix SPDX-License-Identifier tag style

Replace // SPDX-License-Identifier: GPL-2.0+ by
/* SPDX-License-Identifier: GPL-2.0+ */ as per licensing rule
for C header files. Issue found by checkpatch. Part of
Eudyptula Challenge.

Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge tag 'iio-for-4.18b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Fri, 25 May 2018 16:07:31 +0000 (18:07 +0200)]
Merge tag 'iio-for-4.18b' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Second set of new device support, features and cleanup for IIO in the 4.18 cycle

Usual mixture of new devices support and other stuff.  A couple of
staging graduations in here and some old driver drops.

New device support
* ad5686
  - Add support for AD5691R, AD5692R, AD5693 and AD5693R i2c DACs
  - Add support for AD5681R, AD5682R, AD5683 and AD5683R SPI DACs
* lmp91000
  - Add ID for LMP91002
* stm32-dfsdm
  - Add support for the stm32mp1 devices.

Drivers dropped
* ADE7753
  - No longer easily available, no users came forward and needs a lot
    of work to move out of staging.
* ADE7754
* ADE7758
* ADE7759

Staging graduations
- ad2s1200 - good cleanup from David Veenstra.
- tsl2772 (was tsl2x7x) - Brian's quest is at an end and
  staging/iio/light is no more!

Features
* tools
  - loop forever on a negative number of loops being specified.
* ltc 2632
  - add of_match_table
  - support an external reference regulator.
* mag3110
  - Support continuous mode when running fast as it increases the
    posssible sampling rate.
* ti-ads8688
  - Add trigger and buffer support to this ADC.

Cleanups / minor tweaks.
* tools
  - tidy up types in iio_generic_buffer.
* ad2s1200
  - Whitespace cleanup.
  - Drop pointless initializations.
  - Improve kernel docs.
  - Reorder to setup the SPI prior to device registration (race fix).
  - Change to modern gpiod framework.
  - Drop platform data and move to DT bindings. There are no in
    kernel users of the platform data. Any out of tree boards will
    need changes.
  - Add an explicit compatible table.
  - Provide _scale for angular velocity and angle channels.
  - Add David Veenstra to copyright notice as this cleanup was non
    trivial.
* ade8366
  - Avoid a race by ensuring channel init is before registration
    with the subsystem.
* afe
  - binding spelling fix.
* imx7d-adc
  - typo fix in Freescale
* inv_mpu6050
  - tidy up an ugly loop to take advantage of known entry condition.
  - add a comment explaining why the sensible sampling frequencies
    are more limited than might be immediately apparent (aliasing).
* mma8452
  - reduce the sleep time on data not ready when running at high
    frequency.
* stm32-dfsdm
  - add missing header.
* tsl2583
  - fix integration_time_availabe which was in microsecs rather the
    millisecs.
* tsl2x7x/tsl2772
  - Whitespace cleanup.
  - Change to direct returns where sensible.
  - Turn the chip off in the registration error path.
  - Use macro to reduce repition when setting up the device_info
    structures.
  - Change the _available attributes over to read_avail callback,
    and the range definitions that supports.
  - Fix some wrong period values.
  - Add some range checkign for _write_raw.
  - Rename the driver to tsl2772 to avoid wild card clash problems
    in future.

6 years agoiio: imu: inv_mpu6050: add comment about frequencies
Martin Kelly [Mon, 21 May 2018 18:41:54 +0000 (11:41 -0700)]
iio: imu: inv_mpu6050: add comment about frequencies

Although the driver allows frequencies between 4 and 1000 Hz, only the
frequencies advertised in the available frequencies file are backed
properly by a low-pass filter to prevent aliasing, so it's best to use
them. Since this is not obvious to the user, add a comment explaining
what's going on.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: dac: Add support for external reference voltage through the regulator framework.
Silvan Murer [Mon, 21 May 2018 12:21:28 +0000 (14:21 +0200)]
iio: dac: Add support for external reference voltage through the regulator framework.

Signed-off-by: Silvan Murer <silvan.murer@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: dac: fix missing of_match_table assignment in the LTC 2632 device
Silvan Murer [Mon, 21 May 2018 12:21:27 +0000 (14:21 +0200)]
iio: dac: fix missing of_match_table assignment in the LTC 2632 device

Signed-off-by: Silvan Murer <silvan.murer@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: fix spelling mistake: "Freeacale" -> "Freescale"
Colin Ian King [Mon, 21 May 2018 09:16:54 +0000 (10:16 +0100)]
iio: adc: fix spelling mistake: "Freeacale" -> "Freescale"

Trivial fix to spelling mistake in module description text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: amplifiers: ad8366: move channel init before iio_device_register()
Alexandru Ardelean [Mon, 21 May 2018 06:40:05 +0000 (09:40 +0300)]
iio: amplifiers: ad8366: move channel init before iio_device_register()

Otherwise a race condition can occur, where userspace can start operations
before the channels have been properly initialized.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agotools: iio: iio_generic_buffer: allow continuous looping
Martin Kelly [Fri, 18 May 2018 00:14:46 +0000 (17:14 -0700)]
tools: iio: iio_generic_buffer: allow continuous looping

Sometimes it's useful to stream samples forever, such as when
stress-testing a driver overnight to check for memory leaks or other
issues. When the program receives a signal, it will gracefully cleanup,
so it is still safe to terminate at any time.

Add support for specifying a negative -c option, meaning that we should
loop forever. To do so, we need to use a long long (instead of just
long) for num_loops so that current code specifying num_loops greater
than UNSIGNED_LONG_MAX doesn't break.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agotools: iio: iio_generic_buffer: fix types to match
Martin Kelly [Fri, 18 May 2018 00:14:45 +0000 (17:14 -0700)]
tools: iio: iio_generic_buffer: fix types to match

Several types are mismatched and causing implicit conversions.  Fix them
up so the types match.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: rtl8192e: Add blank space before '(' - coding style.
John Whitmore [Fri, 18 May 2018 17:17:06 +0000 (18:17 +0100)]
staging: rtl8192e: Add blank space before '(' - coding style.

Corrected coding style issue:
"ERROR: space required before the open parenthesis '('"

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Remove blank space before ', ' - coding style.
John Whitmore [Fri, 18 May 2018 17:17:04 +0000 (18:17 +0100)]
staging: rtl8192e: Remove blank space before ', ' - coding style.

Corrected coding style issue: "ERROR: space prohibited before that ','"

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: avoid casting inside cpu_to_* assignments
Sergio Paracuellos [Wed, 16 May 2018 11:25:55 +0000 (13:25 +0200)]
staging: ks7010: avoid casting inside cpu_to_* assignments

cpu_to_*() functions already have a cast to u* built in,
so the cast is never required. Review and remove all of
them along the code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: fix spelling mistake: "Eanable" -> "Enable"
Colin Ian King [Fri, 18 May 2018 10:03:59 +0000 (11:03 +0100)]
staging: mt7621-mmc: fix spelling mistake: "Eanable" -> "Enable"

Trivial fix to spelling mistake in N_MSG message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: fix coding style issues in p80211netdev.c
Tim Collier [Wed, 16 May 2018 07:53:05 +0000 (08:53 +0100)]
staging: wlan-ng: fix coding style issues in p80211netdev.c

Fix 2 "Alignment should match open parenthesis" messages issued by
checkpatch.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: fix coding style issues in p80211netdev.h
Tim Collier [Tue, 15 May 2018 07:44:27 +0000 (08:44 +0100)]
staging: wlan-ng: fix coding style issues in p80211netdev.h

Fix two issues with parameters not aligned to opening parenthesis, as
reported by checkpatch. File is now clean for checkpatch.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: goldfish: Kconfig: fixed code style issue
ankit patel [Wed, 16 May 2018 20:04:34 +0000 (15:04 -0500)]
Staging: goldfish: Kconfig: fixed code style issue

Style fix: config GOLDFISH_AUDIO containing "--help--" to "help"

Signed-off-by: ankit patel <ankit.mayurbhai.patel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoDelete the goldfish_nand driver.
Roman Kiryanov [Tue, 15 May 2018 20:58:45 +0000 (13:58 -0700)]
Delete the goldfish_nand driver.

This driver was inherited from qemu1 and not used anymore.

Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:iio:meter: Drop ADE7759 driver
Jonathan Cameron [Sat, 12 May 2018 17:51:04 +0000 (18:51 +0100)]
staging:iio:meter: Drop ADE7759 driver

I announced the intent to drop some of these meter drivers
on the IIO list last cycle. This device is obsolete and not easily
obtained.  No one has come forward with suitable test hardware and
the driver would need a lot of work to move out of staging.

As such I am dropping it.  We can always bring it back again
if a user / tester emerges in the future.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging:iio:meter: Drop ADE7758 driver
Jonathan Cameron [Sat, 12 May 2018 17:51:03 +0000 (18:51 +0100)]
staging:iio:meter: Drop ADE7758 driver

I announced the intent to drop some of these meter drivers
on the IIO list last cycle. This device is obsolete and not easily
obtained.  No one has come forward with suitable test hardware and
the driver would need a lot of work to move out of staging.

As such I am dropping it.  We can always bring it back again
if a user / tester emerges in the future.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging:iio:meter: Drop ADE7754 driver
Jonathan Cameron [Sat, 12 May 2018 17:51:02 +0000 (18:51 +0100)]
staging:iio:meter: Drop ADE7754 driver

I announced the intent to drop some of these meter drivers
on the IIO list last cycle. This device is obsolete and not easily
obtained.  No one has come forward with suitable test hardware and
the driver would need a lot of work to move out of staging.

As such I am dropping it.  We can always bring it back again
if a user / tester emerges in the future.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging:iio:meter: Drop ADE7753 driver
Jonathan Cameron [Sat, 12 May 2018 17:51:01 +0000 (18:51 +0100)]
staging:iio:meter: Drop ADE7753 driver

I announced the intent to drop some of these meter drivers
on the IIO list last cycle. This device is obsolete and not easily
obtained.  No one has come forward with suitable test hardware and
the driver would need a lot of work to move out of staging.

As such I am dropping it.  We can always bring it back again
if a user / tester emerges in the future.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Move driver out of staging
David Veenstra [Fri, 18 May 2018 18:23:40 +0000 (20:23 +0200)]
staging: iio: ad2s1200: Move driver out of staging

Move the iio driver for the ad2s1200 and ad2s1205 resolver-to-digital
converter out of staging, into mainline iio subsystems.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Add copyright
David Veenstra [Fri, 18 May 2018 18:23:25 +0000 (20:23 +0200)]
staging: iio: ad2s1200: Add copyright

Add David Veenstra as a copyright holders and as an author,
for all of the staging clean ups of the ad2s1200 driver.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Add scaling factor for angle channel
David Veenstra [Fri, 18 May 2018 18:23:14 +0000 (20:23 +0200)]
staging: iio: ad2s1200: Add scaling factor for angle channel

A scaling factor of approximately 2 * Pi / (2^12 -1) is added,
to scale the 12-bits angular position to radians.

A return type of IIO_VAL_INT_PLUS_NANO is used, so that the scale of
both the angle channel and angular velocity channel has 7 significant
digits.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Add scaling factor for angular velocity channel
David Veenstra [Fri, 18 May 2018 18:23:01 +0000 (20:23 +0200)]
staging: iio: ad2s1200: Add scaling factor for angular velocity channel

The sysfs iio ABI states radians per second is expected as the unit for
angular velocity, but the 12-bit angular velocity register has
revolution per seconds as its unit. So a scaling factor of approximately
2 * Pi is added to the angular velocity channel.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Add dt table
David Veenstra [Fri, 18 May 2018 18:22:41 +0000 (20:22 +0200)]
staging: iio: ad2s1200: Add dt table

Add device tree table for matching with the vendor ID.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Replace platform data with dt bindings
David Veenstra [Fri, 18 May 2018 18:22:32 +0000 (20:22 +0200)]
staging: iio: ad2s1200: Replace platform data with dt bindings

Remove usage of platform data, and replace it with device tree
facilities.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Replace legacy gpio API with modern API
David Veenstra [Fri, 18 May 2018 18:21:56 +0000 (20:21 +0200)]
staging: iio: ad2s1200: Replace legacy gpio API with modern API

The legacy, integer based gpio API is replaced with the modern
descriptor based API.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Setup spi before iio device register
David Veenstra [Fri, 18 May 2018 18:21:44 +0000 (20:21 +0200)]
staging: iio: ad2s1200: Setup spi before iio device register

The spi should be set up before the device is registered as an iio
device.

This patch moves the setup to before the device registration.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Add kernel docs to driver state
David Veenstra [Fri, 18 May 2018 18:21:34 +0000 (20:21 +0200)]
staging: iio: ad2s1200: Add kernel docs to driver state

Add missing kernel docs to the ad2s1200 driver state.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Remove unneeded initializations
David Veenstra [Fri, 18 May 2018 18:21:23 +0000 (20:21 +0200)]
staging: iio: ad2s1200: Remove unneeded initializations

Remove 2 initializations which are unneeded, because the
initialized values are never used.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Remove unneeded newline in license
David Veenstra [Fri, 18 May 2018 18:21:06 +0000 (20:21 +0200)]
staging: iio: ad2s1200: Remove unneeded newline in license

Remove unneeded newline in license, as it does not improve readability.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio:dac:ad5686: Add AD5681R/AD5682R/AD5683/AD5683R support
Stefan Popa [Fri, 18 May 2018 15:23:34 +0000 (18:23 +0300)]
iio:dac:ad5686: Add AD5681R/AD5682R/AD5683/AD5683R support

The AD5681R/AD5682R/AD5683/AD5683R are a family of one channel DACs with
12-bit, 14-bit and 16-bit precision respectively. The devices have either
no built-in reference, or built-in 2.5V reference.

These devices are similar to AD5691R/AD5692R/AD5693/AD5693R except
with a few notable differences:
 * they use the SPI interface instead of I2C
 * in the write control register, DB18 and DB17 are used for setting the
   power mode, while DB16 is the REF bit. This is why a new regmap type
   was defined and checked accordingly.
 * the shift register is 24 bits wide, the first four bits are the command
   bits followed by the data bits. As the data comprises of 20-bit, 18-bit
   or 16-bit input code, this means that 4 LSB bits are don't care. This is
   why the data needs to be shifted on the left with four bits. Therefore,
   AD5683_REGMAP is checked inside a switch case in the ad5686_spi_write()
   function. On the other hand, similar devices such as AD5693R family,
   have the 4 MSB command bits followed by 4 don't care bits.

Datasheet:
http://www.analog.com/media/en/technical-documentation/data-sheets/AD5683R_5682R_5681R_5683.pdf

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio:dac:ad5686: Add AD5691R/AD5692R/AD5693/AD5693R support
Stefan Popa [Fri, 18 May 2018 15:22:50 +0000 (18:22 +0300)]
iio:dac:ad5686: Add AD5691R/AD5692R/AD5693/AD5693R support

The AD5691R/AD5692R/AD5693/AD5693R are a family of one channel DACs with
12-bit, 14-bit and 16-bit precision respectively. The devices have either
no built-in reference, or built-in 2.5V reference.

These devices are pretty similar to AD5671R/AD5675R and
AD5694/AD5694R/AD5695R/AD5696/AD5696R, except that they have one channel.
Another difference is that they use a write control register(addr 0x04) for
setting the power down modes and the internal reference instead of separate
registers for each function.

Datasheet:
http://www.analog.com/media/en/technical-documentation/data-sheets/AD5693R_5692R_5691R_5693.pdf

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: stm32-dfsdm: include stm32-dfsdm-adc.h
Fabrice Gasnier [Tue, 15 May 2018 15:19:17 +0000 (17:19 +0200)]
iio: adc: stm32-dfsdm: include stm32-dfsdm-adc.h

Fix the following sparse warnings:
  CHECK   drivers/iio/adc/stm32-dfsdm-adc.c
symbol 'stm32_dfsdm_get_buff_cb' was not declared. Should it be static?
symbol 'stm32_dfsdm_release_buff_cb' was not declared. Should it be static?

BTW, move interrupt.h to sort headers alphabetically.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agodt-bindings: iio: afe: Spelling s/mesaurement/measurement/
Geert Uytterhoeven [Tue, 15 May 2018 13:06:24 +0000 (15:06 +0200)]
dt-bindings: iio: afe: Spelling s/mesaurement/measurement/

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: tsl2583: correct values in integration_time_available
Brian Masney [Sun, 13 May 2018 00:20:39 +0000 (20:20 -0400)]
iio: tsl2583: correct values in integration_time_available

The times reported by the in_illuminance_integration_time_available
sysfs attribute are actually in milliseconds, not microseconds. This
patch corrects the times with the correct unit.

The fixes tag is inaccurate as the issue existed when the driver
was still in staging.   However, lots of changes occured before
it graduated so this is as a good a point as any for backports.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Fixes: f44d5c8ac399 ("staging: iio: tsl2583: move out of staging")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: android: ion: Switch to pr_warn_once in ion_buffer_destroy
Laura Abbott [Mon, 14 May 2018 21:35:09 +0000 (14:35 -0700)]
staging: android: ion: Switch to pr_warn_once in ion_buffer_destroy

Syzbot reported yet another warning with Ion:

WARNING: CPU: 0 PID: 1467 at drivers/staging/android/ion/ion.c:122
ion_buffer_destroy+0xd4/0x190 drivers/staging/android/ion/ion.c:122
Kernel panic - not syncing: panic_on_warn set ...

This is catching that a buffer was freed with an existing kernel mapping
still present. This can be easily be triggered from userspace by calling
DMA_BUF_SYNC_START without calling DMA_BUF_SYNC_END. Switch to a single
pr_warn_once to indicate the error without being disruptive.

Reported-by: syzbot+cd8bcd40cb049efa2770@syzkaller.appspotmail.com
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-gpio: add SPDX identifier
Sergio Paracuellos [Tue, 15 May 2018 04:49:54 +0000 (06:49 +0200)]
staging: mt7621-gpio: 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 gpio-mt7621 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>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-gpio: fix some warnings because of lines exceeded 80 characters
Sergio Paracuellos [Tue, 15 May 2018 04:49:53 +0000 (06:49 +0200)]
staging: mt7621-gpio: fix some warnings because of lines exceeded 80 characters

This patch silence some complains of checkpatch script because
of the use of long lines.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obdclass: change object lookup to no wait mode
Lai Siyao [Tue, 15 May 2018 02:15:48 +0000 (22:15 -0400)]
staging: lustre: obdclass: change object lookup to no wait mode

Currently we set LU_OBJECT_HEARD_BANSHEE on object when we want
to remove object from cache, but this may lead to deadlock, because
when other process lookup such object, it needs to wait for this
object until release (done at last refcount put), while that process
maybe already hold an LDLM lock.

Now that current code can handle dying object correctly, we can just
return such object in lookup, thus the above deadlock can be avoided.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9049
Reviewed-on: https://review.whamcloud.com/26965
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Cliff White <cliff.white@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-eth: Remove unused variable
Kamal Heib [Mon, 14 May 2018 20:20:03 +0000 (23:20 +0300)]
staging: mt7621-eth: Remove unused variable

Remove unused variable 'condition' which was set but not used.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: Remove unused define
Nathan Chancellor [Mon, 14 May 2018 14:03:53 +0000 (07:03 -0700)]
staging: ks7010: Remove unused define

After commit 6d6612deaf55 ("staging: ks7010: Remove unnecessary limit
checks"), this define is not used anywhere. Remove it as well.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Fix checkpatch.pl errors
Sidong Yang [Mon, 14 May 2018 16:26:41 +0000 (16:26 +0000)]
staging: rtl8723bs: Fix checkpatch.pl errors

Move open brace to same line with enum.
Remove prohibited space before ','.

Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: ion: Check return value of ion_buffer_kmap_get
Nathan Chancellor [Mon, 14 May 2018 18:50:44 +0000 (11:50 -0700)]
staging: android: ion: Check return value of ion_buffer_kmap_get

GCC warns that vaddr is set but unused. Check the return value of
ion_buffer_kmap_get to make vaddr useful and make sure everything
is properly configured before beginning a DMA.

Suggested-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: speakup: use true/false instead of 1/0
Samuel Thibault [Mon, 14 May 2018 20:57:25 +0000 (22:57 +0200)]
staging: speakup: use true/false instead of 1/0

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging:Comedi:comedi_compat32.c: Lindent changes
Pratik Jain [Tue, 15 May 2018 05:20:39 +0000 (10:50 +0530)]
Staging:Comedi:comedi_compat32.c: Lindent changes

Recommended indentation by Lindent on file comedi_compat32.c

Signed-off-by: Pratik Jain <pratik.jain0509@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: replace cast type in assignment in hostif_sme_set_pmksa
Sergio Paracuellos [Sun, 13 May 2018 18:35:58 +0000 (20:35 +0200)]
staging: ks7010: replace cast type in assignment in hostif_sme_set_pmksa

There is an assignment inside hostif_sme_set_pmksa function
which is being used together with cpu_to_le16 using uint16_t as cast
type. Replace it to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use 'u16' for casts in assignments in hostif_sme_set_rsn
Sergio Paracuellos [Sun, 13 May 2018 18:35:57 +0000 (20:35 +0200)]
staging: ks7010: use 'u16' for casts in assignments in hostif_sme_set_rsn

There are some assignments inside hostif_sme_set_rsn function
which are being used together with cpu_to_le16 using uint16_t
as cast type. Replace all of them to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change two parameter types in hostif_mic_failure_request
Sergio Paracuellos [Sun, 13 May 2018 18:35:56 +0000 (20:35 +0200)]
staging: ks7010: change two parameter types in hostif_mic_failure_request

Parameters 'failure_count' and 'timer' was declared as unsigned
short and then there was being casted to u16 inside cpu_to_le16
to make the assignation. Just declare them as 'u16' and avoid
casting at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: replace uint* type into the u* ones in hostif_bss_scan_request
Sergio Paracuellos [Sun, 13 May 2018 18:35:55 +0000 (20:35 +0200)]
staging: ks7010: replace uint* type into the u* ones in hostif_bss_scan_request

In function hostif_bss_scan_request parameters 'scan_ssid' and
'scan_ssid_len' are declared as uint8_t. Change them to be 'u8'
instead which is preferred. Also update two casts inside the same
function to use 'u32' instead of 'uint32_t'.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: replace cast types in assignments in hostif_phy_information_request
Sergio Paracuellos [Sun, 13 May 2018 18:35:54 +0000 (20:35 +0200)]
staging: ks7010: replace cast types in assignments in hostif_phy_information_request

There are some assignments inside hostif_phy_information_request
function which are being used together with cpu_to_le16 using
uint16_t as cast type. Replace all of them to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: replace cast type in assignment in hostif_adhoc_set_request
Sergio Paracuellos [Sun, 13 May 2018 18:35:53 +0000 (20:35 +0200)]
staging: ks7010: replace cast type in assignment in hostif_adhoc_set_request

There is an assignment inside hostif_adhoc_set_request function
which is being used together with cpu_to_le16 using uint16_t as cast
type. Replace it to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: replace cast type in assignments in hostif_infrastructure_set_request
Sergio Paracuellos [Sun, 13 May 2018 18:35:52 +0000 (20:35 +0200)]
staging: ks7010: replace cast type in assignments in hostif_infrastructure_set_request

There are some assignments inside hostif_infrastructure_set_request
function which are being used together with cpu_to_le16 using
uint16_t as cast type. Replace all of them to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use u16 as type for casting in hostif_ps_adhoc_set_request
Sergio Paracuellos [Sun, 13 May 2018 18:35:51 +0000 (20:35 +0200)]
staging: ks7010: use u16 as type for casting in hostif_ps_adhoc_set_request

There is an assignment inside hostif_ps_adhoc_set_request function
which is being used together with cpu_to_le16 using uint16_t as cast
type. Replace it to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: replace casts to use type u16 in init_request
Sergio Paracuellos [Sun, 13 May 2018 18:35:50 +0000 (20:35 +0200)]
staging: ks7010: replace casts to use type u16 in init_request

There are soem assignments inside init_request function which
are being used together with cpu_to_le16 using uint16_t as cast
type. Replace all of them to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use u16 as cast type in hostif_start_request
Sergio Paracuellos [Sun, 13 May 2018 18:35:49 +0000 (20:35 +0200)]
staging: ks7010: use u16 as cast type in hostif_start_request

Use u16 as cast type in hostif_start_request function replacing
uint16_t which was being used.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: avoid no needed cast in ks_wlan_cap
Sergio Paracuellos [Sun, 13 May 2018 18:35:48 +0000 (20:35 +0200)]
staging: ks7010: avoid no needed cast in ks_wlan_cap

In ks_wlan_cap there is a cast to uint16_t to use cpu_to_le16
with variable 'capability' which is already defined as u16.
Avoid this cast to clean code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change parameter type in hostif_mib_get_request
Sergio Paracuellos [Sun, 13 May 2018 18:35:47 +0000 (20:35 +0200)]
staging: ks7010: change parameter type in hostif_mib_get_request

Second parameter 'mib_attribute' in function hostif_mib_get_request
is declared as unsigned long and inside the function a cast to uint32_t
is being used. Just pass a u32 instead and avoid the casting.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change some cast type from uint16_t to u16 in hostif_data_request
Sergio Paracuellos [Sun, 13 May 2018 18:35:46 +0000 (20:35 +0200)]
staging: ks7010: change some cast type from uint16_t to u16 in hostif_data_request

There are some castings inside the function hostif_data_request
which are being using with uint16_t type. Fields which have being
assigned are declared as u16. So update casts types to u16 in all
of them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use u16 as type for casting in hostif_data_indication_wpa
Sergio Paracuellos [Sun, 13 May 2018 18:35:45 +0000 (20:35 +0200)]
staging: ks7010: use u16 as type for casting in hostif_data_indication_wpa

Field 'counter' in mic_failure struct is being assigned casting
value using uint16_t. Replace with u16 which is the correct type
of the field and the preferred one.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: replace not standard uint type to unsigned int
Sergio Paracuellos [Sun, 13 May 2018 18:35:44 +0000 (20:35 +0200)]
staging: ks7010: replace not standard uint type to unsigned int

The field 'wakeup_count' in 'ks_wlan_private' struct is declared
as 'uint' which is not a standard type. Replace in favour of
'unsigned int' which it is.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: replace uint8_t with u8 in ks_wlan_set_rx_gain
Sergio Paracuellos [Sun, 13 May 2018 18:35:43 +0000 (20:35 +0200)]
staging: ks7010: replace uint8_t with u8 in ks_wlan_set_rx_gain

In function ks_wlan_set_rx_gain a cast to uint8_t is being used
to assign reception gain. 'rx_gain' field is defined as u8 so
replace the cast to the correct type

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: replace uint8_t with u8 in ks_wlan_set_tx_gain
Sergio Paracuellos [Sun, 13 May 2018 18:35:42 +0000 (20:35 +0200)]
staging: ks7010: replace uint8_t with u8 in ks_wlan_set_tx_gain

In function ks_wlan_set_tx_gain a cast to uint8_t is being used
to assign transmission gain. 'tx_gain' field is defined as u8 so
replace the cast to the correct type.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change uint8_t casts to u8 in ks_wlan_set_rate
Sergio Paracuellos [Sun, 13 May 2018 18:35:41 +0000 (20:35 +0200)]
staging: ks7010: change uint8_t casts to u8 in ks_wlan_set_rate

There are some casts to uint8_t in ks_wlan_set_rate function to
assign values of the bitrate. Just change it to u8 which is the one
defined for the field 'body' of the struct which is in use.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change parameter type in ks_wlan_hw_rx function
Sergio Paracuellos [Sun, 13 May 2018 18:35:40 +0000 (20:35 +0200)]
staging: ks7010: change parameter type in ks_wlan_hw_rx function

The parameter 'size' in function ks_wlan_hw_rx is declared as
uint16_t and can be declared as size_t which makes more sense.
It is being passed to hif_align_size function which also expects
a size_t as parameter so just change its type. Also update two
casts in calls to this function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change cast from uint16_t to u16
Sergio Paracuellos [Sun, 13 May 2018 18:35:39 +0000 (20:35 +0200)]
staging: ks7010: change cast from uint16_t to u16

Header size and event fields of header are declared
as __le16 and being casted using uint16_t in cpu_to_le16.
Change cast to use preferred u16.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: replace unsigned char type with u8
Sergio Paracuellos [Sun, 13 May 2018 18:35:38 +0000 (20:35 +0200)]
staging: ks7010: replace unsigned char type with u8

Variable 'byte' in ks7010_upload_firmware function is declared
as unsigned char and is only being used to read hardware
registers which are expected in sdio_read_byteb function as u8.
Change 'byte' variable type to u8 which is preferred.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: remove no necessary blank line
Sergio Paracuellos [Sun, 13 May 2018 18:35:37 +0000 (20:35 +0200)]
staging: ks7010: remove no necessary blank line

There was two blank lines between definitions and statements
in ks7010_upload_firmware function. Remove one of them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: remove not used definition WPA_CAPABILITY_PREAUTH
Sergio Paracuellos [Sun, 13 May 2018 18:35:36 +0000 (20:35 +0200)]
staging: ks7010: remove not used definition WPA_CAPABILITY_PREAUTH

The WPA_CAPABILITY_PREAUTH definition is not being used at all so
just remove it.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835: Use BIT_ULL macro
Kilian Köppchen [Sun, 13 May 2018 16:21:34 +0000 (18:21 +0200)]
staging: bcm2835: Use BIT_ULL macro

This patch fixes the checkpatch.pl check hint:

CHECK: Prefer using the BIT_ULL macro

Signed-off-by: Kilian Köppchen <kiliankoeppchen@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-eth: Refactor ethtool stats
Kamal Heib [Sat, 12 May 2018 20:40:03 +0000 (23:40 +0300)]
staging: mt7621-eth: Refactor ethtool stats

This patch removes the ugly macro hack to make sure hw_stats and ethtool
strings are consisten, instead define a new struct which will hold the
stat string and his index within the hw_stats struct.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: refactor host_int_parse_assoc_resp_info() to remove unused code
Ajay Singh [Fri, 11 May 2018 08:13:31 +0000 (13:43 +0530)]
staging: wilc1000: refactor host_int_parse_assoc_resp_info() to remove unused code

Remove 'connect_resp_info' structure as most of its elements are not used.

Modified wilc_parse_assoc_resp_info() to directly parse and fill value
in connect_info structure variable. Remove use of 'assoc_resp_len' variable.
get_assoc_resp_cap_info() & get_asoc_id() functions are remove as its
not used anymore.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove s8idxarray to avoid datatype in variable name
Ajay Singh [Fri, 11 May 2018 08:13:30 +0000 (13:43 +0530)]
staging: wilc1000: remove s8idxarray to avoid datatype in variable name

Cleanup patch to have variable names as per linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unused 'lock' varible in 'wilc_priv' structure
Ajay Singh [Fri, 11 May 2018 08:13:29 +0000 (13:43 +0530)]
staging: wilc1000: remove unused 'lock' varible in 'wilc_priv' structure

Cleanup patch to remove the unused variable from 'wilc_priv' structure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: added comments for mutex and spinlock_t
Ajay Singh [Fri, 11 May 2018 08:13:28 +0000 (13:43 +0530)]
staging: wilc1000: added comments for mutex and spinlock_t

Added comments for mutex and spinlock_t to avoid checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove 'flag' argument from wilc_mac_indicate()
Ajay Singh [Fri, 11 May 2018 08:13:27 +0000 (13:43 +0530)]
staging: wilc1000: remove 'flag' argument from wilc_mac_indicate()

Remove 'flag' function parameter in wilc_mac_indicate() as only one
condition was handled using that parameter. Also removed unnecessary
call to wilc_mac_indicate() as no operation was performed in that
function call.
After above changes below macros are not required anymore.
WILC_MAC_INDICATE_STATUS 0x1
WILC_MAC_INDICATE_SCAN 0x2

This changes also helped in resolving the line over 80 chars issue
found by checkatpch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: added #define for setting radiotap header
Ajay Singh [Fri, 11 May 2018 08:13:26 +0000 (13:43 +0530)]
staging: wilc1000: added #define for setting radiotap header

Added new macro to resolve below checkpatch issues in linux_mon.

"Lines should not end with a '('"

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 chars in wilc_sdio struct
Ajay Singh [Fri, 11 May 2018 08:13:25 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars in wilc_sdio struct

Fix line over 80 chars issue found by checkpatch.pl script by placing
the comment message above the macro preprocessor.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: refactor del_station() to avoid parenthesis misalignment
Ajay Singh [Fri, 11 May 2018 08:13:24 +0000 (13:43 +0530)]
staging: wilc1000: refactor del_station() to avoid parenthesis misalignment

Refactor the code to fix open parenthesis alignment issue reported by
checkpatch.pl script in del_station().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename u8security to avoid datatype in variable name
Ajay Singh [Fri, 11 May 2018 08:13:23 +0000 (13:43 +0530)]
staging: wilc1000: rename u8security to avoid datatype in variable name

Cleanup patch to avoid use of datatype in variable name to follow as
per linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 chars issue in connect()
Ajay Singh [Fri, 11 May 2018 08:13:22 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars issue in connect()

Fix line over 80 characters in connect() by using temporary variables.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 chars in scan()
Ajay Singh [Fri, 11 May 2018 08:13:21 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars in scan()

Fix line over 80 characters issues found by checkpatch.pl script with
the help of local variable.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 characters in add_key()
Ajay Singh [Fri, 11 May 2018 08:13:20 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 characters in add_key()

Fix line over 80 character issue found by checkpatch.pl script in
add_key().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 chars in wilc_create_wiphy() declaration
Ajay Singh [Fri, 11 May 2018 08:13:19 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars in wilc_create_wiphy() declaration

Fix line over 80 characters issue found by checkpatch.pl script in
function declaration.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 chars in get_station()
Ajay Singh [Fri, 11 May 2018 08:13:18 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars in get_station()

Fix line over 80 characters issue in get_station().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 chars in wilc_wfi_cfg_tx_vendor_spec()
Ajay Singh [Fri, 11 May 2018 08:13:17 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars in wilc_wfi_cfg_tx_vendor_spec()

Fix line over 80 characters issues reported by checkpatch.pl script in
wilc_wfi_cfg_tx_vendor_spec() by using temporary variable. Simplified
'if else' condition with 'if'.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 charas in wilc_wfi_remain_on_channel_expired()
Ajay Singh [Fri, 11 May 2018 08:13:16 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 charas in wilc_wfi_remain_on_channel_expired()

Refactor wilc_wfi_remain_on_channel_expired() to avoid line over 80
character issue reported by checkpatch.pl script. Also assigned value in the
variable at the time of declaration.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>