summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ks7010/ks_hostif.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: ks7010: hostif, u16 data types to __le16Tobin C. Harding2017-05-151-7/+7
| | | | | | | | | | | | | | | Target device is little endian. Host interface data structures used for building frames to pass to target device should use little endian data types. All u16 structure members in ks_hostif.h need to be changed to __le16, Sparse can then be used to make sure we update all code that touches these data. Change all u16 data types in host interface structures to be __le16. Update all code that touches modified data types. Check using Sparse. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: avoid CamelCase: reqIEs_size and respIEs_sizeJanusz Lisiecki2017-05-151-5/+5
| | | | | | | | | | Replace CamelCase association_request_t and association_response_t struct field names with underscores to comply with the standard kernel coding style. Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com> Reviewed-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: avoid CamelCase in fields of struct local_gain_tJanusz Lisiecki2017-05-151-3/+3
| | | | | | | | | Replace CamelCase fields of struct with underscores to comply with the standard kernel coding style Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com> Reviewed-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove line continuations in quoted stringsIlia Sergachev2017-04-281-6/+24
| | | | | | | | | Checkpatch emits WARNING: Avoid line continuations in quoted strings. Remove line continuations - split strings using quotes. Signed-off-by: Ilia Sergachev <ilia.sergachev@unibas.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: clean up macro ps_confirm_wait_incTobin C. Harding2017-04-281-5/+5
| | | | | | | | | | Macro includes commented out code. Removing dead code line enables braces to be removed. Macro is easier to read if the code is clean. Clean up macro ps_confirm_wait_inc. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: continue from loop on unmatched macTobin C. Harding2017-04-281-7/+7
| | | | | | | | | | | | | | Inside loop, code block is guarded with an 'if' statement. Instead of guarding the block we can invert the 'if' statement conditional and continue the loop. Doing so allows subsequent code indentation to be reduced and aids the readability of the code. Invert 'if' statement conditional, continue loop if new conditional evaluates to true. Reduce subsequent code indentation level. Do not change program logic. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: make abbreviation mgmt uniformTobin C. Harding2017-04-281-16/+16
| | | | | | | | | | | | | | | | Driver currently uses abbreviations 'mgt' and 'mngmt' for 'management'. Also 'power' is sometimes abbreviated to 'pow' and other times not. It makes the code easier to read and easier to modify if one abbreviation is used throughout the driver. 'mgmt' is widely accepted as an abbreviation of 'management'. 'power' can be spelled out in full, the extra two characters aids readability without an excessive cost. Make abbreviation of 'management' uniform across the driver, function names, preprocessor defined constants, and enumeration types. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix checkpatch LINE_SPACINGTobin C. Harding2017-04-281-1/+0
| | | | | | | | | Checkpatch emits CHECK: Please don't use multiple blank lines. Remove multiple blank lines. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: add enum sleep_mode_typeTobin C. Harding2017-04-281-3/+4
| | | | | | | | | | | | | | Driver uses preprocessor directives to define SLP_ASLEEP and SLP_ACTIVE. These can be defined using an enumeration type. Doing so adds to the readability and gives the usual compiler benefits of having an enum. Functions that currently accept integer types can now use the new enumeration type, further aiding readability. Add enumeration type sleep_mode_type. Update code that handles sleep mode to use the new enumeration type. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: abstract connection statusTobin C. Harding2017-04-281-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | Host interface connection status is handled using a 32 bit type. Top byte is used as for FORCE_DISCONNECT status, low bits are used for connect/disconnect status. Driver masks and checks integers to ascertain status. If functions are defined to do the masking and equality check then the details of how the status integer is used are abstracted away. This makes the code easier to read. Also future updates to the status handling will be easier because the code is in one place. Driver currently uses the CONNECT_STATUS and DISCONNECT_STATUS as values, as apposed to opaque values. Because of this driver code checks for equality with CONNECT_STATUS and DISCONNECT_STATUS as apposed to negating a single check (ie 'foo != CONNECT_STATUS). In order to maintain the current functionality we define two separate functions is_connect_status() and is_disconnect_status(). Add functions to abstract the status integer check. Update all sites that do the check manually to use the newly defined functions. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: add hostif_generic_request()Tobin C. Harding2017-04-281-116/+57
| | | | | | | | | | | | | | | | Driver contains duplicate code. Host interface has numerous request functions which allocate memory for a request header. Each request header is different but all contain, as the first member, a hostif_hdr structure. This structure has size and event members which need to be set. By defining a helper function to allocate the memory and set the initial hostif_hdr members code duplication is reduced. Add function to allocate memory for a host interface request. Set 'size' and 'event' members. Remove duplicate code using newly defined function. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: clean memory allocationTobin C. Harding2017-04-281-5/+2
| | | | | | | | | | | | | | Memory allocation code contains unneeded debug statements, failed kmalloc() calls typically do not require a debug message. Introduction of a local 'size' variable allows kmalloc() call to be marginally cleaner, still uses magic numbers but these require a more substantial fix. Moving the magic numbers onto a single line opens the way for further refactoring. Clean memory allocation code, remove debug statements. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove duplicate codeTobin C. Harding2017-04-281-22/+12
| | | | | | | | | | | | Current switch statement has duplicate code in branches. This code can be put after the switch statement so as to remove the duplication. Move code to after switch statement, remove duplicate code. Make error branch return so as not to execute the moved code block. Do not change the program logic. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove magic numbersTobin C. Harding2017-04-281-9/+16
| | | | | | | | | | | | | | | | | | | Driver includes magic numbers. Defining constants or using existing constants aids the readability of the code. Magic number '12' is used for two ethernet addresses (6 bytes each). ETH_ALEN is already defined within the kernel to 6. We can us the expression '2 * ETH_ALEN' to make this code explicit. Magic number '20' refers to the data size, in bytes, of a struct ether_hdr (described in eap_packet.h). We can define a constant for this purpose, making the code explicit and easier to read. Define constant. Remove magic numbers, using newly defined constant and/or expression using existing kernel constant. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: move skb null check near allocationTobin C. Harding2017-04-281-38/+42
| | | | | | | | | | | | | | | | Currently, after allocating an sk_buff, driver fills the sk_buff within code block guarded by a NULL check on the sk_buff. If a NULL check is done immediately after the allocation, and code returns on error, then the subsequent code need not be guarded and the level of indentation may be reduced. This aids the readability of the code and makes explicit the error path. Check for NULL directly after allocating the sk_buff, return if allocation fails. Reduce indentation of subsequent code. Do not change the program logic. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove unused local variable eap_keyTobin C. Harding2017-04-281-7/+2
| | | | | | | | | | Code declares and assigns to a local variable that is never used, it can be safely removed. Remove unused local variable. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove unnecessary address checkTobin C. Harding2017-04-281-4/+0
| | | | | | | | | | | | | Currently source and destination ethernet addresses are checked twice, once in hostif_data_indication() and then again in hostif_data_indication_wpa(). The second of these functions is called from the first right after the address check is done. This check is a duplicate and is unnecessary. Remove unnecessary duplicate address check. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: move hw info into dev private dataTobin C. Harding2017-04-181-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently driver uses a hardware information struct description to group some SDIO related functionality (work, work queue, sdio private data pointer). This structure is then embedded in the device private data structure. Having nested structures described in different header files means that to view the device private data programmers must open two header files. This structure could be embedded anonymously in the device private data and achieve the same result (grouping of function specific to SDIO) without the need to open multiple headers. However, the SDIO private data structure already has various different data and pointers, adding the embedded structure adds little extra meaning and lengthens all the dereferences throughout the driver, often meaning addition line breaks and braces. We can increase readability and reduce code complexity by moving the hardware information data and pointers to directly be within the device private data structure description. While preparing for this refactoring it was noted that the identifier currently used for the delayed work is 'rw_wq', this is confusing since the 'wq' suffix typically means 'work queue'. This identifier would be more meaningful if it used the suffix 'dwork' as does the declaration of queue_delayed_work() (include/linux/workqueue.h). The identifier for the work queue is currently 'ks7010sdio_wq'. This identifier can be shortened without loss of meaning because there is only one work queue within the driver. Identifier 'wq' is typical within in-tree driver code and aptly describes the pointer. Current pointer to the SDIO private data is identified by 'sdio_card', this is sufficiently meaningful from within the hw_info structure but once the hw_info_t structure is removed the pointer would be better to have a prefix appended to it to retain the prior level of meaning. Move members from struct hw_info_t to struct ks_wlan_private. Rename identifiers; struct delayed_work pointer 'rw_wq' to 'rw_dwork'. struct workqueue_struct pointer 'ks7010sdio_wq' to 'wq'. struct ks_sdio_card pointer 'sdio_card' to 'ks_sdio_card'. Remove structure description hw_info_t. Fix init/destroy calls. Fix all call sites, SDIO private data access calls, and queuing calls. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: rename wakeup work structTobin C. Harding2017-04-181-7/+7
| | | | | | | | | | | | | | struct work_struct uses identifier ks_wlan_wakeup_task, this is confusing because the 'task' suffix implies that this is a tasklet_struct instead of a work struct. Suffix 'work' would be more clear. The code would be easier to read if it followed the principle of least surprise and used the 'work' suffix for a work_struct identifier. Rename work_struct structure 'ks_wlan_wakeup_task' to 'wakeup_work'. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix complete_handlerTobin C. Harding2017-04-181-19/+16
| | | | | | | | | | | | | | | | | | | | | | | complete_handler() takes void * types as parameters. void * parameters are then cast to struct types. Call sites for this function either pass in NULL or pointers to the struct types cast to void *. This casting is unnecessary and can be removed. Struct tx_device_buffer (which contains a pointer member to the complete_handler() function) has as member 'ks_wlan_priv *priv' this is unnecessary, we always have a pointer to this struct there is no need to store it here. The complete_handler can be more clearly defined by using struct pointer types instead of void * types. The code is currently unnecessarily complex, storing and passing extraneous pointer parameters. Remove unnecessary parameters, unnecessary casting to/from 'void *'. Fix all call sites involving complete_handler(). Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: move check and break to top of loopTobin C. Harding2017-04-111-20/+14
| | | | | | | | | | | | | | | | | Function uses an if statement within a for loop to guard a block of code. If 'if' statement conditional evaluates to false, loop breaks. The same logic can be expressed by inverting the conditional and breaking when new conditional evaluates to true. This allows the subsequent code to be indented one level less, aiding readability. Reduced indentation also allows for the code to be laid out more clearly and fixes two checkpatch warnings. Invert if statement conditional, break from for loop if new conditional evaluates to true. Reduce indentation in subsequent code, fix whitespace issues. Do not change program logic. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove multi-way decisionTobin C. Harding2017-04-111-23/+25
| | | | | | | | | | | | | | Function uses multi-way decision for control flow. Final statement of function is spin_unlock(). Code can be simplified by adding a goto label labelling the call to spin_unlock() and jumping to label instead of using multi-way decision. This allows the code to be indented one level less which adds to the readability. Add goto label. Remove multi-way decision by jumping to label. Reduce indentation in subsequent code. Do not change program logic. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove unused macroTobin C. Harding2017-04-111-2/+0
| | | | | | | | | Macro CHECK_ALINE is defined and never used. Remove unused macro. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix checkpatch MULTILINE_DEREFERENCETobin C. Harding2017-04-111-5/+7
| | | | | | | | | Checkpatch emits WARNING: Avoid multiple line dereference. Fix up layout of function call, move dereference to single line. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix checkpatch LOGICAL_CONTINUATIONSTobin C. Harding2017-04-111-30/+28
| | | | | | | | | | Checkpatch emits multiple CHECK: Logical continuations should be on the previous line. Move logical continuations to the end of the previous line. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: rename identifier packet to skbTobin C. Harding2017-04-111-21/+21
| | | | | | | | | | | | | Kernel networking code predominately uses the identifier 'skb' for a struct sk_buff pointer. Of 8088 instances of 'struct sk_buff *' within net/ 6670 are named 'skb'. Following the principle of least surprise, new networking code should use the identifier 'skb' for variables of type 'struct sk_buff *'. Rename identifier 'packet' to 'skb'. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: rename RecvMIC to recv_micTobin C. Harding2017-04-111-3/+3
| | | | | | | | | | Identifier uses camel case, standard kernel style does not use camel case. Rename buffer 'RecvMIC' to 'recv_mic'. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: invert if statement conditionalsTobin C. Harding2017-03-231-10/+10
| | | | | | | | | | | | | | | Checkpatch emits WARNING: Avoid multiple line dereference. Function uses if statement blocks to guard the body of the function. If we invert these conditionals and return, then the code becomes more readable and subsequent code is indented less. The checkpatch fix then follows trivially. Invert conditionals, return from function if new conditional evaluates to true. Reduce the level of indentation in subsequent code. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove redundant checkTobin C. Harding2017-03-231-2/+1
| | | | | | | | | | Function checks for condition inside a loop that checks the same condition, this is redundant. Fix also removes checkpatch CHECK. Remove redundant check. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: add braces to multi-line indentTobin C. Harding2017-03-231-8/+10
| | | | | | | | | | The addition of curly braces around single statements that span multiple lines makes the code more readable in general. Add curly braces to multi-line indented statement. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: add explicit check to 'size' variablesTobin C. Harding2017-03-231-1/+1
| | | | | | | | | | | | | When checking the value of a variable that holds a 0 an explicit check is good style. i.e - if (!size) + if (size == 0) Update checks on 'numerical' variables to use explicit checks. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: add explicit check to memcmp() callsTobin C. Harding2017-03-231-8/+7
| | | | | | | | | | | | | Calls to functions memcmp() and strcmp() are more clearly readable when the return value is explicitly checked. i.e if (memcmp(foo, bar, size) == 0) Modify driver to use an explicit check on the value returned by memcmp(). Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: rename return value identifierTobin C. Harding2017-03-211-8/+8
| | | | | | | | | | | | | | Driver uses multiple identifier names for the same task (retval, ret, rc). It would be easier to read the code if a single task is identified with a single name. 'ret' is the most common return value identifier name found in the kernel tree, following the principle of least surprise using 'ret' is a decent choice. Rename rc -> ret Rename retval -> ret Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove non-zero comparisonTobin C. Harding2017-03-211-3/+3
| | | | | | | | | | | | | Comparison, does not equal zero, is redundant 'if (foo != 0)' is equal to 'if (foo)' Typical kernel coding style is to use the shorter form. Remove unnecessary non-zero comparison. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix checkpatch MULTIPLE_ASSIGNMENTSTobin C. Harding2017-03-211-1/+2
| | | | | | | | | Checkpatch emits CHECK: multiple assignments should be avoided. Move multiple line assignment to individual lines. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix checkpatch BRACESTobin C. Harding2017-03-211-13/+9
| | | | | | | | | | | | | Checkpatch emits CHECK: Unbalanced braces around else statement. Statements in question are single statements so we do not need braces. Checkpatch also warns about multiple line dereference for this code. Fix if/else/else if statement use of braces. Fix function argument layout at the same time since it is the same statement. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove custom return valuesTobin C. Harding2017-03-161-10/+16
| | | | | | | | | | Driver code uses custom return values (often positive) to signal error condition instead of using standard kernel error codes. Replace custom return values with standard kernel error codes. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix spelling of Michael MICTobin C. Harding2017-03-141-8/+8
| | | | | | | | | | | | Driver mixes spelling michael and michel in symbol names and comments. Michael here references the IEEE 802.11i Message Integrity Code. It is incorrect to spell it michel and confusing having two spellings for the same thing. Change michel -> micheal in both symbol names and comments. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: add variables key, key_indexTobin C. Harding2017-03-141-3/+5
| | | | | | | | | | | | | | | | | 'auth_type - 1' is used as an index into a key table. Adding a variable appropriately named simplifies the code and adds meaning when reading. Adding a pointer variable of type struct *kpa_key_t adds to readability by removing the table access each time the key is used. The key index is used to create a string so having it named adds additional meaning when creating the string. Declare variable 'key_index' and define it at declaration time. Declare a pointer variable 'key' and define it to point to the correct key in the key table. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: reduce length of comment stringTobin C. Harding2017-03-141-1/+1
| | | | | | | | | | Comment string is unnecessarily verbose. Checkpatch emits WARNING: line over 80 characters. Reduce comment string without loss of meaning. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: move quoted string onto single lineTobin C. Harding2017-03-141-2/+1
| | | | | | | | | | | Checkpatch emits WARNING: quoted string split across lines. Line is already over 80 characters long, adding 3 more does little to effect line length while improving readibility. Concatenate split string into single line. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor newly separated functionTobin C. Harding2017-03-141-25/+17
| | | | | | | | | | | | | | | | | Checkpatch emits various warnings and checks; WARNING: Avoid multiple line dereference CHECK: Alignment should match open parenthesis WARNING: line over 80 characters CHECK: Blank lines aren't necessary before a close brace '}' These are all whitespace fixes. Refactor whitespace inline with kernel coding style. Fix various checkpatch warnings. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix line continuationsTobin C. Harding2017-03-141-10/+7
| | | | | | | | | | | | | | | Checkpatch emits CHECK: Logical continuations should be on the previous line. Also the same code section causes checkpatch to emit WARNING: Avoid multiple line dereference. Move logical line continuations onto the previous line. Move multiple line dereferences onto single line. Make these two changes in a single patch to give review a chance to critique the final layout of the *complex* logical statement. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: reduce level of indentationTobin C. Harding2017-03-141-67/+69
| | | | | | | | | | Code is deeply nested. One level of indentation may be removed by inverting if statement conditional. Invert conditional, return if new conditional evaluates to true. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: move WPA code to separate functionTobin C. Harding2017-03-141-79/+97
| | | | | | | | | | | | | | | | | | | | Checkpatch emits WARNING: Too many leading tabs - consider code refactoring. Function contains 5 levels of nesting and 14 local variables. Code can be simplified and nesting reduced by refactoring into separate functions. WPA code is contained and may be factored out into a separate function. This will reduce the length and complexity of hostif_data_indication(). At times within the WPA code errors result in the function returning. In order to maintain this behaviour new function should return a status integer. Factor out WPA code into separate function. Add only code needed to get compilation to pass, including modifying return statements. Make no other code changes, program logic is unchanged. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: ks7010: ks_hostif.*: Use preferred 'u32' kernel type over 'uint32_t'Shiva Kerdel2017-03-121-9/+9
| | | | | | | Fix prefer kernel type 'u32' over 'uint32_t' checks. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: ks7010: ks_hostif.*: Use preferred 'u16' kernel type over 'uint16_t'Shiva Kerdel2017-03-121-10/+10
| | | | | | | Fix prefer kernel type 'u16' over 'uint16_t' checks. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: ks7010: ks_*: Use preferred 'u8' kernel type over 'uint8_t'Shiva Kerdel2017-03-121-2/+2
| | | | | | | Fix prefer kernel type 'u8' over 'uint8_t' checks. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix checkpatch CONSTANT_COMPARISONTobin C. Harding2017-03-091-2/+2
| | | | | | | | | | Checkpatch emits WARNING: Comparisons should place the constant on the right side of the test. Move comparison constant to the right side of the test. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix checkpatch whitespace warningsTobin C. Harding2017-03-091-2/+0
| | | | | | | | | | | | | | | | | Checkpatch emits various warnings/errors pointing to misplaced spaces. - trailing whitespace - please, no spaces at the start of a line - please, no space before tabs - Unnecessary space before function pointer arguments - unnecessary whitespace before a quoted newline - code indent should use tabs where possible Remove all undesirable whitespace. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud