platform/kernel/linux-rpi3.git
6 years agostaging: mt7621-mmc: Inline function msdc_set_blknum
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:37 +0000 (19:32 +0200)]
staging: mt7621-mmc: Inline function msdc_set_blknum

The function msdc_set_blknum consists of one (real) line of code and
is only called once, so inline it makes the code shorter and more
readable.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove initialisation in msdc_dma_config
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:36 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove initialisation in msdc_dma_config

Current code initialises the variable sg at the beginning of the
msdc_dma_config function. This is not necessary, because the variable
is assigned by the for_each_sg macro later on.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove redundant check for card status
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:35 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove redundant check for card status

Current code checks the card status at the beginning of
msdc_ops_request. This is not necessary because mmc core always checks
the card status before calling this operation.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Do not BUG() if mrq set in msdc_ops_request
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:34 +0000 (19:32 +0200)]
staging: mt7621-mmc: Do not BUG() if mrq set in msdc_ops_request

Currently the code BUG()'s, if host->mrq is set at the beginning of
msdc_ops_request. This shoould normally not happen, but it is not that
critical, because the critical sections are protected by a spin lock
and in the worst case, some commands to the card are lost, so it is
sufficient to just WARN_ON().

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused sdio irq code
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:33 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused sdio irq code

Currently the code for the sdio irq is never used, because the flags
for it (MSDC_(EXT_)SDIO_IRQ) are never set. So the whole code for it
can be removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused field abort from msdc_host
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:32 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused field abort from msdc_host

The field abort of msdc_host is only set, but never read, so it can be
removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Fix error number assignment
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:31 +0000 (19:32 +0200)]
staging: mt7621-mmc: Fix error number assignment

Currently the value that data->error is set to is converted to an
unsigned int, but it is a usual error number, so it should be
negative.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused variable dma_xfer from msdc_host
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:30 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused variable dma_xfer from msdc_host

The field dma_xfer of the struct msdc_host is not used anymore, remove
it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove non-DMA transfer code
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:29 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove non-DMA transfer code

Currently the driver is capable of DMA and non-DMA transfer. But the
option to choose non-DMA transfer has already been removed. Now remove
also the code for the non-DMA transfer.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused global dma_size
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:28 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused global dma_size

The global variable dma_size was previously used to select DMA or
non-DMA transfer mode based on the size of the data that should be
transferred. This option was removed preivously, so the variable is not
used any more and can be removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove transfer mode setting variable
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:27 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove transfer mode setting variable

Currently the transfer mode can be chosen between DMA, a size
dependent mode and non-DMA by writing to a proc file. The upstream
driver mtk-sd uses DMA all times. The previous patch removed the
ability to set that option.

Now the remaining uses of the transfer mode setting variable are
cleaned up, because it cannot be changed any more.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove transfer mode setting from proc
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:26 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove transfer mode setting from proc

Currently the transfer mode can be chosen between DMA, a size
dependent mode and non-DMA by writing to a proc file. The upstream
driver mtk-sd uses DMA all times.

There is no apparent reason why somebody would like to change the
transfer mode and the position of the setting in the debug part of the
driver also indicates, that the option was used for debugging
purposes. So it is removed to clean up the driver and bring it more in
line with the upstream one.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused static msdc_regs
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:25 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused static msdc_regs

The static variable msdc_regs is set once, but never used, so remove
it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Replace macro sdr_get_field with function
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:24 +0000 (19:32 +0200)]
staging: mt7621-mmc: Replace macro sdr_get_field with function

Currently sdr_get_field is a macro, to bring the code in line with the
upstream driver mtk-sd, it is changed to a function.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Replace macro sdr_set_field with function
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:23 +0000 (19:32 +0200)]
staging: mt7621-mmc: Replace macro sdr_set_field with function

Currently sdr_set_field is a macro, to bring the code in line with the
upstream driver mtk-sd, it is changed to a function.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove function uffs
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:22 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove function uffs

The function uffs that is implemented by this driver returns the same
values as the kernel function ffs. So the uffs function is removed and
the calls to it are replaced with calls to ffs.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused macros sdr_{read,write}16
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:21 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused macros sdr_{read,write}16

The sdr_{read,write}16 macros are never used and does not provide any
information about the device, so they are removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused macro msdc_init_gpd_ex
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:20 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused macro msdc_init_gpd_ex

The macro msdc_init_gpd_ex is never used and does not provied any
information about the hardware, so it is removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused field clk_drv from msdc_hw
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:19 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused field clk_drv from msdc_hw

