Varsha Rao [Sat, 25 Feb 2017 09:55:26 +0000 (15:25 +0530)]
staging: rtl8712: Removes the FSF mailing address.
This patch fixes the checkpatch issue by removing the Free Software
Foundation's mailing address from the sample GPL notice. Because the FSF
has changed address in the past, and may change again. Linux already
includes a copy of the GPL.
Fix checkpatch.pl warning of the form "WARNING: Prefer
subsystem eg: netdev]_info([subsystem]dev, ...
then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ..."
Signed-off-by: Nathan Howard <adanhawthorn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Fri, 17 Feb 2017 23:20:15 +0000 (02:20 +0300)]
staging: bcm2835-camera: fix error handling in init
The unwinding here isn't right. We don't free gdev[0] and instead
free 1 step past what was allocated. Also we can't allocate "dev" then
we should unwind instead of returning directly.
Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: walter harms <wharms@bfs.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gargi Sharma [Sun, 19 Feb 2017 19:14:18 +0000 (00:44 +0530)]
staging: media: Remove ternary operator
Relational and logical operators evaluate to either true or false.
Explicit conversion is not needed so remove the ternary operator.
Done using coccinelle:
@r@
expression A,B;
symbol true,false;
binary operator b = {==,!=,&&,||,>=,<=,>,<};
@@
- (A b B) ? true : false
+ A b B
simran singhal [Tue, 21 Feb 2017 18:51:03 +0000 (00:21 +0530)]
staging: vc04_services: Using macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)).
It clarifies the divisor calculations. This occurence was detected using
the coccinelle script:
simran singhal [Wed, 22 Feb 2017 09:10:15 +0000 (14:40 +0530)]
staging: most: Using macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)).
It clarifies the divisor calculations. This occurence was detected using
the coccinelle script:
sayli karnik [Mon, 20 Feb 2017 17:10:28 +0000 (22:40 +0530)]
staging: greybus: loopback_test: Fix open error path
Change array index from the loop bound variable to loop index.
If a poll file fails to open for any intermediate device, all poll files with
fds of devices from 0 upto that device must be closed in the open_poll_files()
function. The current code only closes the poll file with the most recent fd
allocated, and at times tries to close the same file multiple times.
All the device names were being always leaked. Also,
illegal free was being called upon namelist[n] which
was coincidentally NULL. The pointer to dirent structures
must be individually freed before freeing the pointer array.
Sebastian Haas [Mon, 20 Feb 2017 23:31:47 +0000 (00:31 +0100)]
staging: rtl8192u: Fix endianness warnings in ieee80211_rx.c
Fixes the endianness warning "restricted __le16 degrades to integer" by
converting __le16 to short before using it in bitmasks or in the
macro WLAN_FC_GET_STYPE.
Signed-off-by: Sebastian Haas <sehaas@deebas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
maomao xu [Fri, 17 Feb 2017 12:04:02 +0000 (20:04 +0800)]
staging: rtl8192u: Fix warnings about endianness
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:564:37: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:564:37: expected unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:564:37: got restricted __be16 [usertype] <noident>
sayli karnik [Fri, 17 Feb 2017 10:13:07 +0000 (15:43 +0530)]
staging: rtl8192u: ieee80211: Remove typedef to the tx_pending_t structure
Using typedef for a structure type is not suggested in Linux kernel coding
style guidelines. So remove typedef from structure tx_pending_t.
The typedef name is not used anywhere. All variables of this type are declared
using "struct tx_pending_t".
Also change the structure name to tx_pending since it is normally only
typedefs that have names that end in _t.
simran singhal [Thu, 16 Feb 2017 20:36:56 +0000 (02:06 +0530)]
staging: rtl8192u: Replace symbolic permissions with octal permissions
Octal permissions should be used instead of symbolic ones for easier
reading.
WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred.
Consider using octal permissions '0644'.
This warning is detected by checkpatch.pl
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value.
Replace the function call with RF_1T1R value
and refactor rtw_get_cur_max_rate().
Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value.
Replace the function call with RF_1T1R value
and refactor rtw_check_beacon_data().
Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
simran singhal [Wed, 22 Feb 2017 09:32:04 +0000 (15:02 +0530)]
staging: lustre: Using macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)).
It clarifies the divisor calculations. This occurence was detected using
the coccinelle script:
James Simmons [Sat, 18 Feb 2017 21:47:15 +0000 (16:47 -0500)]
staging: lustre: lprocfs: move lprocfs_stats_[un]lock to a source file
When compiling the kernel without optimization, when using GCOV,
the lprocfs_stats_alloc_one() symbol is not properly exported to
other modules and causes the ptlrpc module to fail loading with
an unknown symbol. There is no reason to export the function
lprocfs_stats_alloc_one. The reason is due to the functions
lprocfs_stats_[un]lock being inline functions in a header file.
Lets untangle this mess and turn those inline functions
into real functions in a source file.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8836
Reviewed-on: https://review.whamcloud.com/23773 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Niu Yawei [Sat, 18 Feb 2017 21:47:12 +0000 (16:47 -0500)]
staging: lustre: ldlm: fix race of starting bl threads
There is race in the code of starting bl threads which leads to
thread number exceeds the maximum number when race happened, it
can also lead to duplicated thread name. This patch fixes the
race and cleanup the code a bit.
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7330
Reviewed-on: http://review.whamcloud.com/17026 Reviewed-by: Bobi Jam <bobijam@hotmail.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vitaly Fertman [Sat, 18 Feb 2017 21:47:11 +0000 (16:47 -0500)]
staging: lustre: ldlm: disconnect speedup
disconnect takes too long time if there are many locks to cancel.
besides the amount of time spent on each lock cancel, there is a
resched() in cfs_hash_for_each_relax(), i.e. disconnect or eviction
may take unexpectedly long time. While this patch only contains
the client side fixes the original fix covered changes to both
the server and client code to ensure proper disconnect handling.
Below details the change done on both the server and client so
people can examine the disconnect behavior with both source bases.
- do not cancel locks on disconnect_export;
- export will be left in obd_unlinked_exports list pinned by live
locks;
- new re-connects will created other non-conflicting exports;
- new locks will cancel obsolete locks on conflicts;
- once all the locks on the disconnected export will be cancelled,
the export will be destroyed on the last ref put;
- do not cancel in small portions, cancel all together in just 1
dedicated thread - use server side blocking thread for that;
- cancel blocked locks first so that waiting locks could proceed;
- take care about blocked waiting locks, so that they would get
cancelled quickly too;
- do not remove lock from waiting list on AST error before moving
it to elt_expired_locks list, because it removes it from export
list too; otherwise this blocked lock will not be cancelled
immediately on failed export;
- cancel lock instead of just destroy for failed export, to make
full cleanup, i.e. remove it from export list.
The ll_close_inode_openhandle() and ll_md_close() functions passed an
extra "obd_export *md_exp" parameter, but it turns out that all of the
callers already pass inode->i_sb->s_fs_info->lsi_llsbi->ll_md_exp in
one form or another, so it can just be extracted from "inode" directly
as needed.
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6627
Reviewed-on: http://review.whamcloud.com/14953 Reviewed-by: Frank Zago <fzago@cray.com> Reviewed-by: Bobi Jam <bobijam@hotmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
A ldlm lock could be canceled simutaneously by ldlm bl thread and
cleanup_resource(). In this case, only one side will win the race
and the other side should wait for the work to complete. Eviction
on group lock is now well supported.
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6271
Reviewed-on: http://review.whamcloud.com/16456 Reviewed-by: Bobi Jam <bobijam@hotmail.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jinshan Xiong [Sat, 18 Feb 2017 21:47:04 +0000 (16:47 -0500)]
staging: lustre: osc: remove obsolete asserts
Remove the no longer needed assert in the function
osc_cache_truncate_start(). The assertion in
osc_object_prune() will become faulty with upcoming
changes. The reason this will become a problem is
that there may exist freeing pages in object's
radix tree at the time of osc_object_prune(), which
causes failure at the assertion of (osc->oo_npages == 0).
This patch prevents that problem from happening.
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6271
Reviewed-on: http://review.whamcloud.com/16456
Reviewed-on: http://review.whamcloud.com/16727 Reviewed-by: Bobi Jam <bobijam@hotmail.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bobi Jam [Sat, 18 Feb 2017 21:47:02 +0000 (16:47 -0500)]
staging: lustre: llite: lower message level for ll_setattr_raw()
Truncate and write can happen at the same time, so that a file can
be set modified even though the file is not restored from released
state, and ll_hsm_state_set() is not applicable for the file, and
it will return error in this case, we'd lower the error message level
in this case.
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6817
Reviewed-on: http://review.whamcloud.com/15541 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Doug Oucharek [Sat, 18 Feb 2017 18:04:10 +0000 (10:04 -0800)]
staging: lustre: ko2iblnd: Adapt to the removal of ib_get_dma_mr()
In Linux kernel 4.9-rc1, the function ib_get_dma_mr()
was removed and a second parameter was added to ib_alloc_pd().
As this broke the building of the ko2iblnd module in
staging, the Kconfig for LNet has marked ko2iblnd as broken
and stopped building it.
This patch fixes this breakage by:
- Removing the BROKEN tag from lnet/Kconfig.
- Make it so the module parameter map_on_demand can no longer be
zero (we have to configure FMR/FastReg pools; it can no longer be
off).
- No longer try to use the global DMA memory region, but make use
of the FMR/FastReg pool for all RDMA Tx operations.
- Everywhere we are using the device DMA mr to derive the
L-key for non-registered memory regions, use the
pd->local_dma_lkey value instead.
- Make the default map_on_demand = 256. This will allow nodes with
this patch to still connected to older nodes without this patch
and FMR/FastReg turned off. When FMR/FastReg is turned off, we
use 256 as the max frags so the two sides will still be able to
communicate and work.
- Fix a mistake with BUILD_BUG_ON calls in o2iblnd.c which caused
compiling to fail.
Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9026
Reviewed-on: https://review.whamcloud.com/#/c/24931/ Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Anthony Brandon [Tue, 21 Feb 2017 13:25:28 +0000 (14:25 +0100)]
staging:fbtft: Fix some warnings regarding types.
Running make C=1 M=drivers/staging/fbtft reports warnings about conversion
from __be16 to unsigned short. Change the type of the variables being
assigned into __be16 to remove those warnings.
Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tobin C. Harding [Wed, 15 Feb 2017 03:27:25 +0000 (14:27 +1100)]
staging: fbtft: Add check on strlcpy() return value
Return value of strlcpy() is not checked. Name string is silently
truncated if longer that SPI_NAME_SIZE, whilst not detrimental to
the program logic it would be nice to notify the user. Module is
currently quite verbose, adding extra pr_warn() calls will not overly
impact this verbosity.
Check return value from call to strlcpy(). If source string is
truncated call pr_warn() to notify user.
Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tobin C. Harding [Wed, 15 Feb 2017 03:27:24 +0000 (14:27 +1100)]
staging: fbtft: Replace magic number with constant
Current call to strncmp() uses a magic number. There is a compile
time constant defined for this buffer, included and used already at
other sites in the file.
Remove magic number. Replace with pre-existing compile time constant.
Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>