[PATCH 00/16] staging: ks7010: more cleanups

2018-04-06 Thread Sergio Paracuellos
This patch series continues with cleanups in this driver. Some checkpatch warnings have been removed as well as nonsense code and code that is not being used at all. Some functions have been rewriten or reviewed to improve readability. Sergio Paracuellos (16): staging: ks7010: remove

[PATCH 03/16] staging: ks7010: remove two redefined defines in eap_packet.h header

2018-04-06 Thread Sergio Paracuellos
This commit removes GENERIC_INFO_ELEM and RSN_INFO_ELEM definitions from eap_packet.h header file which are not being used at all. These two are also defined in the ks_wlan_net.c source file as GENERIC_INFO_ELEM_ID and RSN_INFO_ELEM_ID with the same values. Signed-off-by: Sergio Paracuellos

[PATCH 02/16] staging: ks7010: remove EAPOL_VERSION preprocessor definition

2018-04-06 Thread Sergio Paracuellos
This commit removes EAPOL_VERSION define from eap_packet.h header file because it is not being used anywhere. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/eap_packet.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/

[PATCH 06/16] staging: ks7010: move and rename DEVICE_ALIGNMENT into correct header

2018-04-06 Thread Sergio Paracuellos
This commit moves DEVICE_ALIGNMENT definition into the header ks_hostif.h which is where it is being used. This is also defined always so just remove nosense undef definitions also and clean some preprocessor conditional directives in hif_align_size function. Signed-off-by: Sergio Paracuellos

[PATCH 11/16] staging: ks7010: avoid casts in michael_mic_function calls

2018-04-06 Thread Sergio Paracuellos
. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_hostif.c | 17 ++--- drivers/staging/ks7010/michael_mic.c | 2 +- drivers/staging/ks7010/michael_mic.h | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/d

[PATCH 04/16] staging: ks7010: change ETHER_HDR_SIZE definition to use the size of struct ether_hdr

2018-04-06 Thread Sergio Paracuellos
This commit changes ETHER_HDR_SIZE definition which is a hardcoded number using the size of the structure ether_hdr which is the one for what this definition has been created. This improves readability and makes clear the intention of this definition along the code. Signed-off-by: Sergio

[PATCH 09/16] staging: ks7010: remove KS_WLAN_MEM_FLAG definition

2018-04-06 Thread Sergio Paracuellos
This commit removes KS_WLAN_MEM_FLAG definition which is hiding GFP_ATOMIC along the code. It is better to use directly GFP_ATOMIC in kmalloc's because this it is easier to read. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_hostif.c | 6 ++-

[PATCH 12/16] staging: ks7010: remove '\' character from michael_block function

2018-04-06 Thread Sergio Paracuellos
This commit removes '\' character from michael_block function. It seems these two were not removed properly in the following commit: - staging: ks7010: replace MichaelBlockFunction macro with inline function (c61cc2cc3be358da10121d119356dfe67fe240f2). Signed-off-by: Sergio Paracuellos

[PATCH 13/16] staging: ks7010: remove nonsense comment

2018-04-06 Thread Sergio Paracuellos
This commit removes a comment which has nonsense because it is obvious what the code does just reading SET_NETDEV_DEV declaration. This also fixes a checkpatch warning because a line longer than 80 characters. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/s

[PATCH 16/16] staging: ks7010: extract JIFFIES_TO_WAIT definition for common code

2018-04-06 Thread Sergio Paracuellos
This commit extracts JIFFIES_TO_WAIT definition to be precalculated by preprocessor insted of just do the same operation different times in ks7010_rw_function. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 9 + 1 file c

[PATCH 14/16] staging: ks7010: fix remaining checkpatch warnings about long lines in ks7010_sdio source

2018-04-06 Thread Sergio Paracuellos
This commit fixes remaining checkpatch warnings because of the use of lines longer than 80 characters in ks7010_sdio source file. After this clean, this file has no remaining warnings around. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/

[PATCH 01/16] staging: ks7010: remove not used enum values from eap_packet.h header

2018-04-06 Thread Sergio Paracuellos
This commit removes not used at all enum values from eap_packet.h header file. This values are defined in the kernel ieee80211.h header and the only one that is being used in ks_wlan_net.c source which is WLAN_REASON_MIC_FAILURE is being used from this header. Signed-off-by: Sergio Paracuellos

[PATCH 10/16] staging: ks7010: remove nosense #if 1 directive

2018-04-06 Thread Sergio Paracuellos
This commit removes #if 1 directive from code to improve readability. It is always true, so it makes no sense to have it there. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

Re: [PATCH 09/16] staging: ks7010: remove KS_WLAN_MEM_FLAG definition

2018-04-06 Thread Sergio Paracuellos
On Fri, Apr 6, 2018 at 1:07 PM, Dan Carpenter <dan.carpen...@oracle.com> wrote: > On Fri, Apr 06, 2018 at 12:38:16PM +0200, Sergio Paracuellos wrote: >> This commit removes KS_WLAN_MEM_FLAG definition which is >> hiding GFP_ATOMIC along the code. It is better to use d

Re: [PATCH v3 0/9] staging: ks7010: factor out some functions

2018-04-04 Thread Sergio Paracuellos
On Wed, Apr 4, 2018 at 12:04 PM, Dan Carpenter <dan.carpen...@oracle.com> wrote: > Looks good. Thanks! > > Reviewed-by: Dan Carpenter <dan.carpen...@oracle.com> Thanks for reviewing, Dan! > > regards, > dan carpenter > Bes

[PATCH 03/14] staging: ks7010: delete not used definitions in ks7010_sdio source

2018-04-12 Thread Sergio Paracuellos
This commit removes two definitions inside ks7010_sdio source file because they are not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/

[PATCH 04/14] staging: ks7010: add REG suffix to sdio register definitions

2018-04-12 Thread Sergio Paracuellos
This commit adds REG suffix to register definitions related with SDIO in order to improve readability. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 96 ++-- 1 file changed, 48 insertions(

[PATCH 10/14] staging: ks7010: check sdio_set_block_size return value

2018-04-12 Thread Sergio Paracuellos
This commit checks sdio_set_block_size function return value. If it fails abort driver initialization. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/

[PATCH 08/14] staging: ks7010: move MODULE_DEVICE_TABLE related code

2018-04-12 Thread Sergio Paracuellos
This commit moves MODULE_DEVICE_TABLE related code to the end of the file. This is not necessary at all but moving it just before its use improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 14 +++---

[PATCH 07/14] staging: ks7010: avoid one extra level indentation in ks_wlan_hw_rx function

2018-04-12 Thread Sergio Paracuellos
This commit use an and operator in a if condition to avoid one indentation level which is not needed at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff

[PATCH 05/14] staging: ks7010: review comment style in ks7010_sdio source file

2018-04-12 Thread Sergio Paracuellos
multiline comment style to use the normal preferred kernel style. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/d

[PATCH 06/14] staging: ks7010: review debug and error messages in ks7010_sdio source

2018-04-12 Thread Sergio Paracuellos
This commit reviews debug and error messages in code located in ks7010_sdio source file avoiding to use 'error' or 'ks7010' because this file is using netdev_* functions and has non sense to repeat information in log messages. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.

[PATCH 11/14] staging: ks7010: fix error paths in ks7010_sdio_remove function

2018-04-12 Thread Sergio Paracuellos
if send_stop_request call fails it was making a direct 'return' instead of doing a properly cleaning. Because of this a new 'err_free_card' label has been added. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 42 ++--

[PATCH 00/14] cleanups continue

2018-04-12 Thread Sergio Paracuellos
The following series makes new cleanups for ks7010 SDIO related code. All of these needs the previous sent patch series to be applied before. Sergio Paracuellos (14): staging: ks7010: move ROM_FILE definition into source file staging: ks7010: move sdio specific register definitions

[PATCH 02/14] staging: ks7010: move sdio specific register definitions into source file

2018-04-12 Thread Sergio Paracuellos
This commit moves SDIO related register definitions from header to source file. There is no need to have those into the header because they are only being used in specific SDIO code. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.

[PATCH 01/14] staging: ks7010: move ROM_FILE definition into source file

2018-04-12 Thread Sergio Paracuellos
This commit moves ROM_FILE from header to source file because there is not being used outside this. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 1 + drivers/staging/ks7010/ks7010_sdio.h | 2 -- 2 files changed, 1 insertion

[PATCH 12/14] staging: ks7010: use u8 instead of unsigned char for firmware buffers

2018-04-12 Thread Sergio Paracuellos
This commit replaces type unsigned char which is the one which is being used for firmware buffers with u8 type which is preferred. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 del

[PATCH 14/14] staging: ks7010: use linux circular buffer header macros to handle tx and rx queues

2018-04-12 Thread Sergio Paracuellos
inside do-while(0) block because its use is only located in the four functions that make use of it so it won't expand into invalid code at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 59 ++--

[PATCH 13/14] staging: ks7010: assign dev_alloc_name() result to variable before check it

2018-04-12 Thread Sergio Paracuellos
This commit assigns dev_alloc_name() call to 'ret' variable to check it after instead of check directly the call in the if condition. This improves a bit readability. It also add an empty line before the new assignment to separate it from the previous check statement block. Signed-off-by: Sergio

[PATCH 09/14] staging: ks7010: replace create_workqueue with alloc_workqueue

2018-04-12 Thread Sergio Paracuellos
This commit replaces deprecated create_workqueue call with the alloc_workqueue one which is the one to be used now for this purpose. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 de

Re: [PATCH 14/14] staging: ks7010: use linux circular buffer header macros to handle tx and rx queues

2018-04-13 Thread Sergio Paracuellos
On Fri, Apr 13, 2018 at 2:14 PM, Dan Carpenter <dan.carpen...@oracle.com> wrote: > On Thu, Apr 12, 2018 at 05:50:31PM +0200, Sergio Paracuellos wrote: >> This commit replace current custom implementation of some circular >> buffer head and tail logic in favour of the

Re: [PATCH 14/14] staging: ks7010: use linux circular buffer header macros to handle tx and rx queues

2018-04-13 Thread Sergio Paracuellos
arpenter > Best regards, Sergio Paracuellos ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH 03/21] staging: ks7010: remove auxiliar zeros buffer in ks_wlan_get_encode