The field clk_drv of msdc_hw is set to a constant and only used once,
replace that position with the constant and remove the unused field.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused field cmd_drv from msdc_hw
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:18 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused field cmd_drv from msdc_hw

The field cmd_drv of msdc_hw is set to a constant and only used once,
replace that position with the constant and remove the unused field.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused field dat_drv from msdc_hw
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:17 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused field dat_drv from msdc_hw

The field dat_drv of msdc_hw is set to a constant and only used once,
replace that position with the constant and remove the unused field.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused field data_edge from msdc_hw
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:16 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused field data_edge from msdc_hw

The field data_edge of msdc_hw is set to a constant and only used once,
replace that position with the constant and remove the unused field.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Remove unused field cmd_edge from msdc_hw
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:15 +0000 (19:32 +0200)]
staging: mt7621-mmc: Remove unused field cmd_edge from msdc_hw

The field cmd_edge of msdc_hw is set to a constant and only used once,
replace that position with the constant and remove the unused field.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Fix typo in function parameters
Christian Lütke-Stetzkamp [Sun, 29 Apr 2018 17:32:14 +0000 (19:32 +0200)]
staging: mt7621-mmc: Fix typo in function parameters

The type pm_message does not exist in the kernel, the correct type is
pm_message_t, so the type of the parameter is corrected.

Fixes: 9673d9f6f44b ("staging: mt7621-mmc: Refactor suspend, resume")
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: Remove stack hog issue from TODO
Stefan Wahren [Sat, 28 Apr 2018 15:47:49 +0000 (17:47 +0200)]
staging: vc04_services: Remove stack hog issue from TODO

Since there is no vchiq function listed by "make checkstack" anymore,
we can remove the stack hog issue from the TODO.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vchiq_shim: Remove unnecessary break
Stefan Wahren [Sat, 28 Apr 2018 15:47:48 +0000 (17:47 +0200)]
staging: vchiq_shim: Remove unnecessary break

This removes an unnecessary break which has been reported by checkpatch.pl.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vchiq_arm: remove unnecessary return
Stefan Wahren [Sat, 28 Apr 2018 15:47:47 +0000 (17:47 +0200)]
staging: vchiq_arm: remove unnecessary return

This removing an unnecessary return which has been reported by checkpatch.pl.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vchiq_2835_arm: Fix whitespace issue in create_pagelist
Stefan Wahren [Sat, 28 Apr 2018 15:47:46 +0000 (17:47 +0200)]
staging: vchiq_2835_arm: Fix whitespace issue in create_pagelist

This fixes a whitespace issue reported by checkpatch:

ERROR: code indent should use tabs where possible

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: Remove defines from Makefile
Stefan Wahren [Sat, 28 Apr 2018 15:47:45 +0000 (17:47 +0200)]
staging: vc04_services: Remove defines from Makefile

The definition of USE_VCHIQ_ARM and VCOS_VERIFY_BKPTS isn't really necessary
so remove them.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vchiq_arm: Make index variable more self-explaining
Stefan Wahren [Sat, 28 Apr 2018 15:47:44 +0000 (17:47 +0200)]
staging: vchiq_arm: Make index variable more self-explaining

The chance to mixup i and j is very high. So rename variable j to a more
explaining one.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vchiq_arm: Rework second abort criterion
Stefan Wahren [Sat, 28 Apr 2018 15:47:43 +0000 (17:47 +0200)]
staging: vchiq_arm: Rework second abort criterion

In order to make the code easier to review, move the second
abort criterion into the loop and the incrementation into
a separate line.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vchiq_arm: Clear VLA warning
Stefan Wahren [Sat, 28 Apr 2018 15:47:42 +0000 (17:47 +0200)]
staging: vchiq_arm: Clear VLA warning

The kernel would like to have all stack VLA usage removed[1]. The array
here is fixed (declared with a const variable) but it appears like a VLA
to the compiler. Also, currently we are putting 768 bytes on the
stack. This function is only called on the error path so performance is
not critical, let's just allocate the memory instead of using the
stack. This saves stack space and removes the VLA build warning.

kmalloc a buffer for dumping state instead of using the stack.

[1]: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vchiq_arm: print real dump limit
Stefan Wahren [Sat, 28 Apr 2018 15:47:41 +0000 (17:47 +0200)]
staging: vchiq_arm: print real dump limit

We better use the real loop limit in the warning about
"too many active services". Another benefit is than we don't have to care
about the format string in the following change.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: speakup: Add pause command used on switching to graphical mode
Samuel Thibault [Wed, 2 May 2018 00:56:10 +0000 (02:56 +0200)]
staging: speakup: Add pause command used on switching to graphical mode

