Chaehyun Lim [Mon, 5 Oct 2015 02:07:22 +0000 (11:07 +0900)]
staging: wilc1000: return error code directly in host_int_set_mac_chnl_num
There is no need to pass the error code to the variable 'result'.
Just return the error directly when error occurs.
Return 0 at the end of this function when error is not happened.
Chaehyun Lim [Mon, 5 Oct 2015 02:07:21 +0000 (11:07 +0900)]
staging: wilc1000: remove pstrWFIDrv in host_int_set_mac_chnl_num
This patch removes pstrWFIDrv variable in host_int_set_mac_chnl_num
function. There is no need to make another variable to check if first
arugment is NULL or not.
It is able to use wfi_drv directly that is first argument of
this function.
struct timespec will overflow in year 2038, so replace it with
ktime_t. And replace functions that use struct timespec,
timespec_sub with ktime_sub. Also use monotonic time instead of real
time, by replacing getnstimeofday with ktime_get, to be more robust
against leap seconds and settimeofday() calls.
Remove NULL comparison by using '!' operator. Problem found using
checkpatch.pl
CHECK: Comparison to NULL could be written "!padapter->halpriv.hal_bus_init"
staging: rtl8712: Move constant to right of test or replace with "!"
Move constant to the right side of comparison operator or replace
equality operator (==) with the unary negation operator (!) if the
comparison is to zero.
Addesses multiple instances of the checkpatch.pl warning:
WARNING: Comparisons should place the constant on the right side of the
test
Shraddha Barke [Wed, 7 Oct 2015 20:06:07 +0000 (01:36 +0530)]
Staging: lustre: ptlrpc: service: Declare local functions as static
Declare ptlrpc_server_drop_request and ptlrpc_stop_all_threads
as static since they are used only in this particular file.Also
remove the corresponding declaration from header files.
Shraddha Barke [Wed, 7 Oct 2015 20:06:05 +0000 (01:36 +0530)]
Staging: lustre: ptlrpc: pack_generic: Declare local functions as static
Declare lustre_swab_ldlm_resource_desc, lustre_swab_obdo,
lustre_swab_ldlm_res_id, lustre_swab_ldlm_policy_data as static since
they are used only in this particular file. Also remove the corresponding
declarations from header file.
Shraddha Barke [Wed, 7 Oct 2015 20:06:04 +0000 (01:36 +0530)]
Staging: lustre: obdclass: llog_cat: Declare local functions as static
Declare llog_cat_id2handle and llog_cat_process_or_fork as static
since they are used only in this particular file. Also remove the
corresponding declarations from header files.
Shraddha Barke [Mon, 5 Oct 2015 00:02:39 +0000 (05:32 +0530)]
Staging: lustre: ptlrcpc: sec: Declare local functions as static
Declare functions sptlrpc_secflags2str, sptlrpc_sec_get and
sptlrpc_svc_install_rvs_ctx as static since they are used only
in this particular file. Also remove them from corresponding
header files.
Shraddha Barke [Mon, 5 Oct 2015 00:02:38 +0000 (05:32 +0530)]
Staging: lustre: ptlrpc: pack_generic: Declare local functions as static
Declare functions lustre_swab_ldlm_lock_desc and dump_obdo as static since
they are used only in this particular file. Also remove them from
corresponding header files.
Shraddha Barke [Mon, 5 Oct 2015 00:02:36 +0000 (05:32 +0530)]
Staging: lustre: obdclass: llog_swab: Declare local functions as static
Declare functions lustre_swab_llog_id and lustre_swab_ll_fid as static
since they are used only in this particular file. Also remove them from
corresponding header files.
drivers/vme/bridges/vme_tsi148.c: In function 'tsi148_master_write':
drivers/vme/bridges/vme_tsi148.c:1358:31: warning: 'handler' may be used uninitialized in this function [-Wmaybe-uninitialized]
vme_unregister_error_handler(handler);
^
drivers/vme/bridges/vme_tsi148.c: In function 'tsi148_master_read':
drivers/vme/bridges/vme_tsi148.c:1260:31: warning: 'handler' may be used uninitialized in this function [-Wmaybe-uninitialized]
vme_unregister_error_handler(handler);
^
The current VME bus error handler adds errors to the bridge error list.
vme_master_{read,write} then traverses that list to look for relevant
errors.
Such scheme didn't work well for accesses going through vme_master_mmap
because they would also allocate a vme_bus_error, but have no way to do
vme_clear_errors call to free that memory.
This changes the error handling process to be other way around: now
vme_master_{read,write} defines a window in VME address space that will
catch possible errors. VME bus error interrupt only traverses these
windows and marks those that had errors in them.
vme: move tsi148 error handling into VME subsystem
Error handling code found in tsi148 is not device specific. In fact it
already relies on shared vme_bus_error struct and vme_bridge.vme_errors
field. The other bridge driver could reuse this code if it is shared.
This introduces a slight behavior change: vme error message won't be
triggered in a rare case when err_chk=1 and kmalloc fails.
vme: lower alignment requirement in pci bridge drivers
Universe II allows PCI address grannularity of 4K or 64K depending on
the window id. tsi148 only supports 64K. Existing driver implementations
are validating window size against this grannularity and then use that
very size as alignment parameter to pci_bus_alloc_resource. This
constraint is excessive, alignment by granularity should be enough.
This changes alignment constraint from size to a fixed constraint of
64K.
android, lmk: Send SIGKILL before setting TIF_MEMDIE.
It was observed that setting TIF_MEMDIE before sending SIGKILL at
oom_kill_process() allows memory reserves to be depleted by allocations
which are not needed for terminating the OOM victim.
This patch reverts commit 6bc2b856bb7c ("staging: android: lowmemorykiller:
set TIF_MEMDIE before send kill sig"), for oom_kill_process() was updated
to send SIGKILL before setting TIF_MEMDIE.
Shraddha Barke [Sun, 4 Oct 2015 07:30:16 +0000 (13:00 +0530)]
Staging: lustre: obdclass: obd_mount: Declare as static
Declare lustre_fs_type, do_lcfg, lustre_fill_super, lustre_put_lsi,
lustre_init_lsi, lustre_start_simple, server_name2index and
server_name2fsname as static since they are used only in this
particular file.Also remove corresponding declarations from header
files.
Shraddha Barke [Sun, 4 Oct 2015 07:30:14 +0000 (13:00 +0530)]
Staging: lustre: obdclass: genops: Declare as static
Declare obd_export_nid2str and obd_zombie_impexp_cull as static
since they are used only in this particular file. Also remove the
corresponding declarations from header file
Shraddha Barke [Sun, 4 Oct 2015 07:30:12 +0000 (13:00 +0530)]
Staging: lustre: ptlrpc: layout: Declare as static
Declare req_capsule_init_area and req_capsule_field_present as static
since they are used only in this particular file. Also remove the
corresponding declarations from header files.
Itai Katz [Sun, 4 Oct 2015 07:09:52 +0000 (10:09 +0300)]
staging: fsl-mc: add function to return pointer to root dprc
To support multiple root dprcs, instead of relying on the
dev_root field of the bus type struct, instead create a
function to traverse to the root dprc and return a pointer
to the device struct
Tim Sell [Fri, 2 Oct 2015 17:19:19 +0000 (13:19 -0400)]
staging: unisys: visorinput: make structs & arrays const where possible
This also gave me a warning with the assignment:
visorinput_dev->keycode = visorkbd_keycode;
because input_dev->keycode is NOT static but visorkbd_keycode now is, so
I went ahead and also added logic to stash away non-static copies of
visorkbd_keycode[] and visorkbd_ext_keycode[] within visorinput_devdata,
and use the copy to assign to visorinput_dev->keycode. This change is
also technically required, because user-space can remap keys, and we
don't want this to be shared with the other keyboard devices running on
the same system.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tim Sell [Fri, 2 Oct 2015 17:19:17 +0000 (13:19 -0400)]
staging: unisys: visorinput: re-order declarations for consistency
In order to be more consistent with kernel conventions used elsewhere,
I have re-ordered declarations in visorinput.c to follow this general
order (where possible):
* #defines
* struct/enum/union declarations
* static declarations (const if possible for all of them)
* forward function declarations where absolutely necessary
Exceptions were made for the static declarations like the driver
declaration, given that it depends on previously-defined callbacks.
So such declarations are at the end of visorinput.c.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tim Sell [Fri, 2 Oct 2015 17:19:15 +0000 (13:19 -0400)]
staging: unisys: visorhid: rename to visorinput
This visorhid driver provides a Human Interface Device, but is not at all
using HID, the protocol. It's a plain input driver, so for clarity, it is
being renamed to visorinput.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chaehyun Lim [Fri, 2 Oct 2015 12:44:53 +0000 (21:44 +0900)]
staging: wilc1000: fix return type of host_int_wait_msg_queue_idle
This patch changes return type of host_int_wait_msg_queue_idle from s32
to int. s32Error gets return value from wilc_mq_send that has return
type of int. It should be changed return type of
host_int_wait_msg_queue_idle by int as well as data type of s32Error.
Chaehyun Lim [Fri, 2 Oct 2015 12:44:47 +0000 (21:44 +0900)]
staging: wilc1000: fix return type of host_int_set_mac_chnl_num
This patch changes return type of host_int_set_mac_chnl_num from s32 to
int. s32Error gets return value from wilc_mq_send function that
has return type of int. It should be changed return type of
host_int_set_mac_chnl_num function by int as well as data type of
s32Error.
Shraddha Barke [Sat, 3 Oct 2015 12:01:30 +0000 (17:31 +0530)]
Staging: most: Use module_platform_driver
Use module_platform_driver for drivers whose init and exit functions
only register and unregister, respectively. Thus remove some
boilerplate code.
A simplified version of Coccinelle patch -
@a@
identifier f, x;
@@
-static f(...) { return platform_driver_register(&x); }
@b depends on a@
identifier e, a.x;
@@
-static e(...) { platform_driver_unregister(&x); }
@c depends on a && b@
identifier a.f;
declarer name module_init;
@@
-module_init(f);
@d depends on a && b && c@
identifier b.e, a.x;
declarer name module_exit;
declarer name module_platform_driver;
@@
-module_exit(e);
+module_platform_driver(x);
Staging: comedi: Use mutex instead of semaphore in ni_usb6501.c
Replace binary semaphore with mutex because mutex gives better
performance.
This change is safe because the thread that decrements the value of semaphore
is also the one that increments it, and acts like a mutex where owner of the
lock is the only one that can release the lock.
Staging: comedi: Use mutex instead of semaphore in usbduxfast.c
Replace binary semaphore with mutex because mutex gives better
performance.
This change is safe because the thread that decrements the value of semaphore
is also the one that increments it, and acts like a mutex where owner of the
lock is the only one that can release the lock.
Staging: comedi: Use mutex instead of semaphore in usbdux.c
Replace binary semaphore with mutex because mutex gives better
performance.
This change is safe because the thread that decrements the value of semaphore
is also the one that increments it, and acts like a mutex where owner of the
lock is the only one that can release the lock.