- 28 4月, 2017 40 次提交
-
-
由 Chewie Lin 提交于
Removed the usb_device_reset(), replace with call to usb_reset_device() directly. Plus it removes the confusing function name and addressed the checkpatch warning. This change also swaps string in the dev_warn() call with __func__ argument to "vt6656_probe" instead of literal string "usb_reset_device". WARNING: Prefer using "%s", __func__ to embedded function names #417: FILE: main_usb.c:417: + "usb_device_reset fail status=%d\n", status); total: 0 errors, 1 warnings, 1058 lines checked And after fix: main_usb.c has no obvious style problems and is ready for submission. Signed-off-by: NChewie Lin <linsh@oregonstate.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Pan Bian 提交于
Function dev_alloc_skb() will return a NULL pointer if there is no enough memory. However, in function WILC_WFI_mon_xmit(), its return value is used without validation. This may result in a bad memory access bug. This patch fixes the bug. Signed-off-by: NPan Bian <bianpan2016@163.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Sameer Wadgaonkar 提交于
The root issue is that we are not allowed to have items on the stack being passed to "DMA" like operations. In this case we have a vmcall and an inline completion of scsi command. This patch fixes the issue by moving the variables on stack in do_scsi_nolinuxstat() to heap memory. Signed-off-by: NSameer Wadgaonkar <sameer.wadgaonkar@unisys.com> Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Sameer Wadgaonkar 提交于
The root issue is that we are not allowed to have items on the stack being passed to "DMA" like operations. In this case we have vmcall operation that was using parameters from the stack. This patch fixes the issue by moving the variables on stack in issue_vmcall_io_controlvm_addr() to vmcall_controlvm_addr struct. Signed-off-by: NSameer Wadgaonkar <sameer.wadgaonkar@unisys.com> Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Remove POSTCODEs from visorchipset_init and replace them with dev_err when needed. Since there are no more POSTCODEs in the code, we can get rid of the data in the header file as well. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Replace postcodes with dev_err in the function setup_crash_device_work_queue. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
The if statement was sending us down the happy path with the error path in the else. This can be simplified by having the if be the error and just falling through with the good path. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Replace POSTCODEs with dev_err in the function my_device_changestate. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Replace the POSTCODEs with dev_err in my_device_create. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Remove the POSTCODE logging from bus_configure, replace it with an error message if we fail dumping the errno. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Removed the POSTCODEs from the function bus_create. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Replace POSTCODES in save_crash_msg with dev_err handling. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Remove the POSTCODES in visorbus_init. Since there are no more POSTCODES in visorbus_main.c we can remove the reference to the vmcallinterface header file. No need for vmcallinterface in visorbus_main.c Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
The postcodes in visorchipset_exit were not displaying errors, they can just be removed. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Since kzalloc will display error the postcode becomes redundant, it can be removed. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Get rid of postcodes from visorbus_main.c that are just informational. They were not logging errors, we don't need to replace them with anything. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Remove postcodes from create_bus_instance. If there is an error log it with dev_err. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Get rid of the postcodes from the function chipset_init. They were being noisy, so don't replace them with errors. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Remove POSTCODES from create_visor_device, when we fail log an error with dev_err. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Allow retry when allocating memory. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Catch and report back errors when visorchannel_write fails. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Limit the amount that gets pulled from the queue on each try so we don't get stuck in an infinite loop if something has gone wrong with the s-Par firmware. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Comment was outdated and did not reflect what was actually happening. Update the comment to reflect reality. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Moved the brace to the left to fix the indentation issue. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Shouldn't use uint32 in the kernel, it can be replaced with int here. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
Functions in c files don't need to be inlined, get rid of the keyword. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 David Kershner 提交于
There are several different controlvm response functions, consolidate them to one so we can simplify error handling. Signed-off-by: NDavid Kershner <david.kershner@unisys.com> Reviewed-by: NTim Sell <timothy.sell@unisys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
Driver header declares enumeration types without tags. Using informative tags makes the code easier to understand and eliminates the need to comment the enum. Add tags to enumeration types. Signed-off-by: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
Driver uses preprocessor directives to define multicast filter constants. These can be defined using an enumeration type. Doing so adds to the readability and gives the assists the compiler. Add enumeration type multicast_filter_type to replace preprocessor defined constants. Signed-off-by: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
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: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
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: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
The returned pointer from netdev_priv() (void *) does not need to be cast. Remove unnecessary cast of void * returned by netdev_priv(). Signed-off-by: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
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: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
Checkpatch emits CHECK: Please don't use multiple blank lines. Remove multiple blank lines. Signed-off-by: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
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: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
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: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
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: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
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: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
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: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tobin C. Harding 提交于
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: NTobin C. Harding <me@tobin.cc> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-