For software speech syntheses to be able to manage concurrent audio card
access, they need to know when speakup stops emitting text to be spoken
because the console has switched to graphical mode.  This introduces a
PAUSE command to do so.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: Replace license boilerplate with SPDX identifiers
Nathan Chancellor [Sun, 6 May 2018 05:55:35 +0000 (22:55 -0700)]
staging: rtlwifi: 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 agostaging: ks7010: review local variable types in hostif_phy_information_confirm
Sergio Paracuellos [Fri, 4 May 2018 04:16:51 +0000 (06:16 +0200)]
staging: ks7010: review local variable types in hostif_phy_information_confirm

This commit changes types for local variables declared in
hostif_phy_information_confirm function to use the preferred
one 'u8' and 'u32'. Its values are get using get_byte and get_dword
functions which returns 'u8' and 'u32' so it makes sense.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use u32 instead of unsigned int in hostif_bss_scan_confirm
Sergio Paracuellos [Fri, 4 May 2018 04:16:50 +0000 (06:16 +0200)]
staging: ks7010: use u32 instead of unsigned int in hostif_bss_scan_confirm

Local variable 'result_code' is declared as unsigned int in
hostif_bss_scan_confirm function. Its value is got calling
get_dword which returns an 'u32' so change its type to u32
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: use u16 instead of unsigned short in hostif_connect_indication
Sergio Paracuellos [Fri, 4 May 2018 04:16:49 +0000 (06:16 +0200)]
staging: ks7010: use u16 instead of unsigned short in hostif_connect_indication

Local variable 'connect_code' is declared as unsigned short in
hostif_connect_indication function. Its value is got calling
get_word which returns an 'u16' so change its type to u16
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: use u16 instead of unsigned short in hostif_data_indication
Sergio Paracuellos [Fri, 4 May 2018 04:16:48 +0000 (06:16 +0200)]
staging: ks7010: use u16 instead of unsigned short in hostif_data_indication

Local variable 'auth_type' is declared as unsigned short in
hostif_data_indication function. Its value is got calling get_word
which returns an 'u16' so change its type to u16 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: use u16 instead of unsigned short in hostif_event_check
Sergio Paracuellos [Fri, 4 May 2018 04:16:47 +0000 (06:16 +0200)]
staging: ks7010: use u16 instead of unsigned short in hostif_event_check

Local variable 'event' is declared as unsigned short in hostif_event_check
function. Its value is got calling get_word which returns an 'u16'
so change its type to u16 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: refactor LOCAL_EEPROM_SUM case in hostif_mib_get_confirm
Sergio Paracuellos [Fri, 4 May 2018 04:16:46 +0000 (06:16 +0200)]
staging: ks7010: refactor LOCAL_EEPROM_SUM case in hostif_mib_get_confirm

This commit simplify conditional paths in LOCAL_EEPROM_SUM case
inside hostif_mib_get_confirm function. It change logic to handle
invalid values first and assign good ones at the end if it is the
case.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use CIRC_CNT_TO_END macro in cnt_smeqbody
Sergio Paracuellos [Fri, 4 May 2018 04:16:45 +0000 (06:16 +0200)]
staging: ks7010: use CIRC_CNT_TO_END macro in cnt_smeqbody

This commit changes custom implementation of CIRC_CNT_TO_END.
Just use the linux kernel header one to simplify code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_get_wireless_stats function
Sergio Paracuellos [Fri, 4 May 2018 04:16:44 +0000 (06:16 +0200)]
staging: ks7010: refactor ks_get_wireless_stats function

This commit refactor a bit ks_get_wireless_stats using
ternary operator for return code. It also change a comment
to use preferred style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_mlme function
Sergio Paracuellos [Fri, 4 May 2018 04:16:43 +0000 (06:16 +0200)]
staging: ks7010: refactor ks_wlan_set_mlme function

This commit refactors ks_wlan_set_mlme function changing
switch-case block for more simple if paths improving
readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_phy_type function
Sergio Paracuellos [Fri, 4 May 2018 04:16:42 +0000 (06:16 +0200)]
staging: ks7010: refactor ks_wlan_set_phy_type function

Handle invalid values first and assign good ones at the
end if it is the case. This makes code simplier.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_sleep_mode function
Sergio Paracuellos [Fri, 4 May 2018 04:16:41 +0000 (06:16 +0200)]
staging: ks7010: refactor ks_wlan_set_sleep_mode function