2018-04-18 Thread Sergio Paracuellos
dex].size. If it is zero the final 'extra' parameter won't be copied at all because the number of bytes to copy will be zero. With this change the code gets simplified. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 17 -

[PATCH 01/21] staging: ks7010: remove struct ieee802_1x_eapol_key

2018-04-18 Thread Sergio Paracuellos
This commit removes ieee802_1x_eapol_key struct because it is not being used at all. It also removes definitions related to some fields of the removed struct. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/eap_packet.

[PATCH 04/21] staging: ks7010: refactor ks_wlan_set_encode function

2018-04-18 Thread Sergio Paracuellos
emoved. In the top of the file invalid index values are being checked so it has no sense to check that again. - remove commented line. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 84 +--- 1 file

[PATCH 02/21] staging: ks7010: remove not used enum in eap_packet header file

2018-04-18 Thread Sergio Paracuellos
This commit removes an anonymous enumerator inside eap_packet header file because it is not being used anymore. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/eap_packet.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/

[PATCH 00/21] next cleanups

2018-04-18 Thread Sergio Paracuellos
Cleanups continue in this driver. This patch series includes - some function refactors - clean code which is not being used at all - some style fixes - includes review in driver files Sergio Paracuellos (21): staging: ks7010: remove struct ieee802_1x_eapol_key staging: ks7010: remove

[PATCH 13/21] staging: ks7010: removes data_buff field of ks_wlan_private struct

2018-04-18 Thread Sergio Paracuellos
This commit removes data_buff array field of ks_wlan_private which is not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/ks7010/ks_wlan.h b/d

[PATCH 11/21] staging: ks7010: remove two fields of ks_wlan_private struct

2018-04-18 Thread Sergio Paracuellos
This commit removes l2_dev and l2_fd fields of ks_wlan_private struct because they are not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/

[PATCH 08/21] staging: ks7010: refactor ks_wlan_set_wps_enable function

2018-04-18 Thread Sergio Paracuellos
This commit refactors ks_wlan_set_wps_enable function to improve readability handling the error first to avoid an 'else'. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)

[PATCH 05/21] staging: ks7010: change if-else condition assignment to use ternary operator

2018-04-18 Thread Sergio Paracuellos
This commit changes an if-else block used to just assign a variable to use a ternary operator to do the same improving readability. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 5 + 1 file changed, 1 insertion(+), 4 del

[PATCH 20/21] staging: ks7010: use ARRAY_SIZE macro in ks_wlan_handler_def

2018-04-18 Thread Sergio Paracuellos
This commit make use of ARRAY_SIZE macro to set fields num_private and num_private_args of the iw_handler_def struct of the driver. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 5 ++--- 1 file changed, 2 insertions(+), 3 del

[PATCH 16/21] staging: ks7010: review includes of michael_mic.c file

2018-04-18 Thread Sergio Paracuellos
This commit reviews includes of michael_mic.c source file removing those which are not being used at all and reordering the remaining ones in alphabetically order. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/michael_mic.c | 5 ++--- 1 file c

[PATCH 15/21] staging: ks7010: review includes of ks7010_sdio file

2018-04-18 Thread Sergio Paracuellos
This commit reviews includes of ks7010_sdio.c source file removing those which are not being used at all. Kernel header includes have been ordered alphabetically also. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 8 +++-

[PATCH 17/21] staging: ks7010: use IW_HANDLER macro in ks_wlan_handler

2018-04-18 Thread Sergio Paracuellos
are affected have been updated also to make use of the union iwreq_data as third parameter updating code accordly. iw_handler_def struct of this driver has been updated to use ARRAY_SIZE instead of custom calculations. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/s

[PATCH 21/21] staging: ks7010: init local variables when they are declared in ks7010_sdio_probe

2018-04-18 Thread Sergio Paracuellos
This commit change init point of two variables to forward them to init time. This variables are just being assigned some lines after and it is more clear to init them when the init value is known and in this case this is known when they are declared. Signed-off-by: Sergio Paracuellos

[PATCH 06/21] staging: ks7010: refactor ks_wlan_set_rx_gain function

2018-04-18 Thread Sergio Paracuellos
This commit refactors ks_wlan_set_rx_gain function to improve readability: - error condition is handling the error to avoid an 'else' - ternary operator is used to clean if-else block assignment. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/

[PATCH 12/21] staging: ks7010: remove enum from ks_wlan.h header

2018-04-18 Thread Sergio Paracuellos
This commit removes an enum which is in ks_wlan.h and it is not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan.h | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/s

[PATCH 10/21] staging: ks7010: review includes of ks_wlan.h file

2018-04-18 Thread Sergio Paracuellos
problems. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 1 + drivers/staging/ks7010/ks_wlan.h | 19 --- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdi

[PATCH 18/21] staging: ks7010: remove KSC_OPNOTSUPP related code

2018-04-18 Thread Sergio Paracuellos
This commit reviews KSC_OPNOTSUPP related code. The preprocessor KSC_OPNOTSUPP is defined by default so related wext functions are not being used. Just clean code removing all of this stuff. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan

[PATCH 19/21] staging: ks7010: align comments in ks_wlan_private_handler

2018-04-18 Thread Sergio Paracuellos
This commit align comment inside ks_wlan_private_handler WEXT private driver operations. This improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 39 ++-- 1 file changed, 19 inse

[PATCH 14/21] staging: ks7010: review includes of ks_hostif file

2018-04-18 Thread Sergio Paracuellos
of some preprocessor conditional code of WPS definition. This definition is in ks_wlan.h so this one must be included before the ks_hostif.h header file. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_hostif.c | 11 --- 1 file chan

[PATCH 07/21] staging: ks7010: refactor ks_wlan_set_tx_gain function

2018-04-18 Thread Sergio Paracuellos
This commit refactors ks_wlan_set_rx_gain function to improve readability: - error condition is handling the error to avoid an 'else' - ternary operator is used to clean if-else block assignment. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/

[PATCH 09/21] staging: ks7010: review includes of ks_wlan_net.c file

2018-04-18 Thread Sergio Paracuellos
This commit reviews really needed includes in ks_wlan_net.c source file. It removes those which are not needed at all. It also reorder the remaining ones in alphabetical order. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.

[PATCH 16/16] staging: ks7010: refactor ks_wlan_translate_scan function

2018-04-25 Thread Sergio Paracuellos
style for comments - extract common code into a new ks_wlan_add_leader_event function After this changes readability has been improved. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 150 +++-

[PATCH 08/16] staging: ks7010: use ether_addr_copy in ks_wlan_set_encode_ext

2018-04-25 Thread Sergio Paracuellos
Instead of manually memcpy ethernet addresses use ether_addr_copy function for this purpose. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/

[PATCH 12/16] staging: ks7010: avoid an 'else' in ks_wlan_set_power

2018-04-25 Thread Sergio Paracuellos
Change if logic to handle invalid case for operation_mode at first avoiding an 'else' path. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/

[PATCH 03/16] staging: ks7010: refactor ks_wlan_set_scan_type function

