platform/kernel/linux-starfive.git
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>
6 years agostaging: wilc1000: use kmemdup instead of kmalloc in add_network_to_shadow()
Ajay Singh [Fri, 11 May 2018 08:13:15 +0000 (13:43 +0530)]
staging: wilc1000: use kmemdup instead of kmalloc in add_network_to_shadow()

Use kmemdup instead of kmalloc & memcpy in add_network_to_shadow(). Also
added  code to set 'ies_len' to zero in case of memory allocation
failure.

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 add_network_to_shadow()
Ajay Singh [Fri, 11 May 2018 08:13:14 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars in add_network_to_shadow()

Fix line over 80 characters issue reported by checkpatch in
add_network_to_shadow() by using temporary variable.

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

Rename clear_duringIP() function to avoid camelCase issue reported by
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: use kmalloc(sizeof(*mgmt_tx)...) in mgmt_tx()
Ajay Singh [Fri, 11 May 2018 08:13:12 +0000 (13:43 +0530)]
staging: wilc1000: use kmalloc(sizeof(*mgmt_tx)...) in mgmt_tx()

Fix below checkpatch issue found in mgmt_tx()

Prefer kmalloc(sizeof(*mgmt_tx)...) over kmalloc(sizeof(struct
p2p_mgmt_data)...)

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: use sizeof(*wdev) to allocate memory in wilc_wfi_cfg_alloc()
Ajay Singh [Fri, 11 May 2018 08:13:11 +0000 (13:43 +0530)]
staging: wilc1000: use sizeof(*wdev) to allocate memory in wilc_wfi_cfg_alloc()

Fix below reported checkpatch issues in wilc_wfi_cfg_alloc().
kzalloc(sizeof(*wdev)...) over kzalloc(sizeof(struct wireless_dev)

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 linux_mon
Ajay Singh [Fri, 11 May 2018 08:13:10 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars in linux_mon

Fix line over 80 char issue reported by 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: replace kmalloc with kmemdup() in handle_connect_timeout()
Ajay Singh [Fri, 11 May 2018 08:13:09 +0000 (13:43 +0530)]
staging: wilc1000: replace kmalloc with kmemdup() in handle_connect_timeout()

Instead of kmalloc and memcpy use kmemdup in handle_connect_timeout().
Also return -ENOMEM incase of failure to allocate the memory.

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 host_int_parse_assoc_resp_info()
Ajay Singh [Fri, 11 May 2018 08:13:08 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars in host_int_parse_assoc_resp_info()

Fix line over 80 characters issue in host_int_parse_assoc_resp_info() by
using shorter name for the 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 host_int_parse_join_bss_param()
Ajay Singh [Fri, 11 May 2018 08:13:07 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 characters in host_int_parse_join_bss_param()

Split host_int_parse_join_bss_param() to avoid the line over 80
character issue reported by 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: fix line over 80 chars issue in host_int_handle_disconnect()
Ajay Singh [Fri, 11 May 2018 08:13:06 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars issue in host_int_handle_disconnect()

Fix line over 80 char issue in host_int_handle_disconnect() by using
temp variable to hold the 'wilc_connect_result' function pointer.

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 issue in handle_connect()
Ajay Singh [Fri, 11 May 2018 08:13:05 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 characters issue in handle_connect()

Fix line over 80 character issue found by checkpatch.pl script by
aligning the input argument in function call.

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 handle_key()
Ajay Singh [Fri, 11 May 2018 08:13:04 +0000 (13:43 +0530)]
staging: wilc1000: fix line over 80 chars in handle_key()

Fix checkpatch reported issue of line over 80 char in handle_key().
Introduced new functions by spliting existing function to address the
checkpatch issue.

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

Remove the use of unnecessary 'ret' variable and use existing 'result'
variable to hold the status. Also changed type of 'result' from s32 to
int to confirm with the function return type.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: added complete() call for error scenario in handle_key()
Ajay Singh [Fri, 11 May 2018 08:13:02 +0000 (13:43 +0530)]
staging: wilc1000: added complete() call for error scenario in handle_key()

During memory allocation failure in handle_key() the complete() was not
called for comp_test_key_block event. So now added the code to call
complete() for event during error scenario.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-eth: Fix quoted string split across lines
Kamal Heib [Wed, 9 May 2018 12:40:11 +0000 (15:40 +0300)]
staging: mt7621-eth: Fix quoted string split across lines

Quoted strings should not be split to help text grep in the source.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-eth: Fix line over 80 characters
Kamal Heib [Wed, 9 May 2018 12:40:10 +0000 (15:40 +0300)]
staging: mt7621-eth: Fix line over 80 characters

This change fixes all the lines that get over 80 characters.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-eth: Prefer unsigned int to bare use of unsigned
Kamal Heib [Wed, 9 May 2018 12:40:09 +0000 (15:40 +0300)]
staging: mt7621-eth: Prefer unsigned int to bare use of unsigned

This commit replaces all the unsigned definitions in favour of 'unsigned
int' which is preferred.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Replace open-coded idr with a struct idr.
Eric Anholt [Fri, 11 May 2018 16:35:15 +0000 (09:35 -0700)]
staging: bcm2835-camera: Replace open-coded idr with a struct idr.

We just need some integer handles that can map back to our message
struct when we're handling a reply, which struct idr is perfect for.

v2: Fix error check to look at the right variable.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Use 'kvfree()' for memory allocated by 'kvzalloc()'
Christophe JAILLET [Sat, 12 May 2018 12:14:26 +0000 (14:14 +0200)]
staging: lustre: Use 'kvfree()' for memory allocated by 'kvzalloc()'

'buf' is allocated with 'kvzalloc()'. 'kvfree()' must be used to free it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Fixes: 11c647caf74b ("staging: lustre: obdclass: variable llog chunk size")
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Fix an error handling path in 'client_common_fill_super()'
Christophe JAILLET [Sat, 12 May 2018 06:33:05 +0000 (08:33 +0200)]
staging: lustre: Fix an error handling path in 'client_common_fill_super()'

According to error handling path before and after this one, we should go
to 'out_md_fid' here, instead of 'out_md', if 'obd_connect()' fails.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: fix spelling mistake: "req_ulinked" -> "req_unlinked"
Colin Ian King [Fri, 11 May 2018 13:38:59 +0000 (14:38 +0100)]
staging: lustre: fix spelling mistake: "req_ulinked" -> "req_unlinked"

Trivial fix to spelling mistake in DEBUG_REQ message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: o2iblnd: Fix crash in kiblnd_handle_early_rxs()
Doug Oucharek [Thu, 10 May 2018 18:07:01 +0000 (11:07 -0700)]
staging: lustre: o2iblnd: Fix crash in kiblnd_handle_early_rxs()

Under upstream staging commit 5a2ca43fa54f561c252c2, the list handling
code in kiblnd_handle_early_rxs() got changed to list_for_each_safe().
That protects against the current thread from deleting the current entry
it is looking at. It does not protect against another thread from deleting
the next item in the list (which the tmp variable points to). The way this
routine holds then releases a lock opens the door to other threads doing
just that.

This patch reverts this commit on this routine.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9886
Fixes: 5a2ca43fa54f ("Staging: lustre: Iterate list using list_for_each_entry")
Signed-off-by: Doug Oucharek <dougso@me.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: speakup: Fix coding style
Samuel Thibault [Sun, 13 May 2018 09:38:30 +0000 (11:38 +0200)]
staging: speakup: Fix coding style

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: video: fix build warnings
Greg Kroah-Hartman [Mon, 14 May 2018 09:34:29 +0000 (11:34 +0200)]
staging: most: video: fix build warnings

Commit 7d7cdb4fa552 ("staging: most: video: remove debugging code") ended up
adding a bunch of build warnings about unused variables.  Fix that up by
removing those variables as we don't need them anymore.

Cc: Abdun Nihaal <abdun.nihaal@gmail.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 7d7cdb4fa552 ("staging: most: video: remove debugging code")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Fix module section mismatch warnings.
Eric Anholt [Mon, 14 May 2018 07:44:11 +0000 (08:44 +0100)]
staging: bcm2835-camera: Fix module section mismatch warnings.

Noticed by Stephen Rothwell in -next.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: 4bebb0312ea9 ("staging/bcm2835-camera: Set ourselves up as a platform driver.")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: fix block comment alignment in p80211metastruct.h
Tim Collier [Fri, 11 May 2018 07:36:46 +0000 (08:36 +0100)]
staging: wlan-ng: fix block comment alignment in p80211metastruct.h

Fix checkpatch warning for misaligned * characters in the block
comment at the start of p80211metastruct.h; with this change the file
is checkpatch clean.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835: Fix mmal_port_parameter_get() signed/unsigned warnings.
Eric Anholt [Thu, 10 May 2018 19:42:20 +0000 (12:42 -0700)]
staging: bcm2835: Fix mmal_port_parameter_get() signed/unsigned warnings.

The arg is a u32 *, so switch over to that in our declarations.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835: Remove dead code related to framerate.
Eric Anholt [Thu, 10 May 2018 19:42:19 +0000 (12:42 -0700)]
staging: bcm2835: Remove dead code related to framerate.

Fixes a compiler warning about a set-but-not-used variable. I think
this was just leftover dead code from before set_framerate_params(),
since that also sets up some mmal_parameter_rational structs for fps.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Fix warnings about string ops on v4l2 uapi.
Eric Anholt [Thu, 10 May 2018 19:42:18 +0000 (12:42 -0700)]
staging: bcm2835-camera: Fix warnings about string ops on v4l2 uapi.

The v4l2 uapi uses u8[] for strings, so cast those to char * to avoid
compiler warnings about unsigned vs signed with sprintf() and friends.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Fix indentation of tables
Dave Stevenson [Thu, 10 May 2018 19:42:17 +0000 (12:42 -0700)]
staging: bcm2835-camera: Fix indentation of tables

As requested by Mauro Carvalho Chehab in review.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Fix comment typos.
Dave Stevenson [Thu, 10 May 2018 19:42:15 +0000 (12:42 -0700)]
staging: bcm2835-camera: Fix comment typos.

Fix a typo flagged by checkpatch, and another in the same line.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Replace BUG_ON with return error
Dave Stevenson [Thu, 10 May 2018 19:42:14 +0000 (12:42 -0700)]
staging: bcm2835-camera: Replace BUG_ON with return error

The error conditions don't warrant taking the kernel down, so remove
BUG_ON.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Move struct vchiq_mmal_rect
Dave Stevenson [Thu, 10 May 2018 19:42:13 +0000 (12:42 -0700)]
staging: bcm2835-camera: Move struct vchiq_mmal_rect

struct vchiq_mmal_rect is only referenced from mmal-parameters.h, yet
was defined in mmal-vchiq.h.

Move it to avoid having to include multiple headers for no reason.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Add multiple include protection
Dave Stevenson [Thu, 10 May 2018 19:42:12 +0000 (12:42 -0700)]
staging: bcm2835-camera: Add multiple include protection

mmal-parameters.h didn't have the normal

...

protection to stop it being included multiple times.  Add it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Remove V4L2/MMAL buffer remapping
Dave Stevenson [Thu, 10 May 2018 19:42:11 +0000 (12:42 -0700)]
staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping

The MMAL and V4L2 buffers had been disassociated, and linked on
demand.  Seeing as both are finite and low in number, and we now have
the same number of each, link them for the duration.  This removes the
complexity of maintaining lists as the struct mmal_buffer context
comes back from the VPU, so we can directly link back to the relevant
V4L2 buffer.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Match MMAL buffer count to V4L2.
Dave Stevenson [Thu, 10 May 2018 19:42:10 +0000 (12:42 -0700)]
staging: bcm2835-camera: Match MMAL buffer count to V4L2.

For historical reasons, the number of buffers passed to the VPU over
MMAL did not match that passed from V4L2.  That is a silly situation
as the driver has to duplicate serialisation and other functions that
have already been implemented in V4L2/videobuf2.

As we had more V4L2 buffers than MMAL ones, the MMAL buffer headers
were returned to the VPU immediately on being filled, which is now
invalid.

Match the number of buffers notified in queue_setup with that used in
MMAL.  Return buffers only when we get them from V4L2.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Remove bulk_mutex as it is not required
Dave Stevenson [Thu, 10 May 2018 19:42:09 +0000 (12:42 -0700)]
staging: bcm2835-camera: Remove bulk_mutex as it is not required

There is no requirement to serialise bulk transfers as that is all
done in VCHI, and if a second MMAL_MSG_TYPE_BUFFER_TO_HOST happened
before the VCHI_CALLBACK_BULK_RECEIVED, then the service_callback
thread is deadlocked.

Remove the bulk_mutex so that multiple receives can be scheduled at a
time.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Allocate context once per buffer
Dave Stevenson [Thu, 10 May 2018 19:42:08 +0000 (12:42 -0700)]
staging: bcm2835-camera: Allocate context once per buffer

The struct mmal_msg_context was being allocated for every message
being sent to the VPU, and freed when it came back.  Whilst that is
required behaviour for some messages (mainly the synchronous ones), it
is wasteful for the video buffers that make up the majority of the
traffic.

Add to the buffer_init/cleanup hooks that it allocates/frees the
msg_context required.

v2: changes by anholt from the downstream tree: clean up indentation,
    pass an error value through, forward-declare the struct so we have
    less void *

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Skip ISP pass to eliminate padding.
Dave Stevenson [Thu, 10 May 2018 19:42:07 +0000 (12:42 -0700)]
staging: bcm2835-camera: Skip ISP pass to eliminate padding.

Interleaved RGB and single plane YUV formats can be delivered by the
GPU without the secondary step of removing padding, as the
bytesperline field can be set appropriately.

Planar YUV needs the GPU to still remove padding, as there is no way
to report that there is padding between the planes (ie on the height).
The multi-planar formats are NOT applicable, as there is no easy way
to make them contiguous in memory (ie one large allocation that gets
broken up). The whole task is passed across to videobuf2 which has no
notion of that requirement.

v2: Changes by anholt from the downstream driver: Flag two more planar
    formats as needing padding removal, and remove broken userspace
    workaround.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging/bcm2835-camera: Set ourselves up as a platform driver.
Eric Anholt [Thu, 10 May 2018 19:42:06 +0000 (12:42 -0700)]
staging/bcm2835-camera: Set ourselves up as a platform driver.

This allows bcm2835-camera to automatically probe after VCHI has
loaded, rather than only successfully probing if the arbitrary probe
order chooses us after VCHI.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging/vc04_services: Register a platform device for the camera driver.
Eric Anholt [Thu, 10 May 2018 19:42:05 +0000 (12:42 -0700)]
staging/vc04_services: Register a platform device for the camera driver.

We had the camera driver set up in a module_init function, but that
meant that the camera driver would fail to load if it was initialized
before VCHI.  By attaching to this platform_device, it can get a
defined load order.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:r8188eu: Remove rx_handler_data unnecessary read
Ivan Safonov [Wed, 9 May 2018 19:44:06 +0000 (22:44 +0300)]
staging:r8188eu: Remove rx_handler_data unnecessary read

Rx handler (assigned with netdev_rx_handler_register,
called from __netif_receive_skb()) uses value of dev->rx_handler_data.
The driver has no rx handler and does not need it, so remove rx_handler_data read.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: lnet: add static to libcfs_dev declaration
Justin Skists [Thu, 10 May 2018 19:41:29 +0000 (20:41 +0100)]
staging: lustre: lnet: add static to libcfs_dev declaration

Add a static prefix to the declaration for libcfs_dev. This would fix
the following sparse warning:

drivers/staging/lustre/lnet/libcfs/module.c:317:19: warning: symbol
'libcfs_dev' was not declared. Should it be static?

Signed-off-by: Justin Skists <justin.skists@juzza.co.uk>
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: fix spelling mistake: "traking" -> "tracking"
Colin Ian King [Thu, 10 May 2018 15:07:41 +0000 (16:07 +0100)]
staging: rtlwifi: fix spelling mistake: "traking" -> "tracking"

Trivial fix to spelling mistake in ODM_RT_TRACE message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: video: remove debugging code
Abdun Nihaal [Tue, 8 May 2018 16:30:40 +0000 (22:00 +0530)]
staging: most: video: remove debugging code

This patch removes debugging code in video.c that causes the following
checkpatch warning:

WARNING: Prefer using '\"%s...\", __func__' to using function's name in a string

Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Replace license boilerplate with SPDX identifiers
Nathan Chancellor [Tue, 8 May 2018 11:59:53 +0000 (04:59 -0700)]
staging: rtl8723bs: Replace license boilerplate with SPDX identifiers

This satisfies a checkpatch.pl warning and is the preferred method for
notating the license due to its lack of ambiguity.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge tag 'iio-for-4.18a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Fri, 11 May 2018 07:50:04 +0000 (09:50 +0200)]
Merge tag 'iio-for-4.18a' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

1st round of IIO new device support, features and cleanup for the 4.18 cycle

A nice mix this time of excellent cleanups (many to send drivers
speeding toward staging graduations) and new drivers / device support.
A good part of this is Brian Masney's never ending task on the tsl2x7x
driver.  The end is in sight so hopefully we'll get that one out of
staging very soon!

New device support
* AD5686
  - Support AD5685R (was wrongly present as AD5685)
  - Support AD5672R, AD5676, AD5676, AD5684R and AD5686R 4 and 8 channel
    SPI DACs with various precisions.
  - Support AD5671R, AD5675R, AD5694, AD5694R, AD5695R, AD5696 and AD5696R
    I2C DACs with various percisions and numbers of channels.
* Analog front end rescale driver - New driver.
  - Support current sensing usings a shunt resistor.
  - Support simple voltage dividers.
  - support simple current sense amplifiers.
* TI dac5571
  - New driver and device bindings supporting:
    dac5571, dac6571, dac7571, dac5574, dac6574, dac7574,
    dac5573, dac6573 and dac7573
* Meson-adc
  - Support for Meson AXG with DT bindings.
* mpu6050
  - Support the mpu9255 which only requires additional WHOAMI entry and
    compatible string.
* st_lsm6dsx
  - Support for lsm330dlc combinded accelerometer and gyro sensors with
    DT bindings.
* stm32_adc
  - Add support for STM32MP1 with bindings.

Staging graduations
* adis16201 after some excelent cleanup by Himanshu Jha.
* adis16029 after some excelent cleanup by Shreeya Patel.

New features:
* ABI docs
  - Add core ABI docs for angle channels.
* inv_mpu6050
  - Provide support for the full range of interrupts the device
    supports.
* st_accel
  - Add SMO8840 ACPI ID seen in the wild on some Lenovo machines.
* stx104
  - Provide a multiple gpio get function.

Cleanups / Minor fixes
* core
  - Use new nested structure support to improve kernel-doc.
* ad2s1200
  - Use be16_to_cpup instead of opencoding.
* ad5686
  - Indentation tidy up.
  - Switch to SPDX
  - Refactor to allow various numbers of channels.
  - Refactor to separate core and SPI specific support, prior to
    addition of i2c equivalent devices.
* ad7606
  - Use drvdata directly from device rather than boucing via the
    platform_device structure.
* ad7746
  - Replace opencoded byte swapped i2c calls with _swapped variants.
  - White space and line break readability improvements.
  - Reorder includes and variable declarations where appropriate.
* ad7791
  - Changes to the AD ADC library used by this driver took in the
    sampling frequency.  This lead to be the wrong path being the one
    tied to the resulting attribute, so it didn't work, and a warning
    to be printed.
* ad7780
  - Remove apparent support for sampling frequency control on devices
    that don't support changing the sampling attributes.
* ade7854
  - Fix a read of the wrong number of bits.
  - Improve error handling on i2c read/write errors.
  - Rework i2c and spi code to reduce duplication.
* adis16201 (staging)
  - Improve meaning inherent in some macro names by adding units etc
    where relevant.
  - Adjust comments to improve detail and drop the irrelevant.
  - Rename register address definitions definitions to add a _REG
    postfix, clearly separating them from field definitions. Reorganize
    the definitions to group register address and fields.
  - Use sign_extend32 rather than open coding.
  - Reverse Xmas tree ordering where appropriate and align function args.
  - Remove unused headers.
  - Use GENMASK where appropriate instead of open coding.
* adis16209 (staging)
  - Indent field definitions to visually separate them from
    register address definitions.
  - Use reverse xmas tree ordering where appropriate.
  - Add some whitespace where it will help readability.
  - Drop some unused headers.
  - Use GENMASK where appropriate.
* ad2s1200
  - Drop unnecessary includes and reorder alphabetically.
  - Reverse xmas tree and blank line cleanups.
* atlas-ph-sensor
  - Use msleep instead of usleep_range where the precise value doesn't
    matter and the delays are long.
* bcm150
  - Drop transaction splitting as core now handles it.
* cros_ec
  - Move the shared header to the include/iio/common directory.
    This brings it inline with the other multiple type devices.
  - Use drvdata directly from device rather than boucing via the
    platform_device structure.
* hid-sensors
  - Use drvdata directly from device rather than boucing via the
    platform_device structure.
* inv_mpu6050
  - Clear out a second function definition for the same function.
  - Don't flush fifo when the iio buffer is full but just drop excess
    data.
  - Tidy up set_power_itg and ensure it is used in the right places.
  - Use set_power_itg rather than opencoding it again in the i2c mux
    control.
  - Make sure error paths disable the power if undoing power on.
  - Used managed devm_ functions during probe. Delete remove function.
  - Refactor to pull raw data read out of read_raw function.
  - Simplify data reading error paths.
  - Only enable the i2c mux for chips with the i2c aux bus (not icm20608)
  - Fix a potential deadlock due to varying lock ordering.
  - Fix an issue where first sample from gyro after enabling is unstable
    by dropping the first sample.
  - Fix an issue where the user_ctrl register is incorrectly overwritten.
  - Tidy up some grammar and spelling minor issus.
* mcp320x
  - Use vendor compatible strings.
* mcp4018
  - Switch to using i2c .probe_new.
* mcp4351
  - switch to using i2c .probe_new.
* meson-adc
  - rework handing on common ADC platform data so it can be shared
    across multiple families of SoCs.
* sca3000
  - Fix an error handling path if the ring configure fails.
* st_lsm6dsx
  - Fix a wrong fifo threshold mask (no actual effect)
* stm32-dfsdm
  - Style fixes and cleanups.
  - Check filter ID is in range and check spi-max-frequency.
* tsl2x7x (staging)
  - Drop some unnecessary function calls, unused variables and
    unnecessary local variables.
  - Fix wrong interrupt type.
  - Avoid unnecessary double clear of interrupt.
  - Simplify proximity calibration call which did various things
    unrelated to actually calibrating.
  - Separate control of the proximity and ALS interrupts.
  - Improve consistency of logging.
  - Separate ALS and proximity persistence settings as they have
    separate hardware controls.
  - Tidy up variable ordering.
  - Add Brian to copyright notice given consider work on this driver.
  - Take advantage of hardware support for I2C address auto increment.
  - Combine individuaal enable and period attributes for the two
    directions on the threshold events into a single value as the
    hardware doesn't separate them.
  - Move integration_time* attributes from light channel to
    intensity value as they effect the intensity readings directly
    and the light reading only indirectly.  Hence this better
    reflects reality. Also move the calibscale_available.
  - Avoid returning an error in the IRQ handler.
  - Hard code the reg value in _clear_interrupts as it only takes
    one value in the code.   Result is the function has little
    purpose so opencode the two remaining i2c_smbus_write_byte
    calls.
  - Drop some unnecessary checking of the chip status register.
  - Tidy up return path in _write_interrupt_config.
  - Tidy up the ID verification code.
  - Move the power and diode settings defines into the header as these
    are needed for platform data configuration.
  - Various renames and comment cleanups for consistency and clarity.
  - Use actual device defaults for default startup settings.
  - SPDX
  - Add some range sanity checking to sysfs attribute writes.
  - Don't provide event interfaces if the interrupt line isn't available.
  - Use IIO_CONST_ATTR macro for calibscale_available as it's a constant
    string.
  - Fix the integration time and lux equations.
  - Make device IDs explicit index values in the device_channel_config array.

6 years agostaging: mt7621-eth: Alignment should match open parenthesis
Kamal Heib [Mon, 7 May 2018 09:05:58 +0000 (12:05 +0300)]
staging: mt7621-eth: Alignment should match open parenthesis

Fix alignment issues reported by checkpatch.pl.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-eth: Add missing blank lines after declarations
Kamal Heib [Mon, 7 May 2018 09:05:57 +0000 (12:05 +0300)]
staging: mt7621-eth: Add missing blank lines after declarations

Add missing blank lines after declarations to solve checkpatch.pl errors.

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: mt7621-eth: Remove unnecessary blank lines
Kamal Heib [Mon, 7 May 2018 09:05:56 +0000 (12:05 +0300)]
staging: mt7621-eth: Remove unnecessary blank lines

Remove un-necessary blank lines to solve errors found by checkpatch.pl.

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: mt7621-eth: Fix compilation error
Kamal Heib [Mon, 7 May 2018 09:05:55 +0000 (12:05 +0300)]
staging: mt7621-eth: Fix compilation error

Fix the following comilation error by making sure that "phy_ring_head" is
defined as "dma_addr_t" and change "phy_ring_tail" to match it as both
should be "dma_addr_t".

error: passing argument 3 of ‘dma_alloc_coherent’ from incompatible pointer type

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: lustre: o2iblnd: Enable Multiple OPA Endpoints between Nodes
Doug Oucharek [Tue, 8 May 2018 03:18:06 +0000 (20:18 -0700)]
staging: lustre: o2iblnd: Enable Multiple OPA Endpoints between Nodes

OPA driver optimizations are based on the MPI model where it is
expected to have multiple endpoints between two given nodes. To
enable this optimization for Lustre, we need to make it possible,
via an LND-specific tuneable, to create multiple endpoints and to
balance the traffic over them.

Both sides of a connection must have this patch for it to work.
Only the active side of the connection (usually the client)
needs to have the new tuneable set > 1.

Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8943
Reviewed-on: https://review.whamcloud.com/25168
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Doug Oucharek <dougso@me.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: Remove unnecessary limit checks
Nathan Chancellor [Sun, 6 May 2018 22:03:00 +0000 (15:03 -0700)]
staging: ks7010: Remove unnecessary limit checks

uwrq is an unsigned 32-bit integer, it cannot be less than zero.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: usb: remove local variable
Christian Gromm [Tue, 8 May 2018 09:45:16 +0000 (11:45 +0200)]
staging: most: usb: remove local variable

This patch removes the local variable dev that is used to store the pointer
to the usb_device whenever it is used only once.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: usb: fix usb_disconnect race condition
Christian Gromm [Tue, 8 May 2018 09:45:15 +0000 (11:45 +0200)]
staging: most: usb: fix usb_disconnect race condition

The functions usb_disconnect and usb_sndbulkpipe are racing for the struct
usb_device, which might cause a null pointer dereference exception. This
patch fixes this race condition by protecting the critical section inside
the function hdm_enque with the io_mutex.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: usb: don't set URB_ZERO_PACKET flag for synchronous data
Christian Gromm [Tue, 8 May 2018 09:45:14 +0000 (11:45 +0200)]
staging: most: usb: don't set URB_ZERO_PACKET flag for synchronous data

This patch avoids setting the URB_ZERO_PACKET transfer flag for synchronous
data. This is needed to prevent the host from sending an empty packet when
data is aligned to an endpoint packet boundary.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: dim2: use device to allocate coherent memory
Christian Gromm [Tue, 8 May 2018 09:45:13 +0000 (11:45 +0200)]
staging: most: dim2: use device to allocate coherent memory

On several architectures the allocation of coherent memory needs a device
that has the dma_ops structure properly initialized. This patch enables
the DIM2 platform to be used to allocate this type of memory.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: dim2: read clock speed from the device
Christian Gromm [Tue, 8 May 2018 09:45:12 +0000 (11:45 +0200)]
staging: most: dim2: read clock speed from the device

This patch implemets reading of the clock speed from DT.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: dim2: use device tree
Christian Gromm [Tue, 8 May 2018 09:45:11 +0000 (11:45 +0200)]
staging: most: dim2: use device tree

This patch removes the dependency to platform specific source files
that do platform specific initialization and supply the IRQ number.
Instead DT code is added

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: cdev: fix race condition
Christian Gromm [Tue, 8 May 2018 09:45:10 +0000 (11:45 +0200)]
staging: most: cdev: fix race condition

This patch fixes a race condition between the functions disconnect and poll.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: dim2: fix startup sequence
Christian Gromm [Tue, 8 May 2018 09:45:09 +0000 (11:45 +0200)]
staging: most: dim2: fix startup sequence

Platform specific initialization (data->init) has to be done before
calling dim_startup to start the DIM2 IP.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: cdev: fix function return value
Christian Gromm [Tue, 8 May 2018 09:45:08 +0000 (11:45 +0200)]
staging: most: cdev: fix function return value

The function ch_get_mbo declares its return value as type bool,
but returns a pointer to mbo.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: usb: add ep number to log
Christian Gromm [Tue, 8 May 2018 09:45:07 +0000 (11:45 +0200)]
staging: most: usb: add ep number to log

This patch adds the endpoint number of the USB pipe that reports to be
broken into the log message. It is needed to make debugging for
applications more comfortable.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: cdev: fix chrdev_region leak
Christian Gromm [Tue, 8 May 2018 09:45:06 +0000 (11:45 +0200)]
staging: most: cdev: fix chrdev_region leak

The function unregister_chrdev_region is called with a different counter
as the alloc_chrdev_region. To fix this, this patch introduces the
constant CHRDEV_REGION_SIZE that is used in both functions.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: cdev: avoid warning about potentially uninitialized variable
Christian Gromm [Tue, 8 May 2018 09:45:05 +0000 (11:45 +0200)]
staging: most: cdev: avoid warning about potentially uninitialized variable

This patch avoids the warning that the pointer mbo might be used
uninitialized that some environmens throw.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: sound: call snd_card_new with struct device
Christian Gromm [Tue, 8 May 2018 09:45:04 +0000 (11:45 +0200)]
staging: most: sound: call snd_card_new with struct device

This patch is needed as function snd_card_new needs a valid
parent device. Passing a NULL pointer leads to kernel Ooops.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: make interface drivers allocate coherent memory
Christian Gromm [Tue, 8 May 2018 09:45:03 +0000 (11:45 +0200)]
staging: most: make interface drivers allocate coherent memory

On arm64/aarch64 architectures the allocation of coherent memory needs a
device that has the dma_ops properly set. That's why the core module of
the MOST driver is no longer able to allocate this type or memory. This
patch moves the allocation process down to the interface drivers where
the proper devices exist (e.g. platform device or USB system software).

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: reduce parameters inconsistency
Christian Gromm [Tue, 8 May 2018 09:45:02 +0000 (11:45 +0200)]
staging: most: i2c: reduce parameters inconsistency

Currently, there are two module parameters for the i2c driver:
  - polling_req: boolean irq/polling mode;
  - scan_rate: polling rate, that is used in the case where the polling
    mode is active

This model is misconfiguration-prone.  For example, it is possible to
select polling mode with the zero polling rate or configure non-zero
polling rate in a combination with the IRQ mode.

This patch replaces the 'polling_req' and 'scan_rate' by the
'polling_rate', where the value zero means the interrupt driven mode and
other values are used as the polling rate in the polling mode.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: remove redundant list_mutex
Christian Gromm [Tue, 8 May 2018 09:45:01 +0000 (11:45 +0200)]
staging: most: i2c: remove redundant list_mutex

The elements of the dev->rx.list are consumed in the pending_rx_work and
populated in the function enqueue() that cancels the pending_rx_work.

The function enqueue() and poison_channel() do not race anyway.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: remove redundant is_open
Christian Gromm [Tue, 8 May 2018 09:45:00 +0000 (11:45 +0200)]
staging: most: i2c: remove redundant is_open

The variable is_open is checked only in the work function
pending_rx_work() that is only active between the calls
configure_channel() and poison_channel().

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: trace real polling rate
Christian Gromm [Tue, 8 May 2018 09:44:59 +0000 (11:44 +0200)]
staging: most: i2c: trace real polling rate

The real polling rate depends on the CONFIG_HZ and may differ from the
required polling rate.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: prevent zero delay polling
Christian Gromm [Tue, 8 May 2018 09:44:58 +0000 (11:44 +0200)]
staging: most: i2c: prevent zero delay polling

This patch avoids that a configured scan_rate of more than MSEC_PER_SEC
might result in a polling delay of zero.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: avoid polling in case of misconfig
Christian Gromm [Tue, 8 May 2018 09:44:57 +0000 (11:44 +0200)]
staging: most: i2c: avoid polling in case of misconfig

This patch prevents the driver from falling back to polling mode
in case of IRQ misconfiguration.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>