This commit refactors ks_wlan_set_sleep_mode function
avoiding to use switch-case statement ans using simple
if logic to handle invalid values first. This simplifies
data paths as well as improves readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use ether_addr_copy in ks_wlan_net_start
Sergio Paracuellos [Fri, 4 May 2018 04:16:40 +0000 (06:16 +0200)]
staging: ks7010: use ether_addr_copy in ks_wlan_net_start

Instead of use memcpy for copying ethernet addresses, use
ether_addr_copy that do the same.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use ether_addr_copy in ks_wlan_set_mac_address
Sergio Paracuellos [Fri, 4 May 2018 04:16:39 +0000 (06:16 +0200)]
staging: ks7010: use ether_addr_copy in ks_wlan_set_mac_address

Use ether_addr_copy to copy ethernet address instad of using
memcpy in ks_wlan_set_mac_address function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor hostif_sme_power_mgmt_set function
Sergio Paracuellos [Fri, 4 May 2018 04:16:38 +0000 (06:16 +0200)]
staging: ks7010: refactor hostif_sme_power_mgmt_set function

This commit refactor hostif_sme_power_mgmt_set avoiding to
use switch-case statement and simplifying data paths. This
improves readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change parameter types in hostif_power_mgmt_request
Sergio Paracuellos [Fri, 4 May 2018 04:16:37 +0000 (06:16 +0200)]
staging: ks7010: change parameter types in hostif_power_mgmt_request

Parameters for hostif_power_mgmt_request are declared as unsigned
long and then are forced to be change to be u32. Also the caller
declares explicitly unsigned long parameters just to assign them
and pass into the function. Change types for those to be u32 instead
so no conversion is needed at all and code gets more clear.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor hostif_sme_set_rsn function
Sergio Paracuellos [Fri, 4 May 2018 04:16:36 +0000 (06:16 +0200)]
staging: ks7010: refactor hostif_sme_set_rsn function

This commit make use of two introduced local variables
to make more readable code of hostif_sme_set_rsn function.
It just assign those local variables in different cases
where are needed and extract common code to assign them
at the end.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: add blank line between after definitions
Sergio Paracuellos [Fri, 4 May 2018 04:16:35 +0000 (06:16 +0200)]
staging: ks7010: add blank line between after definitions

Add blank line after definitions in hostif_aplist_init function
to fix a checkpatch script complain about that.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: fix some style issues in ks_hostif.c
Sergio Paracuellos [Fri, 4 May 2018 04:16:34 +0000 (06:16 +0200)]
staging: ks7010: fix some style issues in ks_hostif.c

Fix some checkpatch complains about long lines in some
parts of the code. It also fix some lines where spaces
instead of tabs were inserted.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: factor out send_request_to_device function
Sergio Paracuellos [Fri, 4 May 2018 04:16:33 +0000 (06:16 +0200)]
staging: ks7010: factor out send_request_to_device function

In all functions related with requests to the device the same
patter in used and is also adding a comment to make clear the
intention of the code. Just factor out the pattern into a new
send_request_to_device function to improve readability and make
clear code intention.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: move WLAN_EID_DS_PARAMS to different place inside switch
Sergio Paracuellos [Fri, 4 May 2018 04:16:32 +0000 (06:16 +0200)]
staging: ks7010: move WLAN_EID_DS_PARAMS to different place inside switch

WLAN_EID_DS_PARAMS case inside switch case is just doing nothing
and it is located inside other cases. There is a place inside
the switch with other don't do anything cases are located. Move
this to that place.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use ether_addr_copy in get_ap_information function
Sergio Paracuellos [Fri, 4 May 2018 04:16:31 +0000 (06:16 +0200)]
staging: ks7010: use ether_addr_copy in get_ap_information function

This commit make use of ether_addr_copy to copy ethernet
address instead of copy it using memcpy.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use ether_addr_copy to copy ethernet address sa_data
Sergio Paracuellos [Fri, 4 May 2018 04:16:30 +0000 (06:16 +0200)]
staging: ks7010: use ether_addr_copy to copy ethernet address sa_data

Use ether_addr_copy kernel function to copy an ethernet address
instead of a simple memcpy with ETH_ALEN size.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change type for rsn_enabled in wpa_status struct
Sergio Paracuellos [Fri, 4 May 2018 04:16:29 +0000 (06:16 +0200)]
staging: ks7010: change type for rsn_enabled in wpa_status struct

Field rsn_enabled included in wpa_status struct is declared as
unsigned int but it is only be set using 0 and 1 values and
in conditional if code is just being used as a boolean. Change
its type to be a boolean.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: remove non sense comments in ks_hostif.c source file
Sergio Paracuellos [Fri, 4 May 2018 04:16:28 +0000 (06:16 +0200)]
staging: ks7010: remove non sense comments in ks_hostif.c source file