2018-04-25 Thread Sergio Paracuellos
This commit changes logic to handle invalid values first and just assign valid ones afterwards. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/s

[PATCH 01/16] staging: ks7010: add SPDX identifiers to all files

2018-04-25 Thread Sergio Paracuellos
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.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 5 + drivers/staging/ks7010/ks7010_sdio.h | 5 + d

[PATCH 04/16] staging: ks7010: refactor ks_wlan_set_power_mgmt function

2018-04-25 Thread Sergio Paracuellos
This commit change logic to simplify conditional paths in ks_wlan_set_power_mgmt function. It handles invalid's first and just finally assign a valid value. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 23

[PATCH 05/16] staging: ks7010: refactor ks_wlan_set_preamble function

2018-04-25 Thread Sergio Paracuellos
Change if logic to handle invalid values first and just assign at the end the valid one if it is the case. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/d

[PATCH 06/16] staging: ks7010: refactor ks_wlan_set_cts_mode function

2018-04-25 Thread Sergio Paracuellos
This commit refactors ks_wlan_set_cts_mode function to handle invalid values first and then assign the good one changing a bit logic to use a ternary operator. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 17 ++---

[PATCH 02/16] staging: ks7010: refactor ks_wlan_set_beacon_lost function

2018-04-25 Thread Sergio Paracuellos
Change if condition to handle invalid value first and avoid nonsense else's path improving readability. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/d

[PATCH 10/16] staging: ks7010: refactor ks_wlan_set_wap function

2018-04-25 Thread Sergio Paracuellos
Make use of ether_addr_copy instead of memcpy for copying ethernet address data in ks_wlan_set_wap function and avoid an 'else' just changing if logic to check invalid values first. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.

[PATCH 15/16] staging: ks7010: avoid blank line between declarations in ks_wlan_get_aplist

2018-04-25 Thread Sergio Paracuellos
This commit removes a blank line which is included between declarations and it has not sense at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_wlan

[PATCH 00/16] staging: ks7010: next cleanups

2018-04-25 Thread Sergio Paracuellos
This patch series includes some new cleanups in code. It also includes a remaining patch (PATCH 1/16) about SPDX identifiers in files which wasn't be applied. Sergio Paracuellos (16): staging: ks7010: add SPDX identifiers to all files staging: ks7010: refactor ks_wlan_set_beacon_lost

[PATCH 13/16] staging: ks7010: avoid if-else condition in ks_wlan_get_power

2018-04-25 Thread Sergio Paracuellos
The if-else code in ks_wlan_get_power function is not needed at all and can be achieved with a simple boolean assignation. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-)

[PATCH 09/16] staging: ks7010: align values in frequency_list array

2018-04-25 Thread Sergio Paracuellos
To avoid a long line align values in static array frequency_list array. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/d

[PATCH 11/16] staging: ks7010: use ether_addr_copy in ks_wlan_get_wap

2018-04-25 Thread Sergio Paracuellos
Use ether_addr_copy to copy ethernet addresses instead of a custom memcpy. This improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s

[PATCH 14/16] staging: ks7010: use ether_addr_copy in ks_wlan_get_aplist

2018-04-25 Thread Sergio Paracuellos
Use ether_addr_copy to copy ethernet addresses instead of using custom memcpy for that. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/

Re: [PATCH 06/18] staging: ks7010: use GPL-2.0+ SPDX license identifier

2018-04-25 Thread Sergio Paracuellos
On Wed, Apr 25, 2018 at 03:49:19PM +0200, Greg KH wrote: > On Tue, Apr 24, 2018 at 03:49:55PM +0200, Sergio Paracuellos wrote: > > The summary text for the GPL is not needed since the SPDX identifier > > is a legally binding shorthand that can be used instead. > > >

Re: [PATCH 21/21] staging: ks7010: init local variables when they are declared in ks7010_sdio_probe

2018-04-23 Thread Sergio Paracuellos
On Mon, Apr 23, 2018 at 2:45 PM, Dan Carpenter <dan.carpen...@oracle.com> wrote: > On Thu, Apr 19, 2018 at 07:08:15AM +0200, Sergio Paracuellos wrote: >> This commit change init point of two variables to forward them to >> init time. This variables are just being assi

Re: [PATCH 01/10] staging: ks7010: use linux circular buffer header macros to handle tx and rx queues

