Ajay Singh [Mon, 23 Apr 2018 16:33:33 +0000 (22:03 +0530)]
staging: wilc1000: rename goto labels starting with '_' in wilc1000_wlan_init()
Rename goto labels starting with '_' in wilc1000_wlan_init() to follow
linux coding style.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:32 +0000 (22:03 +0530)]
staging: wilc1000: rename goto label '_fail_' linux naming convension
Rename '_fail_' goto label to have name as per linux coding style.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:31 +0000 (22:03 +0530)]
staging: wilc1000: remove the use of goto label in wilc_init()
Added direct return in wilc_init() instead of goto label. Changes
are done to avoid the use of '_' in label name.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:30 +0000 (22:03 +0530)]
staging: wilc1000: remove goto label '_done_' in handle_listen_state_expired()
Remove the use of goto label '_done_' in handle_listen_state_expired().
Changes are done to avoid the use of '_' in label name.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:29 +0000 (22:03 +0530)]
staging: wilc1000: remove the use of goto label in wilc_spi_read_int()
In wilc_spi_read_int() remove the use of goto label '_fail_'. Changes
are done to avoid the use of '_' in label name.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:28 +0000 (22:03 +0530)]
staging: wilc1000: remove the use of goto label in wilc_spi_read_size()
In wilc_spi_read_size() remove the use of goto label '_fail_'. Changes
are done to avoid the use of '_' in label name.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:27 +0000 (22:03 +0530)]
staging: wilc1000: remove the use of goto label in spi_cmd_complete()
In spi_cmd_complete() remove the use of goto label '_error_'. Changes
were done to avoid the use of '_' in label name.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:26 +0000 (22:03 +0530)]
staging: wilc1000: remove multiple define for mac connect and disconnect
Cleanup patch to have commonly used macro in common header file to avoid
same defination in mulitple file. Removed MAC_CONNECTED &
MAC_DISCONNECTED macro from coreconfigurator.h header.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:25 +0000 (22:03 +0530)]
staging: wilc1000: remove multiple define used for MAX_SSID_LEN
Cleanup patch to have commonly used macro in common header file to avoid
same defination in mulitple file. Removed MAX_SSID_LEN macro from
coreconfigurator.h header as its already defined in wilc_wlan_if.h.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:24 +0000 (22:03 +0530)]
staging: wilc1000: remove unused macros in wilc module
Cleanup patch to remove the macros which are defined by not used.
Below mentioned macros are removed:
SCAN_DONE
SCAN_EVENT_DONE_ABORTED
WILC_WFI_RX_INTR
WILC_WFI_TX_INTR
WILC_WFI_TIMEOUT
WILC_WFI_DWELL_PASSIVE
WILC_WFI_DWELL_ACTIVE
MAX_SURVEY_RESULT_FRAG_SIZE
SURVEY_RESULT_LENGTH
NUM_BASIC_SWITCHES
NUM_FHSS_SWITCHES
NUM_11N_BASIC_SWITCHES
NUM_11N_HUT_SWITCHES
BA_SESSION_DEFAULT_BUFFER_SIZE
BA_SESSION_DEFAULT_TIMEOUT
BLOCK_ACK_REQ_SIZE
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:23 +0000 (22:03 +0530)]
staging: wilc1000: added identifiers name in function definations
Fix identifier names required for functions definition issues reported
by checkpatch.pl script.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:22 +0000 (22:03 +0530)]
staging: wilc1000: rename WID_LOGTerminal_Switch to avoid camelCase
Fix 'Avoid camelCase' issue found by checkpatch.pl script.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:21 +0000 (22:03 +0530)]
staging: wilc1000: fix line over 80 chars in change_station()
Fix 'line over 80 chars' issue found by checkpatch.pl script.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:20 +0000 (22:03 +0530)]
staging: wilc1000: use sizeof(variable) for memory allocated to store key info
Changes to fix below checkpatch reported issues.
CHECK: Prefer kmalloc(sizeof(*priv->wilc_gtk[idx])...) over
kmalloc(sizeof(struct wilc_wfi_key)...)
CHECK: Prefer kmalloc(sizeof(*priv->wilc_ptk[idx])...) over
kmalloc(sizeof(struct wilc_wfi_key)...)
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:19 +0000 (22:03 +0530)]
staging: wilc1000: handle error condition in add_key() and remove auth_type variable
Added the code to return correct error code in add_key() and also removed
'auth_type' variable. Now passing diretly to function instead of using
the 'auth_type' variable.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:18 +0000 (22:03 +0530)]
staging: wilc1000: refactor add_key() to avoid duplicated code
Cleanup fixes by removing the duplicated code in actor add_key().
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:17 +0000 (22:03 +0530)]
staging: wilc1000: remove inner block {} and resetting of mode variable
Cleanup fixes to remove the uncessary inner block { /* */ } and setting
of 'mode' variable.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:16 +0000 (22:03 +0530)]
staging: wilc1000: split add_key() to avoid line over 80 chars
Cleanup changes to fix 'line over 80 chars' issue found by checkpatch.pl
script by spliting the function. Also make use of kzalloc() instead
kmalloc().
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:15 +0000 (22:03 +0530)]
staging: wilc1000: rename variable using datatype in their name in add_key()
Cleanup changes to use variable name as per linux coding style.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:14 +0000 (22:03 +0530)]
staging: wilc1000: rename WILC_WFI_wep_key & WILC_WFI_wep_key_len
Cleanup patch to use lower case for variable name as per linux coding
style.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:13 +0000 (22:03 +0530)]
staging: wilc1000: remove line over 80 char warning in few functions
Remove 'line over 80 characters' issues found by checkpatch.pl script
for following functions.
disconnect()
del_pmksa()
wilc_create_wiphy()
del_pmksa()
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:12 +0000 (22:03 +0530)]
staging: wilc1000: remove unused 'struct add_key_params'
Cleanup patch to remove unused struct data structure.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:11 +0000 (22:03 +0530)]
staging: wilc1000: remove line over 80 char in cfg_connect_result()
Fix 'line over 80 characters' issues reported by checkpatch.pl script in
cfg_connect_result().
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:10 +0000 (22:03 +0530)]
staging: wilc1000: fix line over 80 char issue in clear_shadow_scan()
Remove 'line over 80 char' issue found by checkpatch.pl script.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:09 +0000 (22:03 +0530)]
staging: wilc1000: rename hAgingTimer to avoid camelCase issue
Fix 'Avoid camelCase' issue found by checkpatch.pl script.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:08 +0000 (22:03 +0530)]
staging: wilc1000: refactor mgmt_tx to fix line over 80 chars
Refactor mgmt_tx() to fix line over 80 characters issue. Split the
function to avoid the checkpatch.pl warning. Returning the same error
code in case of memory allocation failure.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:07 +0000 (22:03 +0530)]
staging: wilc1000: rename WILC_WFI_p2p_rx & s32Freq to avoid camelCase
Fix 'Avoid camelCase' issue found by checkpatch.pl script.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:06 +0000 (22:03 +0530)]
staging: wilc1000: refactor WILC_WFI_p2p_rx() to avoid line over 80 char
Fix 'line over 80 characters' issue found by checkpatch.pl script.
Refactor and split the function to avoid the checkpatch reported issues.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:05 +0000 (22:03 +0530)]
staging: wilc1000: remove line over 80 char warnings in set_wiphy_params()
Fix 'line over 80 character' issue reported by checkpatch.pl script in
set_wiphy_params(). Directly used the 'wiphy' pointer received as
function argument instead of using 'priv->dev->ieee80211_ptr->wiphy'.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:04 +0000 (22:03 +0530)]
staging: wilc1000: removed unused static variables for gtk and ptk information
Removed the unnecessary static variables used to store gtk and ptk
information. Key data stored in the params was never access using these
variables.
Variables given below are removed
g_add_gtk_key_params;
g_key_gtk_params;
g_add_ptk_key_params;
g_key_ptk_params;
g_key_wep_params;
g_ptk_keys_saved;
g_gtk_keys_saved;
g_wep_keys_saved;
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ajay Singh [Mon, 23 Apr 2018 16:33:03 +0000 (22:03 +0530)]
staging: wilc1000: refactor scan() to free kmalloc memory on failure cases
Added changes to free the allocated memory in scan() for error condition.
Also added 'NULL' check validation before accessing allocated memory.
Copied the SSID information in consecutive slots to avoid inbetween
holes while filling into array.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:07 +0000 (15:50 +0200)]
staging: ks7010: refactor hostif_sme_set_pmksa function
This commits refactor a bit hostif_sme_set_pmksa function:
- avoid one level indentation changing if condition.
- use ether_addr_copy to copy bssid addresses.
- move 'i' initialization to declaration place.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:06 +0000 (15:50 +0200)]
staging: ks7010: use ether_addr_copy in hostif_sme_multicast_set
Use ether_addr_copy to copy ethernet addresses in function
hostif_sme_multicast_set instead of memcpy.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:05 +0000 (15:50 +0200)]
staging: ks7010: use ether_addr_equal in hostif_data_request
Use ether_addr_equal to compare addresses in ether_addr_equal
function instead of comparing using memcmp.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:04 +0000 (15:50 +0200)]
staging: ks7010: use ether_addr_equal in hostif_data_indication
Instead of comparing ethernet address using memcmp in function
hostif_data_indication use ether_addr_equal function created
for this function.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:03 +0000 (15:50 +0200)]
staging: ks7010: use ether_addr_copy in hostif_mib_get_confirm
This commit improves readability changing custom ethernet
addresses copies in favour of using ether_addr_copy() function.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:02 +0000 (15:50 +0200)]
staging: ks7010: use ether_addr_copy() instead of custom copy
In order to achieve ethernet address copies, ether_addr_copy()
function exists. So just use it and avoid the byte by byte copy.
This increase readability.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:01 +0000 (15:50 +0200)]
staging: ks7010: remove duplicated ks_wlan_handler_def declaration
This declaration is declared twice so just remove this one because
the other one is the one which contains static struct initializers.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:00 +0000 (15:50 +0200)]
staging: ks7010: remove WPS definition conditional code
WPS definition was defined by default in ks_wlan.h header
file. So it makes no sense to have conditional preprocessor
stuff along the code about this.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:59 +0000 (15:49 +0200)]
staging: ks7010: fix line exceding 80 characters in ks_wlan_get_range
Avoid very long if condition just changing its style. This makes
checkpatch script not complains about this line.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:58 +0000 (15:49 +0200)]
staging: ks7010: refactor ks_wlan_get_mode function
Avoid the use of switch-case block which is not necessary
at all and just use a ternary operator to achieve this.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:57 +0000 (15:49 +0200)]
staging: ks7010: refactor ks_wlan_set_mode function
Most cases which are being handled in the switch-case of
ks_wlan_set_mode function are just returning EINVAL. Avoid
the use of switch-case stament and just use a simple if
to handle those. This decrease LOC as well as improves
readability.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:56 +0000 (15:49 +0200)]
staging: ks7010: remove some duplicated definitions in ks_wlan_net.c
This definitions are in linux/wireless.h header so it is not
necessary at all to have this compatibility stuff duplicated here.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:54 +0000 (15:49 +0200)]
staging: ks7010: avoid use of brackets in single line if
Singles if does not need at all to use brackets in its body
so just remove them which is the preferred style.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:53 +0000 (15:49 +0200)]
staging: ks7010: refactor hostif_sme_power_mgmt_set function
Some minor changes have been done in this function to clean
it a bit:
- POWER_MGMT_ACTIVE and default case are the same so
just handle that with the same block of code,
- POWER_MGMT_SAVE1 replaces if-else with a ternary operator.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:52 +0000 (15:49 +0200)]
staging: ks7010: use definitions from kernel headers in hostif_data_indication function
Function hostif_data_indication checks some hardcoded values in a
switch-case block. This values are defined in uapi/linux/llc.h
header. Just use them and avoid a comment in the code improving
readability a bit.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:51 +0000 (15:49 +0200)]
staging: ks7010: join some debug traces in get_current_ap function
There is a lot of netdev_dbg calls related with the access point
in this function and all of them can be joined in only one call.
This makes code a bit simplier.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:50 +0000 (15:49 +0200)]
staging: ks7010: avoid some if-else code in get_current_ap function
This commits avoid some if-else code extracting common code before
its use and making use of a new variable 'size' which is assigned
using a ternary operator. This improves readability.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:57 +0000 (15:44 +0200)]
staging: ks7010: remove KSC_OPNOTSUPP related code
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:56 +0000 (15:44 +0200)]
staging: ks7010: use IW_HANDLER macro in ks_wlan_handler
This commit make use of IW_HANDLER to set wext operations
of the device. Using this, comments are not neccessary anymore
and also NULL entries so readability is clearly increased.
In order to avoid casting because of the use of a different
prototype in all related functions, those which 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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:55 +0000 (15:44 +0200)]
staging: ks7010: review includes of ks_hostif file
This commit reviews includes of ks_hostif.c source file.
Those which are not being used at all have been removed.
Driver header includes have been moved after the kernel
header includes to make style consistent in different
files of the driver. The need of ks_wlan.h header include
is only because 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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:54 +0000 (15:44 +0200)]
staging: ks7010: removes data_buff field of ks_wlan_private struct
This commit removes data_buff array field of ks_wlan_private
which is not being used at all.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:53 +0000 (15:44 +0200)]
staging: ks7010: remove two fields of ks_wlan_private struct
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:52 +0000 (15:44 +0200)]
staging: ks7010: avoid blank line between definitions in hostif_data_request
This commit removes a blank line between definition in
hostif_data_request function.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:51 +0000 (15:44 +0200)]
staging: ks7010: fix warning aout long line in init_request
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:50 +0000 (15:44 +0200)]
staging: ks7010: remove superfluous comments in ks_hostif source file
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:49 +0000 (15:44 +0200)]
staging: ks7010: avoid one level indentation in devio_rec_ind function
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:48 +0000 (15:44 +0200)]
staging: ks7010: change name and type for device_open_status field
This commit changes type for device_open_status field of ks_wlan_private
structure from int to bool. This variable is only be set to 1
on ks_wlan_net_start and set to 0 on ks_wlan_net_stop. For this
purpose it is not necessary at all to use an integer because a bool
is enough. This also renames field name from device_open_status to
is_device_open.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:47 +0000 (15:44 +0200)]
staging: ks7010: assign dev_alloc_name() result to variable before check it
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 Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:46 +0000 (15:44 +0200)]
staging: ks7010: use u8 instead of unsigned char for firmware buffers
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:45 +0000 (15:44 +0200)]
staging: ks7010: fix error paths in ks7010_sdio_remove function
This commit reviews and fixes error paths in ks7010_sdio_remove
driver function. It change logic to handle error directly
after priv dereference to avoid one level indentation. It also
removes a temporal netdev variable which wasn't being used in all
of the function calls. Also 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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:44 +0000 (15:44 +0200)]
staging: ks7010: check sdio_set_block_size return value
This commit checks sdio_set_block_size function return value.
If it fails abort driver initialization.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:43 +0000 (15:44 +0200)]
staging: ks7010: replace create_workqueue with alloc_workqueue
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:42 +0000 (15:44 +0200)]
staging: ks7010: move MODULE_DEVICE_TABLE related code
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:41 +0000 (15:44 +0200)]
staging: ks7010: avoid one extra level indentation in ks_wlan_hw_rx function
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:40 +0000 (15:44 +0200)]
staging: ks7010: review debug and error messages in ks7010_sdio source
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:39 +0000 (15:44 +0200)]
staging: ks7010: review comment style in ks7010_sdio source file
This commit reviews comment style used in ks7010_sdio source file
in order to be coherent with the rest of the code. Most comments
in this source are before definitions but only two of them have
been written at the right. So, be coherent moving this two to the
top of definitions. Also fix one multiline comment style to use
the normal preferred kernel style.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:38 +0000 (15:44 +0200)]
staging: ks7010: add REG suffix to sdio register definitions
This commit adds REG suffix to register definitions related
with SDIO in order to improve readability.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:37 +0000 (15:44 +0200)]
staging: ks7010: delete not used definitions in ks7010_sdio source
This commit removes two definitions inside ks7010_sdio source file
because they are not being used at all.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:36 +0000 (15:44 +0200)]
staging: ks7010: move sdio specific register definitions into source file
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.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:35 +0000 (15:44 +0200)]
staging: ks7010: move ROM_FILE definition into source file
This commit moves ROM_FILE from header to source file because
there is not being used outside this.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:34 +0000 (15:44 +0200)]
staging: ks7010: avoid casts in michael_mic_function calls
This commit removes casts in calls to michael_mic_function.
Most of them are nosense because types match perfectly function
parameters. To avoid also int casting for len parameter just
pass unsigned len to function which makes sense because is only
being called with unsigned int len parameters.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Lütke-Stetzkamp [Wed, 25 Apr 2018 06:43:18 +0000 (08:43 +0200)]
staging: mt7621-mmc: Fix calculation typo in msdc_init_gpd_bd
When refactoring the function msdc_init_gpd_bd, an error in the
calculation of the bd.next address was introduced. The offset has to
be added to the base address, not multiplied.
Fixes:
8f2395586cf0 ("staging: mt7621-mmc: Refactor msdc_init_gpd_bd")
Reported-by: NeilBrown <neil@brown.name>
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Tested-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Lütke-Stetzkamp [Tue, 24 Apr 2018 18:01:29 +0000 (20:01 +0200)]
staging: mt7621-mmc: Remove unused card_workqueue from msdc_host
The card_workqueue field of msdc_host is already if 0'd out and there
are no references to it in the code (not even in unused code), so
remove it.
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Lütke-Stetzkamp [Tue, 24 Apr 2018 18:01:28 +0000 (20:01 +0200)]
staging: mt7621-mmc: Remove old references to tasklet
In the current code there are '#if 0' out references on using a
tasklet instead of delayed_work. Removing these improves readability.
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Lütke-Stetzkamp [Tue, 24 Apr 2018 18:01:27 +0000 (20:01 +0200)]
staging: mt7621-mmc: Add annotations about held locks
The functions msdc_command_resp and msdc_do_request are always called
with the host->lock lock held. By adding annotations, sparse is
informed about that.
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Lütke-Stetzkamp [Tue, 24 Apr 2018 18:01:26 +0000 (20:01 +0200)]
staging: mt7621-mmc: Correct datatypes for io and sanitize io access
Current code discard the address space information on the base address
of the mmc controller, that causes sparse warnings. It uses the raw
read write function, that is correct for the mips architecture (little
endian), but for portability the non-raw function should be used. Also
the clear/set bit macros do direct memory access, that is also correct
for mips, but not portable.
So the type of the base address is changed to void __iomem *, that is
the type returned by the ioremap function. The set/clear bit macros
are changed to functions, that use the portable read and write
functions. The use of the raw access functions is changed to use the
non-raw ones.
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Lütke-Stetzkamp [Tue, 24 Apr 2018 18:01:25 +0000 (20:01 +0200)]
staging: mt7621-mmc: Replace dma dir with mmc_get_dma_dir
Currently the dma direction is manually determined by the read status,
there is a more portable function for it, mmc_get_dma_dir, use it.
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Lütke-Stetzkamp [Tue, 24 Apr 2018 18:01:24 +0000 (20:01 +0200)]
staging: mt7621-mmc: Fix dma_map_sg may map to fewer entries
The dma_map_sg function may merge several sglist entries into one, the
return value has to be saved to consider that. The data->sg_count
field is the position, where it should be saved, like it is done in
other mmc host drivers. Also the count of mapped entries is needed for
the dma setup.
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Lütke-Stetzkamp [Tue, 24 Apr 2018 18:01:23 +0000 (20:01 +0200)]
staging: mt7621-mmc: Remove multiple assignments
Fix checkpatch: multiple assignments should be avoided, to improve
readability.
It aslo moves the second assignment out of the if/else block, that is
valid, because drv_mode is of type msdc_mode, an enum with only those
three elements, so one of the if/ else if statements is always
taken. And the second assignment can happen after the conditions.
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Lütke-Stetzkamp [Tue, 24 Apr 2018 18:01:22 +0000 (20:01 +0200)]
staging: mt7621-mmc: Fix dereference before check in msdc_drv_pm
In the msdc_drv_pm function the variable mmc is dereferenced before
checked. Reordering fixes that.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
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>
Marc Dietrich [Mon, 23 Apr 2018 15:17:51 +0000 (17:17 +0200)]
Revert "staging: nvec: Augment TODO file with GPIO work item"
This reverts commit
5a3e59ce3acf2f52c8b4a6fc656c3b1e4a329f06, because the
necessary changes were applied in the "staging: nvec: convert to use GPIO
descriptors" patch.
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yangbo Lu [Mon, 23 Apr 2018 03:55:01 +0000 (11:55 +0800)]
MAINTAINERS: add maintainer for the DPAA2 PTP clock driver
This patch is to add maintainer for the DPAA2 PTP clock driver.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yangbo Lu [Mon, 23 Apr 2018 03:55:00 +0000 (11:55 +0800)]
staging: fsl-dpaa2/rtc: add rtc driver
This patch is to add driver for the DPAA2 1588 timer module (RTC)
which interfaces to up to an unlimited number of 10/100/1000 or
10G ethernet MACs, providing current time, alarm, and fiper support.
The 1588 IP control block includes these distinctive features.
- External GPIO trigger for time-stamping
- 2 Time-stamp alarms
- 3 FIPER pulse generators
- Phase adjusted output timer clock
Currently this driver only supports basic functions like
settime/gettime/adjtime/adjfreq.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Roy Pledge [Tue, 27 Mar 2018 18:13:32 +0000 (14:13 -0400)]
drivers/staging/fsl-mc: Fix DPIO error path issue
Remove unneeded call to dev_set_drvdata(dev, NULL) since the device
will be deallocated in any case.
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Roy Pledge [Tue, 27 Mar 2018 18:13:31 +0000 (14:13 -0400)]
drivers/staging/fsl-mc: Use devm_memremap/devm_ioremap for DPIO
Change the mapping of the QBMan cache enabled area from using ioremap_wc()
to devm_memremap(). This allows the __iomem attribute to be removed from
the pointer (which makes sense as accesses treat this as cacheable memory
not IO memory). These changes allow sparse checks to pass.
Also use devm_ioremap() for the cache inhibited area so unmap occurs
automatically when the device is released.
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jia-Ju Bai [Tue, 10 Apr 2018 12:25:34 +0000 (20:25 +0800)]
staging: rtl8192u: Replace mdelay with usleep_range in dm_TXPowerTrackingCallback_TSSI
dm_TXPowerTrackingCallback_TSSI() is never called in atomic context.
dm_TXPowerTrackingCallback_TSSI() is only called by
dm_txpower_trackingcallback(), which is set a parameter of
INIT_DELAYED_WORK() in rtl8192_init_priv_task().
Despite never getting called from atomic context,
dm_TXPowerTrackingCallback_TSSI() calls mdelay() to busily wait.
This is not necessary and can be replaced with usleep_range() to
avoid busy waiting.
This is found by a static analysis tool named DCNS written by myself.
And I also manually check it
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jia-Ju Bai [Tue, 10 Apr 2018 12:25:09 +0000 (20:25 +0800)]
staging: rtl8192u: Replace mdelay with usleep_range in rtl8192_usb_disconnect
rtl8192_usb_disconnect() is never called in atomic context.
rtl8192_usb_disconnect() is only set as ".disconnect" in
struct usb_driver.
Despite never getting called from atomic context,
rtl8192_usb_disconnect() calls mdelay() to busily wait.
This is not necessary and can be replaced with usleep_range() to
avoid busy waiting.
This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jia-Ju Bai [Tue, 10 Apr 2018 12:24:23 +0000 (20:24 +0800)]
staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_softmac_init
ieee80211_softmac_init() is never called in atomic context.
The call chains ending up at ieee80211_softmac_init() is:
[1] ieee80211_softmac_init() <- alloc_ieee80211_rsl() <-
rtl8192_usb_probe()
rtl8192_usb_probe() is set as ".probe" in struct usb_driver.
Despite never getting called from atomic context,
ieee80211_softmac_init() calls kzalloc() with GFP_ATOMIC,
which does not sleep for allocation.
GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL,
which can sleep and improve the possibility of sucessful allocation.
This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jia-Ju Bai [Tue, 10 Apr 2018 12:23:54 +0000 (20:23 +0800)]
staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in prism2_wep_init
prism2_wep_init() is never called in atomic context.
prism2_wep_init() is only set as ".init" in
struct ieee80211_crypto_ops.
The call chains ending up at "->init" function are:
[1] ->init() <- ieee80211_wpa_set_encryption() <-
ieee80211_wpa_supplicant_ioctl()
[2] ->init() <- ieee80211_wx_set_encode_ext_rsl() <-
r8192_wx_set_enc_ext()
[3] ->init() <- ieee80211_wx_set_encode_rsl() <-
r8192_wx_set_enc()
ieee80211_wpa_supplicant_ioctl(), r8192_wx_set_enc_ext() and
r8192_wx_set_enc() call mutex_lock(), which indicates these functions
are not called in atomic context.
Despite never getting called from atomic context,
prism2_wep_init() calls kzalloc() with GFP_ATOMIC,
which does not sleep for allocation.
GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL,
which can sleep and improve the possibility of sucessful allocation.
This is found by a static analysis tool named DCNS written by myself.
And I also manually check it
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jia-Ju Bai [Tue, 10 Apr 2018 12:23:29 +0000 (20:23 +0800)]
staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_tkip_init
ieee80211_tkip_init() is never called in atomic context.
ieee80211_tkip_init() is only set as ".init" in
struct ieee80211_crypto_ops.
The call chains ending up at "->init" function are:
[1] ->init() <- ieee80211_wpa_set_encryption() <-
ieee80211_wpa_supplicant_ioctl()
[2] ->init() <- ieee80211_wx_set_encode_ext_rsl() <-
r8192_wx_set_enc_ext()
[3] ->init() <- ieee80211_wx_set_encode_rsl() <-
r8192_wx_set_enc()
ieee80211_wpa_supplicant_ioctl(), r8192_wx_set_enc_ext() and
r8192_wx_set_enc() call mutex_lock(), which indicates these functions
are not called in atomic context.
Despite never getting called from atomic context,
ieee80211_tkip_init() calls kzalloc() with GFP_ATOMIC,
which does not sleep for allocation.
GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL,
which can sleep and improve the possibility of sucessful allocation.
This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jia-Ju Bai [Tue, 10 Apr 2018 12:23:00 +0000 (20:23 +0800)]
staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_ccmp_init
ieee80211_ccmp_init() is never called in atomic context.
ieee80211_ccmp_init() is only set as ".init" in
struct ieee80211_crypto_ops.
The call chains ending up at "->init" function are:
[1] ->init() <- ieee80211_wpa_set_encryption() <-
ieee80211_wpa_supplicant_ioctl()
[2] ->init() <- ieee80211_wx_set_encode_ext_rsl() <-
r8192_wx_set_enc_ext()
[3] ->init() <- ieee80211_wx_set_encode_rsl() <-
r8192_wx_set_enc()
ieee80211_wpa_supplicant_ioctl(), r8192_wx_set_enc_ext() and
r8192_wx_set_enc() call mutex_lock(), which indicates these functions
are not called in atomic context.
Despite never getting called from atomic context,
ieee80211_ccmp_init() calls kzalloc() with GFP_ATOMIC,
which does not sleep for allocation.
GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL,
which can sleep and improve the possibility of sucessful allocation.
This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Joao Dalben [Tue, 3 Apr 2018 23:36:43 +0000 (20:36 -0300)]
staging: rtl8192e: Fixed coding style around a plus sign
Added blank spaces between a plus sign in order to standardize the coding
style.
Signed-off-by: Joao Dalben <jhdalben@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gabriel Francisco Mandaji [Tue, 10 Apr 2018 22:50:07 +0000 (19:50 -0300)]
staging: comedi: cb_pcidas64: fix alignment of function parameters
Fix most checkpatch.pl issues of type:
CHECK: Alignment should match open parenthesis
Signed-off-by: Gabriel Francisco Mandaji <gfmandaji@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Geert Uytterhoeven [Tue, 17 Apr 2018 17:49:19 +0000 (19:49 +0200)]
staging: vc04_services: Remove depends on HAS_DMA in case of platform dependency
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
In most cases this other symbol is an architecture or platform specific
symbol, or PCI.
Generic symbols and drivers without platform dependencies keep their
dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
cannot work anyway.
This simplifies the dependencies, and allows to improve compile-testing.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 31 Mar 2018 20:09:47 +0000 (22:09 +0200)]
staging: vchiq_core: Free kthreads in error case
We need to free the kthreads in error case before leaving
vchiq_init_state() otherwise we leak resources.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 31 Mar 2018 20:09:46 +0000 (22:09 +0200)]
staging: vchiq_core: Move all wake-ups to one point
Move all calls of wake_up_process to one point, whichs makes the
following implementation of clean-up code easier.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 31 Mar 2018 20:09:45 +0000 (22:09 +0200)]
staging: vchiq_arm: Avoid long udelay
vchiq_initialise() is used in non-interrupt context, so we can
replace udelay with usleep_range as suggested by timers-howto.txt.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 31 Mar 2018 20:09:44 +0000 (22:09 +0200)]
staging: vchiq_arm: Fix multiline dereferences
Multiline dereferences aren't nice to review. So fix this checkpatch
warning.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 31 Mar 2018 20:09:43 +0000 (22:09 +0200)]
staging: vc04_services: Use __func__ macro
It's better to use the __func__ macro instead of open-code the function
name. This fixes the following checkpatch warning:
WARNING: Prefer using '"%s...", __func__' to using 'x',
this function's name, in a string
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>