Comments which say the same as the code are not useful at all
so just remove them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: avoid two long lines in hostif_sme_mode_setup
Sergio Paracuellos [Fri, 4 May 2018 04:16:27 +0000 (06:16 +0200)]
staging: ks7010: avoid two long lines in hostif_sme_mode_setup

This commit avoid two checkpatch script complains about
two long lines.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: move two preprocessor definitions to ks_wlan.h
Sergio Paracuellos [Fri, 4 May 2018 04:16:26 +0000 (06:16 +0200)]
staging: ks7010: move two preprocessor definitions to ks_wlan.h

In ks_wlan_translate_scan function there are two preprocessor
definitions:

    - RSN_INFO_ELEM_ID
    - GENERIC_INFO_ELEM_ID

These can be moved to common ks_wlan.h because they can be used
in get_current_ap function instead of use hardcoded values.
GENERIC_INFO_ELEM_ID has been renamed to WPA_INFO_ELEM_ID which
is more clear.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use ether_addr_copy in get_current_ap
Sergio Paracuellos [Fri, 4 May 2018 04:16:25 +0000 (06:16 +0200)]
staging: ks7010: use ether_addr_copy in get_current_ap

Instead of use memcpy to copy ethernet addresses use
ether_addr_copy created for that.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: add new helpers to achieve mib set request and simplify code
Sergio Paracuellos [Fri, 4 May 2018 04:16:24 +0000 (06:16 +0200)]
staging: ks7010: add new helpers to achieve mib set request and simplify code

New three functions have been created to centralice and simplify
calls related with set MIB requests:

    - hostif_mib_set_request_int
    - hostif_mib_set_request_bool
    - hostif_mib_set_request_ostring

Using these in different calls simplify functions related with
this mainly when types are bool and int because no more conversions
are needed in the caller functions. Those conversion details are
now located in the new helpers improving a lot readability. Calls
in hostif_sme_set_wep function has change also some if's to check
invalid value first avoiding one level indentation.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change parameter types and reorder them in hostif_mib_set_request
Sergio Paracuellos [Fri, 4 May 2018 04:16:23 +0000 (06:16 +0200)]
staging: ks7010: change parameter types and reorder them in hostif_mib_set_request

This commit changes parameter types to use enum mib_attribute, enum
mib_data_type and size_t for size instead of unsigned short. It also
reorder them in a more sense way. Code is updated in different
calls to use new parameters order using 'size' auxiliar local variables
in some of them to improve readability a bit.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change some casts from uint8_t to u8 in ks_hostif header
Sergio Paracuellos [Fri, 4 May 2018 04:16:22 +0000 (06:16 +0200)]
staging: ks7010: change some casts from uint8_t to u8 in ks_hostif header

This commit changes some type cast in rate related preprocessor
definitions included in ks_hostif header file to use preferred
u8 type.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: conver MIB attributes preprocessor defs into an enum
Sergio Paracuellos [Fri, 4 May 2018 04:16:21 +0000 (06:16 +0200)]
staging: ks7010: conver MIB attributes preprocessor defs into an enum

This commit just change some preprocessor definitions related
with MIB attributes into an enumeration which is much cleaner
for this here. Also add kerneldoc to avoid long comment lines.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: convert MIB preprocessor defs into an enum
Sergio Paracuellos [Fri, 4 May 2018 04:16:20 +0000 (06:16 +0200)]
staging: ks7010: convert MIB preprocessor defs into an enum

This commit just change some preprocessor definitions related
with MIB data types into an enumeration which is much cleaner
for this here.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: clean SME_MIC_FAILURE_REQUEST case in hostif_sme_execute
Sergio Paracuellos [Fri, 4 May 2018 04:16:19 +0000 (06:16 +0200)]
staging: ks7010: clean SME_MIC_FAILURE_REQUEST case in hostif_sme_execute

This commit cleans code for the event SME_MIC_FAILURE_REQUEST
changing if logic to handle invalid value first and using a
local variable.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: remove nonsense comment in ks_wlan.h file
Sergio Paracuellos [Fri, 4 May 2018 04:16:18 +0000 (06:16 +0200)]
staging: ks7010: remove nonsense comment in ks_wlan.h file

Header file ks_wlan.h has a lot of nonsense comments along
the different declarations included on it. Most of them are
just the same as the variable name. Just remove them all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change local variable type in ks_wlan_hw_rx
Sergio Paracuellos [Fri, 4 May 2018 04:16:17 +0000 (06:16 +0200)]
staging: ks7010: change local variable type in ks_wlan_hw_rx