2018-04-23 Thread Sergio Paracuellos
On Mon, Apr 23, 2018 at 3:19 PM, Greg KH <gre...@linuxfoundation.org> wrote: > On Mon, Apr 23, 2018 at 03:02:20PM +0200, Sergio Paracuellos wrote: >> On Mon, Apr 23, 2018 at 2:30 PM, Greg KH <gre...@linuxfoundation.org> wrote: >> > On Mon, Apr 16, 2018 at 12:29:23PM +

Re: [PATCH 21/21] staging: ks7010: init local variables when they are declared in ks7010_sdio_probe

2018-04-23 Thread Sergio Paracuellos
On Mon, Apr 23, 2018 at 3:24 PM, Dan Carpenter <dan.carpen...@oracle.com> wrote: > On Mon, Apr 23, 2018 at 03:19:49PM +0200, Sergio Paracuellos wrote: >> On Mon, Apr 23, 2018 at 2:45 PM, Dan Carpenter <dan.carpen...@oracle.com> >> wrote: >> > On Thu, Apr

Re: [PATCH 01/10] staging: ks7010: use linux circular buffer header macros to handle tx and rx queues

2018-04-23 Thread Sergio Paracuellos
On Mon, Apr 23, 2018 at 2:30 PM, Greg KH <gre...@linuxfoundation.org> wrote: > On Mon, Apr 16, 2018 at 12:29:23PM +0200, Sergio Paracuellos wrote: >> This commit replace current custom implementation of some circular >> buffer head and tail logic in favour of the use of macro

Re: [PATCH 05/21] staging: ks7010: change if-else condition assignment to use ternary operator

2018-04-23 Thread Sergio Paracuellos
On Mon, Apr 23, 2018 at 2:09 PM, Dan Carpenter <dan.carpen...@oracle.com> wrote: > On Thu, Apr 19, 2018 at 07:07:59AM +0200, Sergio Paracuellos wrote: >> This commit changes an if-else block used to just assign a >> variable to use a ternary operator to do the same imp

[PATCH 04/24] staging: ks7010: delete not used definitions in ks7010_sdio source

2018-04-23 Thread Sergio Paracuellos
This commit removes two definitions inside ks7010_sdio source file because they are not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/

[PATCH 06/24] staging: ks7010: review comment style in ks7010_sdio source file

2018-04-23 Thread Sergio Paracuellos
multiline comment style to use the normal preferred kernel style. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/d

[PATCH 00/24] staging: ks7010: remaining cleanups from previous series

2018-04-23 Thread Sergio Paracuellos
This patch series contains those patches which wasn't be applied from previous series. Just rebase and resend them to be applied. Sergio Paracuellos (24): staging: ks7010: avoid casts in michael_mic_function calls staging: ks7010: move ROM_FILE definition into source file staging: ks7010

[PATCH 15/24] staging: ks7010: change name and type for device_open_status field

2018-04-23 Thread Sergio Paracuellos
field name from device_open_status to is_device_open. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_hostif.c | 2 +- drivers/staging/ks7010/ks_wlan.h | 2 +- drivers/staging/ks7010/ks_wlan_net.c | 5 ++--- 3 files changed, 4 insertions

[PATCH 20/24] staging: ks7010: remove two fields of ks_wlan_private struct

2018-04-23 Thread Sergio Paracuellos
This commit removes l2_dev and l2_fd fields of ks_wlan_private struct because they are not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/

[PATCH 01/24] staging: ks7010: avoid casts in michael_mic_function calls

2018-04-23 Thread Sergio Paracuellos
. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_hostif.c | 17 ++--- drivers/staging/ks7010/michael_mic.c | 2 +- drivers/staging/ks7010/michael_mic.h | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/d

[PATCH 02/24] staging: ks7010: move ROM_FILE definition into source file

2018-04-23 Thread Sergio Paracuellos
This commit moves ROM_FILE from header to source file because there is not being used outside this. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 1 + drivers/staging/ks7010/ks7010_sdio.h | 2 -- 2 files changed, 1 insertion

[PATCH 19/24] staging: ks7010: avoid blank line between definitions in hostif_data_request

2018-04-23 Thread Sergio Paracuellos
This commit removes a blank line between definition in hostif_data_request function. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_hostif.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/s

[PATCH 08/24] staging: ks7010: avoid one extra level indentation in ks_wlan_hw_rx function

2018-04-23 Thread Sergio Paracuellos
This commit use an and operator in a if condition to avoid one indentation level which is not needed at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff

[PATCH 13/24] staging: ks7010: use u8 instead of unsigned char for firmware buffers

2018-04-23 Thread Sergio Paracuellos
This commit replaces type unsigned char which is the one which is being used for firmware buffers with u8 type which is preferred. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 del

[PATCH 11/24] staging: ks7010: check sdio_set_block_size return value

2018-04-23 Thread Sergio Paracuellos
This commit checks sdio_set_block_size function return value. If it fails abort driver initialization. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/

[PATCH 09/24] staging: ks7010: move MODULE_DEVICE_TABLE related code

2018-04-23 Thread Sergio Paracuellos
This commit moves MODULE_DEVICE_TABLE related code to the end of the file. This is not necessary at all but moving it just before its use improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 14 +++---

[PATCH 22/24] staging: ks7010: review includes of ks_hostif file

2018-04-23 Thread Sergio Paracuellos
of some preprocessor conditional code of WPS definition. This definition is in ks_wlan.h so this one must be included before the ks_hostif.h header file. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_hostif.c | 11 --- 1 file chan

[PATCH 17/24] staging: ks7010: remove superfluous comments in ks_hostif source file

2018-04-23 Thread Sergio Paracuellos
This commit removes some comments which are not necessary at all because code is clear enough to understand its intention. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_hostif.c | 39 +++--- 1 file chan

[PATCH 21/24] staging: ks7010: removes data_buff field of ks_wlan_private struct

2018-04-23 Thread Sergio Paracuellos
This commit removes data_buff array field of ks_wlan_private which is not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/ks7010/ks_wlan.h b/d

[PATCH 03/24] staging: ks7010: move sdio specific register definitions into source file

2018-04-23 Thread Sergio Paracuellos
This commit moves SDIO related register definitions from header to source file. There is no need to have those into the header because they are only being used in specific SDIO code. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.

Re: [PATCH 05/21] staging: ks7010: change if-else condition assignment to use ternary operator

2018-04-23 Thread Sergio Paracuellos
bunch of tricky > improvements to the code. I reviewed it pretty carefully and couldn't > find any new bugs. Thanks Dan. I learn from every comment. This patch was already applied but I'll take into account those way also from now. > > regards, > dan carpenter > Best

[PATCH 16/24] staging: ks7010: avoid one level indentation in devio_rec_ind function

2018-04-23 Thread Sergio Paracuellos
This commit changes logic to handle with the status of the device at first checking for close state to return directly instead of just do the stuff when device is open. This improves readability avoiding one level indentation. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.

[PATCH 12/24] staging: ks7010: fix error paths in ks7010_sdio_remove function

2018-04-23 Thread Sergio Paracuellos
if send_stop_request call fails it was making a direct 'return' instead of doing a properly cleaning. Because of this a new 'err_free_card' label has been added. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 42 ++--

[PATCH 07/24] staging: ks7010: review debug and error messages in ks7010_sdio source

2018-04-23 Thread Sergio Paracuellos
This commit reviews debug and error messages in code located in ks7010_sdio source file avoiding to use 'error' or 'ks7010' because this file is using netdev_* functions and has non sense to repeat information in log messages. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.

[PATCH 10/24] staging: ks7010: replace create_workqueue with alloc_workqueue

2018-04-23 Thread Sergio Paracuellos
This commit replaces deprecated create_workqueue call with the alloc_workqueue one which is the one to be used now for this purpose. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH 18/24] staging: ks7010: fix warning aout long line in init_request

2018-04-23 Thread Sergio Paracuellos
This commit fix length of the definition line of init_request function. Warning from checkpatch script for this is fixed. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_hostif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH 14/24] staging: ks7010: assign dev_alloc_name() result to variable before check it

2018-04-23 Thread Sergio Paracuellos
This commit assigns dev_alloc_name() call to 'ret' variable to check it after instead of check directly the call in the if condition. This improves a bit readability. It also add an empty line before the new assignment to separate it from the previous check statement block. Signed-off-by: Sergio

[PATCH 23/24] staging: ks7010: use IW_HANDLER macro in ks_wlan_handler

2018-04-23 Thread Sergio Paracuellos
are affected have been updated also to make use of the union iwreq_data as third parameter updating code accordly. Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com> --- drivers/staging/ks7010/ks_wlan_net.c | 446 +-- 1 file changed, 213 insertions(+

<    8   9   10   11   12   13   14   15   16   17   >