platform/kernel/linux-starfive.git
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: 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>
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.