Local variable event in ks_wlan_hw_rx function is declared
as unsigned short and can be declared as u16 which is preferred
style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks7010_sme_enqueue_events function
Sergio Paracuellos [Fri, 4 May 2018 04:16:16 +0000 (06:16 +0200)]
staging: ks7010: refactor ks7010_sme_enqueue_events function

Event to send to init the card are always the same so change
code to be more readable putting them into an array and
enqueuing also using a for loop.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use the same parameter for 'event' in hostif_sme_enqueue
Sergio Paracuellos [Fri, 4 May 2018 04:16:15 +0000 (06:16 +0200)]
staging: ks7010: use the same parameter for 'event' in hostif_sme_enqueue

Declaration of second parameter 'event' in ks_hostif .h and .c
file is different using uint16_t and unsigned short respectively.
Just unify both using 'u16' which is preferred instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change local variable type in ks7010_sdio_init_irqs
Sergio Paracuellos [Fri, 4 May 2018 04:16:14 +0000 (06:16 +0200)]
staging: ks7010: change local variable type in ks7010_sdio_init_irqs

Local variable 'byte' in ks7010_sdio_init_irqs is declared as
unsigned char and can be declared as u8 which is preferred.
It is being used in calls to ks7010_sdio_writeb which is already
expected an u8.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change some local variables type in ks_sdio_interrupt
Sergio Paracuellos [Fri, 4 May 2018 04:16:13 +0000 (06:16 +0200)]
staging: ks7010: change some local variables type in ks_sdio_interrupt

Local variables 'status', 'rsize' and 'byte' are declared as
unsigned char and can be declared as u8 which is preferred.
They are being used in ks7010_sdio_readb calls which is already
expected an u8.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change local variable type in ks7010_rw_function
Sergio Paracuellos [Fri, 4 May 2018 04:16:12 +0000 (06:16 +0200)]
staging: ks7010: change local variable type in ks7010_rw_function

Local variable 'byte' in ks7010_rw_function is declared as unsigned
char and can be declared as u8 which is preferred. It is being used
in ks7010_sdio_readb which is already expecting an u8.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change local variable type in _ks_wlan_hw_power_save
Sergio Paracuellos [Fri, 4 May 2018 04:16:11 +0000 (06:16 +0200)]
staging: ks7010: change local variable type in _ks_wlan_hw_power_save

Local variable 'byte' in _ks_wlan_hw_power_save function is declared
as unsigned char and can be declared as u8 which is preferred. It
is being using with ks7010_sdio_readb which expects u8 already.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use u8 instead of unsigned char in write_to_device function
Sergio Paracuellos [Fri, 4 May 2018 04:16:10 +0000 (06:16 +0200)]
staging: ks7010: use u8 instead of unsigned char in write_to_device function

Parameter buffer in write_to_device function is declared as
a pointer to unsigned char and can be declared as an u8 type
which is preferred. Internally it calls to ks7010_sdio_write
which is using also u8 as parameter type. Update calls to this
function as well.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: remove missing WPS preprocessor conditional code
Sergio Paracuellos [Fri, 4 May 2018 04:16:09 +0000 (06:16 +0200)]
staging: ks7010: remove missing WPS preprocessor conditional code

Commit 92c1552caef3661f049c4e967550e933599e2663 removes WPS hardcoded
definition and its related conditional preprocessor code. There
was some missing stuff already in this files. Remove it.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: change netdev_dbg msg to avoid a long line
Sergio Paracuellos [Fri, 4 May 2018 04:16:08 +0000 (06:16 +0200)]
staging: ks7010: change netdev_dbg msg to avoid a long line

This commit avoids a long line changing a bit message in
_ks_wlan_hw_power_save function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: avoid ks_sdio_card dependency in ks_wlan header
Sergio Paracuellos [Fri, 4 May 2018 04:16:07 +0000 (06:16 +0200)]
staging: ks7010: avoid ks_sdio_card dependency in ks_wlan header

ks_wlan_private struct has a pointer to struct ks_sdio_card in its
fields. Because of that a forward declaration in needed in ks_wlan.h
header and also it makes necessary to have ks_sdio_card public in
a ks7010_sdio.h header. Changing this pointer into a void pointer
makes no longer necessary to have ks7010_sdio.h header as well as
removes the forward dependency in ks_wlan.h. Declaration of
ks_sdio_card has been moved to ks7010_sdio.c source file and To make
code cleaner inside this file a new ks7010_to_func function has been
added. The code has been updated to this changes.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: move tx and rx queues definitions into ks_wlan.h header
Sergio Paracuellos [Fri, 4 May 2018 04:16:06 +0000 (06:16 +0200)]
staging: ks7010: move tx and rx queues definitions into ks_wlan.h header

There are some definitions for rx and tx queues in ks7010_sdio
which is not the best place to put them. Changing them into the
ks_wlan header file there is no need to explicity include ks7010_sdio.h
which makes no sense at all and can be resolved easily using
forward declarations. The functions related with the queues circular
buffers have been moved also into this header.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: add SPDX identifiers to all files
Sergio Paracuellos [Fri, 4 May 2018 04:16:05 +0000 (06:16 +0200)]
staging: ks7010: add SPDX identifiers to all files

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

Fix up the all of the staging ks7010 files 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.

Extra GPL text wording can be removed as it is no longer needed at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: fix spelling mistakes: "dismatch" and "Inviation"
Colin Ian King [Mon, 30 Apr 2018 15:53:47 +0000 (16:53 +0100)]
staging: rtl8723bs: fix spelling mistakes: "dismatch" and "Inviation"

Trivial fix to spelling mistakes in message text and comments

"dismatch" -> "mismatch"
"Inviation" -> "Invitation"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: fix SPDX comment style in headers
Tim Collier [Fri, 4 May 2018 08:51:52 +0000 (09:51 +0100)]
staging: wlan-ng: fix SPDX comment style in headers

Several of the wlan-ng header files had C++-style SPDX comments. Fixed
checkpatch warnings by replacing with C-style comments, as per the
kernel docs.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: fix line-break style issue
Tim Collier [Wed, 2 May 2018 19:30:50 +0000 (20:30 +0100)]
staging: wlan-ng: fix line-break style issue

Fix checkpatch warning due to line break after '(', leaving an over 80
character warning due to long macro name.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: add missing parameter name to prototype
Tim Collier [Wed, 2 May 2018 19:30:49 +0000 (20:30 +0100)]
staging: wlan-ng: add missing parameter name to prototype

Fix checkpatch warning for missing parameter name for function
prototype.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: prism2sta: fix indent coding-style issues
Efstratios Gavas [Sat, 5 May 2018 03:45:18 +0000 (03:45 +0000)]
staging: wlan-ng: prism2sta: fix indent coding-style issues

Fixed format/style issues found with checkpatch. No code changes.
Corrected alignment of variables after open parenthesis and line breaks.
Checkpatch now returns clean except for "line over 80 char" warnings.

Signed-off-by: Efstratios Gavas <xtrat@elg.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: sm750fb: add drm development branch details
Sudip Mukherjee [Sun, 29 Apr 2018 17:53:07 +0000 (18:53 +0100)]
staging: sm750fb: add drm development branch details

The sm750 driver in staging has no future as new framebuffer driver
will not be added to fbdev anymore. A drm driver is being prepared, and
the details added to the TODO file. This sm750fb driver will be removed
as soon as the drm driver is ready. Also, remove my old email.

Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoion: Consider ion pool pages as indirectly reclaimable
Vijayanand Jitta [Wed, 25 Apr 2018 03:24:47 +0000 (08:54 +0530)]
ion: Consider ion pool pages as indirectly reclaimable

An issue is observed where mallocs are failing due to overcommit failure.
The failure happens when there is high ION page pool since ION page
pool is not considered reclaimable by the overcommit calculation code.
This change considers ion pool pages as indirectly reclaimable and thus
accounted as available memory in the overcommit calculation.

Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obdclass: guarantee all keys filled
Hongchao Zhang [Wed, 2 May 2018 18:21:47 +0000 (14:21 -0400)]
staging: lustre: obdclass: guarantee all keys filled

In keys_fill, the key_set_version could be changed after
the keys are filled, then the keys in this context won't
be refilled by the following lu_context_refill for its
version is equal to the current key_set_version.

In lu_context_refill, the key_set_version should be protected
before comparing it to version stored in the lu_context.

Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8346
Reviewed-on: https://review.whamcloud.com/26099
Reviewed-on: https://review.whamcloud.com/27448
Reviewed-on: https://review.whamcloud.com/27994
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obdclass: hoist locking in lu_context_exit()
John L. Hammond [Wed, 2 May 2018 18:21:46 +0000 (14:21 -0400)]
staging: lustre: obdclass: hoist locking in lu_context_exit()

Hoist lu_keys_guard locking out of the for loop in lu_context_exit().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8918
Reviewed-on: https://review.whamcloud.com/24217
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obdclass: change spinlock of key to rwlock
Li Xi [Wed, 2 May 2018 18:21:45 +0000 (14:21 -0400)]
staging: lustre: obdclass: change spinlock of key to rwlock

Most of the time, keys are never changed. So rwlock might be
better for the concurrency of key read.

Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Gu Zheng <gzheng@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6800
Reviewed-on: http://review.whamcloud.com/15558
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: o2iblnd: fix race at kiblnd_connect_peer
Doug Oucahrek [Wed, 2 May 2018 05:22:19 +0000 (22:22 -0700)]
staging: lustre: o2iblnd: fix race at kiblnd_connect_peer

cmid will be destroyed at OFED if kiblnd_cm_callback return error.
if error happen before the end of kiblnd_connect_peer, it will touch
destroyed cmid and fail as
(o2iblnd_cb.c:1315:kiblnd_connect_peer())
            ASSERTION( cmid->device != ((void *)0) ) failed:

Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10015
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Reviewed-by: Doug Oucharek <dougso@me.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Doug Oucharek <dougso@me.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: o2iblnd: Fix FastReg map/unmap for MLX5
Doug Oucharek [Wed, 2 May 2018 03:49:18 +0000 (23:49 -0400)]
staging: lustre: o2iblnd: Fix FastReg map/unmap for MLX5

The FastReg support in ko2iblnd was not unmapping pool items
causing the items to leak.  In addition, the mapping code
is not growing the pool like we do with FMR.

This patch makes sure we are unmapping FastReg pool elements
when we are done with them.  It also makes sure the pool
will grow when we depleat the pool.

Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9472
Reviewed-on: https://review.whamcloud.com/27015
Reviewed-by: Andrew Perepechko <andrew.perepechko@seagate.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: lustre: llite: fix potential missing-check bug when copying lumv
Wenwen Wang [Mon, 30 Apr 2018 22:56:10 +0000 (17:56 -0500)]
staging: lustre: llite: fix potential missing-check bug when copying lumv

In ll_dir_ioctl(), the object lumv3 is firstly copied from the user space
using Its address, i.e., lumv1 = &lumv3. If the lmm_magic field of lumv3 is
LOV_USER_MAGIC_V3, lumv3 will be modified by the second copy from the user
space. The second copy is necessary, because the two versions (i.e.,
lov_user_md_v1 and lov_user_md_v3) have different data formats and lengths.
However, given that the user data resides in the user space, a malicious
user-space process can race to change the data between the two copies. By
doing so, the attacker can provide a data with an inconsistent version,
e.g., v1 version + v3 data. This can lead to logical errors in the
following execution in ll_dir_setstripe(), which performs different actions
according to the version specified by the field lmm_magic.

This patch rechecks the version field lmm_magic in the second copy.  If the
version is not as expected, i.e., LOV_USER_MAGIC_V3, an error code will be
returned: -EINVAL.

Signed-off-by: Wenwen Wang <wang6495@umn.edu>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ldlm: store name directly in namespace.
NeilBrown [Tue, 1 May 2018 03:52:38 +0000 (13:52 +1000)]
staging: lustre: ldlm: store name directly in namespace.

Rather than storing the name of a namespace in the
hash table, store it directly in the namespace.
This will allow the hashtable to be changed to use
rhashtable.

Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <andreas.dilger@dilger.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename WILC_WFI_band_2ghz variable to avoid mixedcase
Ajay Singh [Wed, 2 May 2018 07:13:47 +0000 (12:43 +0530)]
staging: wilc1000: rename WILC_WFI_band_2ghz variable to avoid mixedcase

Rename 'WILC_WFI_band_2ghz' to avoid mixedcase for variable name.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename 'during_ip_time' macro to have uppercase name for macro
Ajay Singh [Wed, 2 May 2018 07:13:46 +0000 (12:43 +0530)]
staging: wilc1000: rename 'during_ip_time' macro to have uppercase name for macro

Rename 'during_ip_time' to 'DURING_IP_TIME_OUT' to have uppercase letter
for macros(#define).

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: use is_broadcast_ether_addr check for broadcast address
Ajay Singh [Wed, 2 May 2018 07:13:45 +0000 (12:43 +0530)]
staging: wilc1000: use is_broadcast_ether_addr check for broadcast address

Make use of is_broadcast_ether_addr() to check if mac address is broadcast
address. Remove static 'broadcast', as its not needed after use of
is_broadcast_ether_addr().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: move macro after the #include file in wilc_wfi_netdevice
Ajay Singh [Wed, 2 May 2018 07:13:44 +0000 (12:43 +0530)]
staging: wilc1000: move macro after the #include file in wilc_wfi_netdevice

Cleanup patch to organize macro in a file together after #include
statements.

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