Commit graph

45868 commits

Author SHA1 Message Date
Jess Frazelle 76b94eb1eb staging: set msi_domain_ops as __ro_after_init
Marked msi_domain_ops structs as __ro_after_init when called only during init.
This protects the data structure from accidental corruption.

Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jess Frazelle <me@jessfraz.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:15 +01:00
Shiva Kerdel fac103e0ab Staging: ks7010: ks_*: Removed blank lines before and after braces.
Removing unnecessary blank lines around braces to solve CHECKS.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:15 +01:00
Youngdo, Lee 8a0e4b9e46 staging: android: ion: fix coding style issue
Replaced sizeof(struct foo) into sizeof(*ptr), found by checkpatch.pl.

Signed-off-by: Youngdo, Lee <oss.ydlee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:14 +01:00
Gioh Kim 563a8412c5 staging: greybus: fix symbolic permission coding style issues
Fix "Octal permissions are preffered than symbolic ones" issues.

Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:14 +01:00
Gioh Kim 461ab8077d staging: greybus: fix "line over 80 characters" coding style issues
This patch fixes only obvious lines.
There are still more issues.

Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:14 +01:00
Nathan Howard 59d409014a staging: greybus: arpc.h: remove duplicate line.
Fix checkpatch.pl issue of the form:
"CHECK: Please don't use multiple blank lines".

Signed-off-by: Nathan Howard <adanhawthorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:14 +01:00
Nathan Howard b3fc909ad1 staging: dgnc: dgnc_tty.c: fix argument list alignment issue.
Fix checkpatch.pl issue of the form:
"CHECK: Alignment should match open parenthesis".

Signed-off-by: Nathan Howard <adanhawthorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:14 +01:00
Derek Robson e6b240bd3b Staging: sm750fb: sm750.c - style fix
Change permissions to octal style.
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:22:08 +01:00
Alexander Alemayhu 606ea2bd81 staging: wlan-ng: reduce type warnings
Fixes the following sparse output:

drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16
drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16
drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16
drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16
drivers/staging/wlan-ng/p80211conv.c:154:38: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/p80211conv.c:154:38:    expected unsigned short [unsigned] [usertype] type
drivers/staging/wlan-ng/p80211conv.c:154:38:    got restricted __be16 [usertype] <noident>
drivers/staging/wlan-ng/p80211conv.c:390:42: warning: cast to restricted __le16
drivers/staging/wlan-ng/p80211conv.c:413:29: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/p80211conv.c:413:29:    expected unsigned short [unsigned] [usertype] type
drivers/staging/wlan-ng/p80211conv.c:413:29:    got restricted __be16 [usertype] <noident>
drivers/staging/wlan-ng/p80211conv.c:481:29: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/p80211conv.c:481:29:    expected unsigned short [unsigned] [usertype] type
drivers/staging/wlan-ng/p80211conv.c:481:29:    got restricted __be16 [usertype] <noident>

Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:22:08 +01:00
Jacob Zachariah aefc958960 staging:wilc1000: Fix line over 80 characters
Fix a checkpatch.pl WARNING: line over 80 characters

Signed-off-by: Jacob Zachariah <jacob_z@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:22:08 +01:00
Saber Rezvani bc9e43ad50 staging: comedi: dmm32at: usleep_range is preferred over udelay
Fix the checkpatch.pl issue:
CHECK: usleep_range is preferred over udelay

Signed-off-by: Saber Rezvani <irsaber@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:22:08 +01:00
Saber Rezvani 4f280a69e9 staging: comedi: dt2801: usleep_range is preferred over udelay
Fix the checkpatch.pl issue:
CHECK: usleep_range is preferred over udelay

Signed-off-by: Saber Rezvani <irsaber@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:22:08 +01:00
Saber Rezvani 9fbe9b06e7 staging: comedi: dt2814: usleep_range is preferred over udelay
Fix the checkpatch.pl issue:
CHECK: usleep_range is preferred over udelay

Signed-off-by: Saber Rezvani <irsaber@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:22:08 +01:00
Saber Rezvani 1b2d7f1981 staging: comedi: dt2815: usleep_range is preferred over udelay
Fix the checkpatch.pl issue:
CHECK: usleep_range is preferred over udelay

Signed-off-by: Saber Rezvani <irsaber@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:22:08 +01:00
Saber Rezvani 8bd05c98b2 staging: comedi: ni_at_a2150: usleep_range is preferred over udelay
Fix the checkpatch.pl issue:
CHECK: usleep_range is preferred over udelay

Signed-off-by: Saber Rezvani <irsaber@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:22:08 +01:00
AbdAllah-MEZITI d54b1bdaa3 staging: bcm2835-audio: fix trailing statements
Trailing statements should be on next line.

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti.pro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:22:08 +01:00
William Blough cdefc236ef staging: lustre: lnet: fix type warning in lib-socket.c
The local socket address is defined as a __be32 value.  However, if the
local ip address is not given, then the constant INADDR_ANY is used.

This patch converts INADDR_ANY to __be32 for type consistency.

Fixes the following sparse warnings:

drivers/staging/lustre/lnet/lnet/lib-socket.c:396:41: warning:
 incorrect type in assignment (different base types)
drivers/staging/lustre/lnet/lnet/lib-socket.c:397:56: warning:
 restricted __be32 degrades to integer

Signed-off-by: William Blough <devel@blough.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:13:06 +01:00
Niu Yawei de51919c9a staging: lustre: llite: check reply status in ll_migrate()
ll_migrate() should check reply status before trying to read
reply buffer, checking if request is NULL doesn't make sense.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8807
Reviewed-on: https://review.whamcloud.com/23666
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@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>
2017-02-12 13:13:06 +01:00
wang di aa2f4a3f20 staging: lustre: llite: root inode checking for migration
Do not migrate root inode.

Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7577
Reviewed-on: http://review.whamcloud.com/17669
Reviewed-by: Lai Siyao <lai.siyao@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>
2017-02-12 13:13:06 +01:00
wang di 7b0a17f5f6 staging: lustre: llite: check request != NULL in ll_migrate
Check if the request is NULL, before retrieve reply body
from the request.

Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7396
Reviewed-on: http://review.whamcloud.com/17079
Reviewed-by: John L. Hammond <john.hammond@intel.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>
2017-02-12 13:13:06 +01:00
David S. Miller 35eeacf182 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-02-11 02:31:11 -05:00
Simon Sandström 9d3352a3fe staging: bcm2835-audio: Make internal symbols static
Fixes sparse warnings:
warning: symbol 'xxx' was not declared. Should it be static?

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 15:06:45 +01:00
Abhijit Naik 626eea7df9 staging: bcm2835-audio: Fixed initialization of global to "false"
bcm2835-vchiq.c:
fixing ERROR: do not initialise globals to false

Instead of explicitly initializing global variable force_bulk to "false",
declared force_bulk as static variable.

Signed-off-by: Abhijit Naik <abhijitnaik27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 15:06:44 +01:00
Frans Klaver 55dd5a39a9 staging: wlan_ng: fix logical continuation alignment
It appears that our coding style prefers that logical continuations
have the operator at the end of the line. Fix that.

While at it, stick the 'if' after 'else' where it belongs.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 15:06:44 +01:00
Arushi Singhal 29fcf85bc1 staging:vt6656:baseband.h: fix function definition argument without identifier name issue
Function definitions arguments should also have an identifier name as
reported by checkpatch.pl.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 15:06:44 +01:00
simran singhal 360daa8284 staging: rtl8192u: Adding a blank line after declarations
This patch fixes the checkpatch warning by adding a blank line after
declarations.
WARNING: Missing a blank line after declarations

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 15:06:44 +01:00
Colin Ian King 1393f1bc11 Staging: rtl8192e: remove redundant null check on array alg
u.crypt.alg is an array of u8 integers and hence the null check on
this array is redundant and can be removed.

Detected with CoverityScan, CID#146583 ("Array compared against 0")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 15:06:44 +01:00
Laurentiu Tudor db17c640e7 staging: fsl-mc: dprc: drop unused APIs
Leave only APIs that area actually used in the bus driver.
The patch is mostly mechanical, with a couple exceptions:
 - getters/setters were not removed even if only one of
   them is being used
 - versioning API was also left in place
They will be added back on an as-needed basis.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:26:02 +01:00
Laurentiu Tudor 5e62af8835 staging: fsl-mc: dpbp: add a few missing EXPORT_SYMBOL()s
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:26:02 +01:00
Laurentiu Tudor 7337013473 staging: fsl-mc: dpbp: drop unused APIs
Leave only APIs that will be used in upcomming drivers.
The patch is mostly mechanical, with a couple exceptions:
 - getters/setters were not removed even if only one of
   them is being used
 - versioning API was also left in place
They will be added back on an as-needed basis.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:26:02 +01:00
Laurentiu Tudor 58acb3875b staging: fsl-mc: dpmng: drop unused prototype
The implementation was removed in commit:

decd3d0cf (staging: fsl-mc: uprev binary interface to match MC v10.x)

but the prototype was left behind.

Also fix a message that was wrongly mentioning it.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:26:01 +01:00
Laurentiu Tudor ee9d06064e staging: fsl-mc: dpmcp: drop unused APIs
These APIs are not used yet, so drop the dead code.
The patch is mostly mechanical, with a couple exceptions:
 - getters/setters were not removed even if only one of
   them is being used
 - versioning API was also left in place
Also in this patch, add missing prototype for
version query function.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:26:01 +01:00
Laurentiu Tudor 9b65332e0e staging: fsl-mc: remove slab cache for mc devices
Let's drop the slab cache for objects
until we actually have proof that it improves
performance. This makes the code cleaner.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:26:01 +01:00
Laurentiu Tudor dc341c4ec2 staging: fsl-mc: don't use devres api for refcounted objects
Mixing two memory management systems, in this case
managed device resource api and refcounted objects
is a bad idea. Lifetime of an object is controlled
by its refcount so allocating it with other apis
that have their own lifetime control is not ok.
Drop devm_*() apis in favor of plain allocations.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:26:01 +01:00
Laurentiu Tudor 95b3523b72 staging: fsl-mc: add device release callback
When hot unplugging a mc-bus device the kernel displays
this pertinent message, followed by a stack dump:
    "Device 'foo.N' does not have a release() function,
     it is broken and must be fixed."
Add the required callback to fix and drop the now
uneeded explicit freeing.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:26:01 +01:00
Laurentiu Tudor 95b5daf532 staging: fsl-mc: fix device ref counting
Drop unneeded get_device() call at device creation
and, as per documentation, drop reference count
after using device_find_child() return.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:26:01 +01:00
Laurentiu Tudor 0e724ba37e staging: fsl-mc: drop root dprc counting
It was used just to sanity check some obscure
cases that are unlikely to ever happen.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:26:01 +01:00
Matthieu Simon c075b6f2d3 staging: sm750fb: Replace POKE32 and PEEK32 by inline functions
POKE32 and PEEK32 have been replaced by inlined functions poke32 and
peek32.
Having inline functions instead of macros help to get the correct
type-checking and avoid the possible precedence issues reported by
checkpatch.

Signed-off-by: Matthieu Simon <gmatthsim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:23:13 +01:00
Colin Ian King 0840ff7690 staging: rtl8192u: remove redundant null check on array alg
u.crypt.alg is an array of u8 integers and hence the null check on
this array is redundant and can be removed.

Detected with CoverityScan, CID#143214 ("Array compared against 0")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:23:13 +01:00
Fu Yong Quah 7a976ce11e staging: rtl8192u: Fix indentation
Fix number of indentaions for block scopes as suggested by
Documentation/CodingStyle.

Signed-off-by: Fu Yong Quah <quah.fy95@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:23:13 +01:00
Ivan Safonov df47a14c2c staging:r8188eu: replace recv_frame->rx_(data|len|tail) with pkt->(data|len|tail) and remove unused recvframe_(put|pull|pull_tail)()
recv_frame->rx_(data|len|tail) duplicate pkt (skb) data|len|tail members
and require special functions recvframe_(put|pull|pull_tail)()
instead of skb_(put|pull|trim).
Replace rx_(data|len|tail) with pkt->(data|len|tail),
remove rx_(data|len|tail) and remove recvframe_(put|pull|pull_tail)().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:22:09 +01:00
Ivan Safonov e038e67f08 staging:r8188eu: update pkt->(data|tail|len) synchronously with rx_(data|tail|len) in recv_frame structure
Original driver code uses rx_* members to store skb (pkt) fields
(instead of pkt->* members), pkt->* updated only after data
completely formed, not in process.

Update pkt->* after data buffer changed (with rx_*).

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:22:09 +01:00
Ivan Safonov bdf299c140 staging:r8188eu: remove unused rtw_ieee80211_bar structure definition
rtw_ieee80211_bar structure definition does not used. Remove it.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:22:09 +01:00
Ivan Safonov 35abf582a5 staging:r8188eu: replace rx_end member of recv_frame with pkt->end
rx_end is duplication of pkt->end pointer.
pkt->end is preferred, because it is native skb field
supported by skb_*() functions.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:22:09 +01:00
Carlos Palminha 70cb11622c staging: rtl8712: rtl8712: fixed missing conversion to le32
Fixed missing conversion to le32, detected by sparse
(invalid assignment from int to __le32)

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:21:26 +01:00
Dan Carpenter c3103a3617 Staging: bcm2835-audio: remove unneeded NULL check
We just dereferenced "instance" on the line before so checking it here
is pointless.  Anyway, it can't be NULL here so let's remove the check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:16:45 +01:00
Dan Carpenter 0afad91356 Staging: bcm2835-audio: fix an uninitialized return value
"ret" isn't necessarily initialized on the success path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:16:45 +01:00
Dan Carpenter 84472ecd70 staging: bcm2835-audio: off by one in snd_bcm2835_playback_open_generic()
The > should be >= otherwise we write beyond the end of the array when
we do:

	chip->alsa_stream[idx] = alsa_stream;

Fixes: 23b028c871 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:16:45 +01:00
Victor Vaschenko 1605cda06b Staging: bcm2835-audio: Fixed that open brace should be on previous line error in bcm2835-ctl.c
Fixed ERROR: that open brace { should be on the previous line.
One coding style correction for better readable code.

Signed-off-by: Victor Vaschenko <vicmos89@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:16:09 +01:00
Simon Sandström b715b51e18 staging: bcm2835-audio: Remove unnecessary space after cast
Fixes checkpatch check "No space is necessary after a cast".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström ab601be466 staging: bcm2835-audio: Rewrite comparison to NULL
Fixes checkpatch check "Comparison to NULL could be written '!chip'".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström 2b48e88571 staging: bcm2835-audio: Fix argument indentation
Fixes checkpatch CHECK: "Alignment should match open parenthesis".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström be36cefeca staging: bcm2835-audio: Simplify bcm2835_alsa_device_init()
Fixes checkpatch warning "Missing a blank line after declarations".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström 99f36b1810 staging: bcm2835-audio: Move open brace to correct line
Fixes checkpatch error "open brace { should be on the previous line".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström ab7cfdbb74 staging: bcm2835-audio: Remove whitespace before quoted newline
Fixes checkpatch warning "unnecessary whitespace before a quoted
newline".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström 0042755fed staging: bcm2835-audio: Remove incorrect whitespace
According to the coding style, "bcm2835_ship ** rchip" should be
"bcm2835 **rchip".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström 69c429864e staging: bcm2835-audio: Remove static initialisation
Static pointers are explicility initialised to NULL.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Javier Rodriguez d3ea53c7a4 staging: gdm724x: fix incorrect type in assignment
Fix sparse warning issue.

drivers/staging/gdm724x/gdm_lte.c:201:33: warning: incorrect type in assignment (different base types)
drivers/staging/gdm724x/gdm_lte.c:201:33:    expected unsigned int [unsigned] [addressable] [usertype] ph_len
drivers/staging/gdm724x/gdm_lte.c:201:33:    got restricted __be16 [usertype] payload_len

Signed-off-by: Javier Rodriguez <jrodbar@yahoo.es>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:10:21 +01:00
Dan Carpenter cd47e4d69a staging: gdm724x: fix a couple array overflows
The find_dev_index() function is frustrating.  If you give it an invalid
index then it returns 0.  That was the intent except there is an
off-by-one so it can return MAX_NIC_TYPE which is one higher than we
want.

There is one caller which had a sanity check to catch invalid returns,
but the other two callers assumed that index was valid.

My feeling is that when we are given invalid indexes, that should be
treated like an error and we abandon what we were doing.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:10:20 +01:00
stephen knipe 57e60850e7 staging: most: dim2_hdm octal permissions fix
This patch is to make the permissions sent to module_param be
explicitly octal in accordance with the linux style conventions. Issues
found by checkpatch.pl.

Signed-off-by: stephen knipe <steve.knipe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:10:20 +01:00
Derek Robson fb837d6761 Staging: speakup: speakup.h - remove unused define
As part of cleaning up symbolic permissions found define that is not used.

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:10:20 +01:00
Johan Hovold dbec27298b staging: greybus: operation: add generic timeout support
Add a struct timer_list to struct gb_operation and use that to implement
generic operation timeouts.

This simplifies the synchronous operation handling somewhat while also
providing a generic timeout mechanism that drivers can use for
asynchronous operations.

Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 11:58:56 +01:00
Jan Kara 0911d0041c mm: avoid returning VM_FAULT_RETRY from ->page_mkwrite handlers
Some ->page_mkwrite handlers may return VM_FAULT_RETRY as its return
code (GFS2 or Lustre can definitely do this).  However VM_FAULT_RETRY
from ->page_mkwrite is completely unhandled by the mm code and results
in locking and writeably mapping the page which definitely is not what
the caller wanted.

Fix Lustre and block_page_mkwrite_ret() used by other filesystems
(notably GFS2) to return VM_FAULT_NOPAGE instead which results in
bailing out from the fault code, the CPU then retries the access, and we
fault again effectively doing what the handler wanted.

Link: http://lkml.kernel.org/r/20170203150729.15863-1-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-08 15:41:43 -08:00
David S. Miller 3efa70d78f Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
The conflict was an interaction between a bug fix in the
netvsc driver in 'net' and an optimization of the RX path
in 'net-next'.

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-02-07 16:29:30 -05:00
Umang Raghuvanshi 307a082484 staging: fbtft: fix unaligned parentheses
Fix the following formatting issues:
CHECK: Alignment should match open parenthesis

Signed-off-by: Umang Raghuvanshi <u@umangis.me>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-05 18:31:04 +01:00
Derek Robson cb23ebdfa6 Drivers: staging: speakup: spk_priv.h - style fix
Changed function definition argument to have identifier name.
found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-05 13:05:16 +01:00
Stafford Horne 38955adfeb staging: vchip_shim: Remove unneeded stddef.h include
Building on openrisc musl toolchain this causes the allyesconfig build
to fail.

  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c:42:20:
  fatal error: stddef.h: No such file or directory

Removing this causes no issues with the build.

Signed-off-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-05 11:41:39 +01:00
Simon Sandström 6ddcf34f11 staging: vt6656: Add missing identifier names
Fix all "function definition argument '...' should also have an
identifier name" warnings in vt6656. Use identifier name from each
corresponding C file.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-05 11:41:39 +01:00
Michael Rupprecht 75ce077cc0 Staging: bcm2835-audio: removed spaces around parenthesis
Removed unnecessary spaces around parenthesis as reported by checkpatch.pl

Signed-off-by: Michael Rupprecht <mail.michaelrupprecht@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-05 11:41:39 +01:00
Zhengyi Shen e495fac839 staging:most/hdm-i2c: Replace symbolic permissions with octal permissions
WARNING: Symbolic permissions 'S_IRUGO' are not preferred.
Consider using octal permissions '0444'.
This warning was detected by checkpatch.pl for hdm_i2c.c.

Signed-off-by: Zhengyi Shen <shenzhengyi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-05 11:41:38 +01:00
Kamal Heib 8ad253fc0a staging: octeon: Fix line over 80 characters
This patch fix the line over 80 characters warning that was detected
using checkpatch.pl script.

Fixes: 6fe5efa141 ('staging: octeon: Convert create_singlethread_workqueue()')
Cc: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-05 11:41:38 +01:00
Seraphime Kirkovski 0f06feba91 staging: bcm2835: cleanup: remove deprecated <asm/uaccess.h> include
This replaces the last occurrence of the deprecated <asm/uaccess.h> include
in the staging directory with the newer <linux/uaccess.h>

Signed-off-by: Seraphime Kirkovski <kirkseraph@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:39 +01:00
Dan Carpenter 76bdaa161c staging: lustre: libcfs: double copy bug
The problem is that we copy hdr.ioc_len, we verify it, then we copy it
again without checking to see if it has changed in between the two
copies.

This could result in an information leak.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:38 +01:00
Zhengyi Shen dcdf43a01e staging: lustre: fix coding style issue in vvp_page.c
This is a patch to fix "WARNING: line over 80 characters" found by
checkpatch.pl in vvp_page.c.

Signed-off-by: Zhengyi Shen <shenzhengyi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:38 +01:00
James Simmons a3463e64ad staging: lustre: ptlrpc : remove userland usage from ptlrpc
The reason for __REQ_LAYOUT_USER__ was to expose a
section of code in layout.c to userland for a utility
similar to wireshark. This was done before wireshark
existed but now that it does we no longer need to do
this type of hack. This also reduces lustre_acl.h to
strictly a kernel header now.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8945
Reviewed-on: https://review.whamcloud.com/24396
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@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>
2017-02-03 13:01:38 +01:00
James Simmons 86df59846c staging: lustre: osc: avoid 64 divide in osc_cache_too_much
The use of 64 bit time introduces an expensive 64 bit
division operation. Since the time lapse being calculated
in osc_cache_too_much will never be more than seventy years
we can cast the time lapse to an long and perform a normal
32 bit divison operation instead.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8835
Reviewed-on: https://review.whamcloud.com/23814
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:38 +01:00
wang di 1cf96da241 staging: lustre: lmv: remove nlink check in lmv_revalidate_slaves
If an application attempts to remove millions of files in a
single directory it will fail. This failure was tracked down to
the nlink < 2 check in lmv_revalidate_slaves, because after
nlink reaches to maximum value of LDISKFS_LINK_MAX (65000),
the nlink broadcast back from the server will be reported as
one. The return value of 1 is not invalid so lets remove
the check.

Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6984
Reviewed-on: http://review.whamcloud.com/16490
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Jian Yu <jian.yu@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>
2017-02-03 13:01:38 +01:00
Yang Sheng 77759771fb staging: lustre: llite: don't invoke direct_IO for the EOF case
The function generic_file_read_iter() does not check EOF
before invoke direct_IO callback. So we have to check it
ourselves.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8969
Reviewed-on: https://review.whamcloud.com/24552
Reviewed-by: Bob Glossman <bob.glossman@intel.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>
2017-02-03 13:01:38 +01:00
James Simmons 62898c2d7e staging: lustre: obd: move s3 in lmd_parse to inner loop
Building the lustre client with W=1 reports the following
error:

obdclass/obd_mount.c: In function lmd_parse:
obdclass/obd_mount.c:880: warning: variable set but not used

The solution is to move s3 to the inner loop
where it is only used.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8378
Reviewed-on: https://review.whamcloud.com/23820
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:38 +01:00
Steve Guminski 1a8dded1a3 staging: lustre: fid: Change positional struct initializers to C99
This patch makes no functional changes.  Struct initializers in the
fid directory that use C89 or GCC-only syntax are updated to C99
syntax.

The C99 syntax prevents incorrect initialization if values are
accidently placed in the wrong position, allows changes in the struct
definition, and clears any members that are not given an explicit
value.

The following struct initializers have been updated:

lustre/fid/fid_lib.c:
        const struct lu_seq_range LUSTRE_SEQ_SPACE_RANGE
        const struct lu_seq_range LUSTRE_SEQ_ZERO_RANGE
lustre/fid/lproc_fid.c:
        struct lprocfs_vars seq_client_debugfs_list

Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6210
Reviewed-on: https://review.whamcloud.com/23789
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@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>
2017-02-03 13:01:38 +01:00
Niu Yawei 15a4ca983f staging: lustre: ptlrpc: update replay cursor when close during replay
The replay cursor should be updated properly when close happened
during replay, otherwise, ptlrpc_replay_next() could run into a
dead loop due to an invalid replay cursor:

- replay cursor is moved to an open request during replay;
- application close that open file, so the rq_replay of the open
  request is cleared;
- ptlrpc_replay_next() calls ptlrpc_free_committed() to free
  committed/closed requests, the open request is removed from
  the committed list, so the replay cursor is changed to an
  empty list_head now. The open request won't be freed now since
  it's still held by the pending close request;
- ptlrpc_replay_next() continue to move the replay cursor to
  next and run into a dead loop at the end;

Another change in this patch is to remove the out of date comments
in ptlrpc_replay_next() and cover the whole process of finding
replay request within imp_lock, because:

1. With two separated replay lists and replay cursor introduced,
   finding replay request won't take much time as before, it's
   not necessary to do this "lock -> unlock -> lock -> unlock"
   trick anymore;

2. Nowadays there are various kind of non-replay requests are
   allowed during recovery, so ptlrpc_free_committed() may run in
   parallel to remove an open request while ptlrpc_replay_next()
   is iterating the open requests list;

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8765
Reviewed-on: https://review.whamcloud.com/23418
Reviewed-by: Yang Sheng <yang.sheng@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>
2017-02-03 13:01:38 +01:00
Dmitry Eremin 067e634307 staging: lustre: ptlrpc: update MODULE_PARAM_DESC in ptlrpcd.c
Update max_ptlrpcds module parameter descriptions to let
users know its obsolete. Change cpt to CPT for the module
parameter description ptlrpcd_per_cpt_max so it matches
documentation.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8890
Reviewed-on: https://review.whamcloud.com/24065
Reviewed-by: John L. Hammond <john.hammond@intel.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>
2017-02-03 13:01:38 +01:00
Dmitry Eremin b6d6d0571b staging: lustre: ptlrpc: remove unused pc->pc_env
Environment for request interpreters is not used any more.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8887
Reviewed-on: https://review.whamcloud.com/24061
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@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>
2017-02-03 13:01:38 +01:00
James Simmons 04d8615889 staging: lustre: socklnd: remove socklnd_init_msg
Remove the inline function socklnd_init_msg.
Its only used by the kernel code so no point
keeping it in an UAPI header.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/18506
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@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>
2017-02-03 13:01:38 +01:00
Liang Zhen 6cd6786921 staging: lustre: ksocklnd: ignore timedout TX on closing connection
ksocklnd reaper thread always tries to close the connection for the
first timedout zero-copy TX. This is wrong if this connection is
already being closed, because the reaper will see the same TX again
and again and cannot find out other timedout zero-copy TXs and close
connections for them.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8867
Reviewed-on: https://review.whamcloud.com/23973
Reviewed-by: Doug Oucharek <doug.s.oucharek@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>
2017-02-03 13:01:38 +01:00
John L. Hammond 59bedbccb5 staging: lustre: mdc: avoid returning freed request
In mdc_close() if ptlrpc_request_pack() fails then set req to NULL so
that an already freed request is not returned in *request.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8811
Reviewed-on: https://review.whamcloud.com/23843
Reviewed-by: Patrick Farrell <paf@cray.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>
2017-02-03 13:01:38 +01:00
Patrick Farrell 26d2bf1e71 staging: lustre: mdc: Make IT_OPEN take lookup bits lock
An earlier commit accidentally changed handling of IT_OPEN,
making it take the MDS_INODELOCK_UPDATE bits lock instead of
MDS_INODELOCK_LOOKUP. This does not cause any known bugs.

Signed-off-by: Patrick Farrell <paf@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8842
Reviewed-on: https://review.whamcloud.com/23797
Fixes: 70a251f68d ("staging: lustre: obd: decruft md_enqueue() and md_intent_lock()"
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@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>
2017-02-03 13:01:38 +01:00
Steve Guminski acd8f3e4e8 staging: lustre: libcfs: Change positional struct initializers to C99
This patch makes no functional changes. Struct initializers in the
libcfs directory that use C89 or GCC-only syntax are updated to C99
syntax.

The C99 syntax prevents incorrect initialization if values are
accidently placed in the wrong position, allows changes in the struct
definition, and clears any members that are not given an explicit
value.

The following struct initializers have been updated:

libcfs/include/libcfs/libcfs_crypto.h:
        static struct cfs_crypto_hash_type hash_types[]

Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6210
Reviewed-on: https://review.whamcloud.com/23332
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@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>
2017-02-03 13:01:38 +01:00
Dmitry Eremin 69d3990cfd staging: lustre: libcfs: fix error messages
Don't treat unability to set CPU partition affinity as error.
Improve those warning messages.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8703
Reviewed-on: https://review.whamcloud.com/23307
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@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>
2017-02-03 13:01:38 +01:00
John L. Hammond 3ff3151745 staging: lustre: obd: remove OBD_NOTIFY_CREATE
None of the obd_notify() handlers listen for the OBD_NOTIFY_CREATE
event, so remove it and its sole use in lov_add_target().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8403
Reviewed-on: https://review.whamcloud.com/21420
Reviewed-by: Ben Evans <bevans@cray.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>
2017-02-03 13:01:38 +01:00
Vladimir Saveliev c6de2b37b7 staging: lustre: ptlrpc: allow blocking asts to be delayed
ptlrpc_import_delay_req() refuses to delay blocking asts when import
is not in LUSTRE_IMP_FULL yet. That leads to client eviction assuming
that it failed to respond.

Allow delays for blocking asts being resent.

Signed-off-by: Vladimir Saveliev <vladimir.saveliev@seagate.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8351
Seagate-bug-id: MRP-3500
Reviewed-on: https://review.whamcloud.com/21065
Reviewed-by: Bobi Jam <bobijam@hotmail.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>
2017-02-03 13:01:38 +01:00
Steve Guminski 7550387a6e staging: lustre: osc: osc_match_base prototype differs from declaration
The patch updates the prototype in osc_internal.h to match the
enums used in the declaration.

The osc_match_base declaration in lustre/osc/osc_request.c uses
enums for stricter checking on the type and mode parameters:

int osc_match_base(struct obd_export *exp,
                   ...
-->                enum ldlm_type type,
                   union ldlm_policy_data *policy,
-->                enum ldlm_mode mode,
                   ...  int unref)

The prototype in lustre/osc/osc_internal.h instead used unsigned ints:

int osc_match_base(struct obd_export *exp,
                   ...
-->                __u32 type,
                       union ldlm_policy_data *policy,
-->                __u32 mode,
                   ...  int unref);

Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8189
Reviewed-on: http://review.whamcloud.com/23167
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@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>
2017-02-03 13:01:38 +01:00
Niu Yawei d7cad16975 staging: ptlrpc: leaked rs on difficult reply
reply_out_callback() should call ptlrpc_schedule_difficult_reply()
to finalize the rs if it's already not on uncommitted list, otherwise,
the rs and the export held by rs could be leaked:

- target_send_reply() sends a difficult reply before the transaction
  committed, the reply is linked to scp_rep_active;

- export gets disconnected by umount or whatever reason,
  server_disconnect_export() is called to complete all outstanding
  replies, which will calls into ptlrpc_handle_rs() to dispose of
  the rs, so the rs is removed from the uncommitted list and
  LNetMDUnlink() is called to unlink the reply buffer and generate
  an unlink event;

- reply_out_callback() is called to process above unlink event,
  ptlrpc_schedule_difficult_reply() is supposed to be called to
  dispose of the rs finally. However, it could be skipped because of
  following flawed code snippet:

  if (!rs->rs_no_ack ||
      rs->rs_transno <= rs->rs_export->exp_obd->obd_last_committed)
        ptlrpc_schedule_difficult_reply(rs);

The intention of above code is: if rs_no_ack is true (COS enabled),
and transaction is not committed, we should rely on commit callback
to release the rs. However, it overlooked the situation that rs
could have been removed from the uncommitted list by disconnecting
export.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7903
Reviewed-on: http://review.whamcloud.com/22696
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@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>
2017-02-03 13:01:38 +01:00
James Simmons 9fc9a344a3 staging: libcfs: remove integer types abstraction from libcfs
Replace the ulong_ptr_t and long_ptr_t with standard
kernel types.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/20204
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@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>
2017-02-03 13:01:38 +01:00
Rahul Deshmukh 3f4f78240d staging: lustre: llite: Adding timed wait in ll_umount_begin
There exists timing race between umount and other
thread which will increment the reference count on
mnt e.g. getattr. If umount thread lose the race
then umount fails with EBUSY error. To avoid this
timed wait is added so that umount thread will wait
for user to decrement the mnt reference count.

Signed-off-by: Rahul Deshmukh <rahul.deshmukh@seagate.com>
Signed-off-by: Lokesh Nagappa Jaliminche <lokesh.jaliminche@seagate.com>
Signed-off-by: Jian Yu <jian.yu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1882
Seagate-bug-id: MRP-1192
Reviewed-on: http://review.whamcloud.com/20061
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@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>
2017-02-03 13:01:38 +01:00
Bobi Jam 71c5eec3ee staging: lustre: llite: specify READA debug mask for ras_update
So that debug log only contains relevant messages for debugging
purpose.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8413
Reviewed-on: http://review.whamcloud.com/22753
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@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>
2017-02-03 13:01:38 +01:00
James Simmons 8e7a7362c3 staging: lustre: header: remove assert from interval_set()
In the case of interval_tree.h only interval_set()
uses LASSERT which is removed in this patch and
interval_set() instead reports a real error. The
header libcfs.h for interval_tree.h is not needed
anymore so we can just use the standard linux
kernel headers instead.h

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/22522
Reviewed-on: https://review.whamcloud.com/24323
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@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>
2017-02-03 13:01:38 +01:00
Bobi Jam 098b325b8f staging: lustre: lov: ld_target could be NULL
lov_device::ld_target[ost_idx] could be NULL if the OST target is
not filled in lov_device::ld_lov::lov_tgt_desc[ost_idx] yet.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8018
Reviewed-on: http://review.whamcloud.com/21411
Reviewed-by: Jinshan Xiong <jinshan.xiong@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>
2017-02-03 13:01:38 +01:00
Dmitry Eremin ff27098bba staging: lustre: libcfs: default CPT matches NUMA topology
Change default value of CPT pattern and make it match NUMA topology

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5050
Reviewed-on: http://review.whamcloud.com/22377
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Olaf Weber <olaf@sgi.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>
2017-02-03 13:01:38 +01:00
Dmitry Eremin c2351249f1 staging: lustre: libcfs: avoid stomping on module param cpu_pattern
The function cfs_cpt_table_create_pattern() alters the string
passed to it. Currently we are passing in the module parameter
string cpu_pattern which is incorrect. Instead lets duplicate
the module parameter string and pass that to the function
cfs_cpt_table_create_pattern().

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5050
Reviewed-on: http://review.whamcloud.com/22377
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Olaf Weber <olaf@sgi.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>
2017-02-03 13:01:37 +01:00
Jinshan Xiong aabb4adadd staging: lustre: osc: limits the number of chunks in write RPC
OSC has to make sure that it won't issue write RPCs with too many
chunks otherwise it will casue ZFS to create transactions much
bigger than DMU_MAX_ACCESS in size, which will end up with write
failure.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8135
Reviewed-on: http://review.whamcloud.com/22369
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8632
Reviewed-on: http://review.whamcloud.com/22654
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.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>
2017-02-03 13:01:37 +01:00
Niu Yawei 553ed75d85 staging: lustre: clio: sync write should update mtime
Sync write should update m/ctime promptly, otherwise, stale m/ctime
could be updated on the OST object by the sync write RPC.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7310
Reviewed-on: http://review.whamcloud.com/21063
Reviewed-by: John L. Hammond <john.hammond@intel.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>
2017-02-03 13:01:37 +01:00
Fan Yong c843ce2012 staging: lustre: ptlrpc: comment for FLD_QUERY RPC reply swab
The 'fld_read_server' uses 'RMF_GENERIC_DATA' to hold the 'FLD_QUERY'
RPC reply that is composed of 'struct lu_seq_range_array'. But there
is not registered swabber function for 'RMF_GENERIC_DATA'. So the RPC
peers need to handle the RPC reply with fixed little-endian format.

In theory, we can define new structure with some swabber registered
to handle the 'FLD_QUERY' RPC reply result automatically. But from
the implementation view, it is not easy to be done within current
'struct req_msg_field' framework. Because the sequence range array
in the RPC reply is not fixed length, instead, its length depends
on 'lu_seq_range' count, that is unknown when prepare the RPC buffer.
Generally, for such flexible length RPC usage, there will be a field
in the RPC layout to indicate the data length. But for the 'FLD_READ'
RPC, we have no way to do that unless we add new length filed that
will broken the on-wire RPC protocol and cause interoperability
trouble with old peer.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6284
Reviewed-on: http://review.whamcloud.com/22309
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:37 +01:00
Dmitry Eremin 07b71df149 staging: lustre: llite: Setting xattr are properly checked with and without ACLs
Setting extended attributes permissions are properly checked with and
without ACLs. In user.* namespace, only regular files and directories
can have extended attributes. For sticky directories, only the owner
and privileged user can write attributes.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1482
Reviewed-on: http://review.whamcloud.com/21496
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@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>
2017-02-03 13:01:37 +01:00
Andriy Skulysh aad88bde74 staging: lustre: ldlm: ASSERTION(flock->blocking_export!=0) failed
Whole policy structure was zeroed twice. Once during enqueue
and second time during resend or replay. Policy structure
should be initialized with default values only in ldlm_lock_new().

Signed-off-by: Andriy Skulysh <andriy.skulysh@seagate.com>
Signed-off-by: Ben Evans <bevans@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8349
Seagate-bug-id: MRP-2536, MRP-2909
Reviewed-on: http://review.whamcloud.com/21061
Reviewed-by: Alexander Boyko <alexander.boyko@seagate.com>
Reviewed-by: Vitaly Fertman <vitaly.fertman@seagate.com>
Reviewed-by: Mike Pershin <mike.pershin@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>
2017-02-03 13:01:37 +01:00
Fan Yong 15134e0910 staging: lustre: mgc: handle config_llog_data::cld_refcount properly
Originally, the logic of handling config_llog_data::cld_refcount
is some confusing, it may cause the cld_refcount to be leaked or
trigger "LASSERT(atomic_read(&cld->cld_refcount) > 0);" when put
the reference. This patch clean related logic as following:

1) When the 'cld' is created, its reference is set as 1.

2) No need additional reference when add the 'cld' into the list
   'config_llog_list'.

3) Inrease 'cld_refcount' when set lock data after mgc_enqueue()
   done successfully by mgc_process_log().

4) When mgc_requeue_thread() traversals the 'config_llog_list',
   it needs to take additional reference on each 'cld' to avoid
   being freed during subsequent processing. The reference also
   prevents the 'cld' to be dropped from the 'config_llog_list',
   then the mgc_requeue_thread() can safely locate next 'cld',
   and then decrease the 'cld_refcount' for previous one.

5) mgc_blocking_ast() will drop the reference of 'cld_refcount'
   that is taken in mgc_process_log().

6) The others need to call config_log_find() to find the 'cld'
   if want to access related config log data. That will increase
   the 'cld_refcount' to avoid being freed during accessing. The
   sponsor needs to call config_log_put() after using the 'cld'.

7) Other confused or redundant logic are dropped.

   On the other hand, the patch also enhances the protection for
   'config_llog_data' flags, such as 'cld_stopping'/'cld_lostlock'
   as following.

a) Use 'config_list_lock' (spinlock) to handle the possible
   parallel accessing of these flags among mgc_requeue_thread()
   and others config llog data visitors, such as mount/umount,
   blocking_ast, and so on.

b) Use 'config_llog_data::cld_lock' (mutex) to pretect other
   parallel accessing of these flags among kinds of blockable
   operations, such as mount, umount, and blocking ast.

The 'config_llog_data::cld_lock' is also used for protecting
the sub-cld members, such as 'cld_sptlrpc'/'cld_params', and
so on.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8408
Reviewed-on: http://review.whamcloud.com/21616
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Hongchao Zhang <hongchao.zhang@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>
2017-02-03 13:01:37 +01:00
Oleg Drokin d9421ff6c1 staging: lustre: llite: Trust creates in revalidate too.
By forcing creates to always go via lookup we lose some
important caching benefits too.
Instead let's trust creates with positive cached entries.

Then we have 3 possible outcomes:
1. Negative dentry - we go via atomic_open and do the create
   by name there.
2. Positive dentry, no contention - we just go straight to
   ll_intent_file_open and open by fid.
3. positive dentry, contention - by the time we reach the server,
   the inode is gone. We get ENOENT which is unacceptable to return
   from create. But since we know it's a create, we substitute it
   with ESTALE and VFS retries again with LOOKUP_REVAL set, we catch
   that in revalidate and force a lookup (same path as before this
   patch).

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8371
Reviewed-on: http://review.whamcloud.com/21168
Reviewed-by: James Simmons <uja.ornl@yahoo.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>
2017-02-03 13:01:37 +01:00
Lai Siyao e27bcd66cb staging: lustre: llite: normal user can't set FS default stripe
Current client doesn't check permission before updating filesystem
default stripe on MGS, which isn't secure and obvious.

Since we setattr on MDS first, and then set default stripe on MGS,
we can just return error upon setattr failure.

Now filesystem default stripe is stored in ROOT in MDT, so saving
it in system config is for compatibility with old servers, this
will be removed in the future.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8454
Reviewed-on: http://review.whamcloud.com/21612
Reviewed-on: http://review.whamcloud.com/22580
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@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>
2017-02-03 13:01:37 +01:00
Ben Evans e39cb21b33 staging: lustre: lustre: Remove old commented out code
These #if 0 blocks have been in place for years. Assume
they are not used and remove them

Signed-off-by: Ben Evans <bevans@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8058
Reviewed-on: http://review.whamcloud.com/20416
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Frank Zago <fzago@cray.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>
2017-02-03 13:01:37 +01:00
John L. Hammond 24eac929de staging: lustre: lmv: remove unused placement parameter
Remove the unused lmv.*.placement parameter along with supporting
functions and struct members.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7674
Reviewed-on: http://review.whamcloud.com/18019
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Frank Zago <fzago@cray.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>
2017-02-03 13:01:37 +01:00
John L. Hammond 3cd9714d45 staging: lustre: llite: remove obsolete comment for ll_unlink()
Remove obsolete comments about the behavior of ll_unlink()

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8003
Reviewed-on: http://review.whamcloud.com/19881
Reviewed-by: Andrew Perepechko <andrew.perepechko@seagate.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>
2017-02-03 13:01:37 +01:00
Andreas Dilger 7304370b57 staging: lustre: llite: handle inactive OSTs better in statfs
Change the order of checks for inactive OSCs in lov_prep_statfs_set()
so that administratively disabled OSTs do not generate any output in
"lfs df" at all, to avoid needlessly cluttering the output.

Enable the lazystatfs mount option by default, so that "df" does not
hang when an OST is temporarily offline.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7759
Reviewed-on: http://review.whamcloud.com/19195
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>
2017-02-03 13:01:37 +01:00
Alexander Boyko 4c43c27ddc staging: lustre: ptlrpc: skip lock if export failed
This patch resolves IO vs eviction race.
After eviction failed export stayed at stale list,
a client had IO processing and reconnected during it.
A client sent brw rpc with last lock cookie and new connection.
The lock with failed export was found and assert was happened.
 (ost_handler.c:1812:ost_prolong_lock_one())
  ASSERTION( lock->l_export == opd->opd_exp ) failed:

 1. Skip the lock at ldlm_handle2lock if lock export failed.
 2. Validation of lock for IO was added at hpreq_check(). The lock
    searching is based on granted interval tree. If server doesn`t
    have a valid lock, it reply to client with ESTALE.

Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7702
Seagate-bug-id: MRP-2787
Reviewed-on: http://review.whamcloud.com/18120
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Vitaly Fertman <vitaly.fertman@seagate.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>
2017-02-03 13:01:37 +01:00
Alex Zhuravlev 3f5b9d55f5 staging: lustre: obdclass: do not call lu_site_purge() for single object exceed
First of all, this is expensive procedure including a global
mutex and per-bucket spinlocks. also, all the threads observed
exceed will be calling lu_site_purge() and essentially serialized
on that. instead we can let other threads to skip the whole
procedure.

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7896
Reviewed-on: http://review.whamcloud.com/19082
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@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>
2017-02-03 13:01:37 +01:00
Jinshan Xiong d49ae4383a staging: lustre: llite: don't ignore layout for group lock request
ignore_layout can be set for operations that layout won't be changed,
typically page operations. Ignoring layout change in group lock
request will confuse layout change code at LOV layer and hit
assertion.

Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2766
Reviewed-on: http://review.whamcloud.com/6828
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>
2017-02-03 13:01:37 +01:00
frank zago 22aadb91c0 staging: lustre: hsm: stack overrun in hai_dump_data_field
The function hai_dump_data_field will do a stack buffer
overrun when cat'ing /sys/fs/lustre/.../hsm/actions if an action has
some data in it.

hai_dump_data_field uses snprintf. But there is no check for
truncation, and the value returned by snprintf is used as-is.  The
coordinator code calls hai_dump_data_field with 12 bytes in the
buffer. The 6th byte of data is printed incompletely to make room for
the terminating NUL. However snprintf still returns 2, so when
hai_dump_data_field writes the final NUL, it does it outside the
reserved buffer, in the 13th byte of the buffer. This stack buffer
overrun hangs my VM.

Fix by checking that there is enough room for the next 2 characters
plus the NUL terminator. Don't print half bytes. Change the format to
02X instead of .2X, which makes more sense.

Signed-off-by: frank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8171
Reviewed-on: http://review.whamcloud.com/20338
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jean-Baptiste Riaux <riaux.jb@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>
2017-02-03 13:01:37 +01:00
Ulka Vaze 30af99db7a staging: lustre: lmv: Error not handled for lmv_find_target
This issue is found by smatch; has been reported as-
Unchecked usage of potential ERR_PTR result in lmv_hsm_req_count
and lmv_hsm_req_build. Added ERR_PTR in both functions and also
return value check added.

Signed-off-by: Ulka Vaze <ulka.vaze@yahoo.in>
Signed-off-by: Aditya Pandit <panditadityashreesh@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6523
Reviewed-on: http://review.whamcloud.com/14918
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@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>
2017-02-03 13:01:37 +01:00
Ann Koehler e202d55b05 staging: lustre: obd: RCU stalls in lu_cache_shrink_count()
The algorithm for counting freeable objects in the lu_cache shrinker
does not scale with the number of cpus. The LU_SS_LRU_LEN counter
for each cpu is read and summed at shrink time while holding the
lu_sites_guard mutex. With a large number of cpus and low memory
conditions, processes bottleneck on the mutex.

This mod reduces the time spent counting by using the kernel's percpu
counter functions to maintain the length of a site's lru. The summing
occurs when a percpu value is incremented or decremented and a
threshold is exceeded. lu_cache_shrink_count() simply returns the
last such computed sum.

This mod also replaces the lu_sites_guard mutex with a rw semaphore.
The lock protects the lu_site list, which is modified when a file
system is mounted/umounted or when the lu_site is purged.
lu_cache_shrink_count simply reads data so it does not need to wait
for other readers. lu_cache_shrink_scan, which actually frees the
unused objects, is still serialized.

Signed-off-by: Ann Koehler <amk@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7997
Reviewed-on: http://review.whamcloud.com/19390
Reviewed-by: Andreas Dilger <andreas.dilger@intel.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>
2017-02-03 13:01:37 +01:00
Giuseppe Di Natale 65aaf99d5d staging: lustre: lmv: Correctly generate target_obd
The target_obd debugfs file was not being generated correctly
in cases where nonconsecutive MDT indices were used when
generating a filesystem.

Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8100
Reviewed-on: http://review.whamcloud.com/20336
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@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>
2017-02-03 13:01:37 +01:00
Jeremy Filizetti 8a140b45e4 staging: lustre: ldlm: Restore connect flags on failure
Restore connect flags on failure of ptlrpc_connect_import()
to prevent an LBUG due to flags mismatch.

Signed-off-by: Jeremy Filizetti <jeremy.filizetti@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7185
Reviewed-on: http://review.whamcloud.com/16950
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
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>
2017-02-03 13:01:37 +01:00
Niu Yawei 67597ce28a staging: lustre: ptlrpc: set proper mbits for EINPROGRESS resend
Set mbits for EINPROGRESS resend in ptl_send_rpc().

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8193
Reviewed-on: http://review.whamcloud.com/20377
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@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>
2017-02-03 13:01:37 +01:00
Jinshan Xiong 198a49a964 staging: lustre: clio: revise readahead to support 16MB IO
Read ahead currently doesn't handle 16MB RPC packets correctly
by assuming the packets are a default size instead of querying
the size. This work adjust the read ahead policy to issue
read ahead RPC by the underlying RPC size.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Gu Zheng <gzheng@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7990
Reviewed-on: http://review.whamcloud.com/19368
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Li Xi <lixi@ddn.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>
2017-02-03 13:01:37 +01:00
Andreas Dilger ea3f00df27 staging: lustre: mdc: quiet console message for known -EINTR
If a user process is waiting for MDS recovery during close, but the
process is interrupted, the file is still closed but it prints a
message on the console. Quiet the console message for -EINTR, since
this is expected behaviour.

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/14911
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Emoly Liu <emoly.liu@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>
2017-02-03 13:01:37 +01:00
Bobi Jam 279b7afab2 staging: lustre: clio: add cl_page LRU shrinker
Register cache shrinker to reclaim memory from cl_page LRU list.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6842
Reviewed-on: http://review.whamcloud.com/15630
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@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>
2017-02-03 13:01:36 +01:00
Lai Siyao 58ff698c90 staging: lustre: statahead: drop support for remote entry
This patch dropped support for remote entry statahead, because it
needs 2 async RPCs to fetch both LOOKUP lock from parent MDT and
UPDATE lock from client MDT, which is complicated. Plus not
supporting remote entry statahead won't cause any issue.

* pack child fid in statahead request.
* lmv_intent_getattr_async() will compare parent and child MDT,
  if child is remote, return -ENOTSUPP.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6578
Reviewed-on: http://review.whamcloud.com/15767
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: wangdi <di.wang@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>
2017-02-03 13:01:36 +01:00
Jinshan Xiong 1ed32aedc8 staging: lustre: llite: Remove access of stripe in ll_setattr_raw
In ll_setattr_raw(), it needs to know if a file is released
when the file is being truncated. It used to get this information
by accessing lov_stripe_md. This turns out not necessary. This
patch removes the access of lov_stripe_md and solves the problem
in lov_io_init_released().

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5823
Reviewed-on: http://review.whamcloud.com/13514
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
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>
2017-02-03 13:01:36 +01:00
Martin Karamihov b878077905 staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)
This is checkpatch fix for hal/bb_cfg.c file:
remove not necessary braces {}

Signed-off-by: Martin Karamihov <martinowar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:36 +01:00
Masanari Iida 5f50ca98af staging: greybus: Remove duplicate include file
This patch removed duplicated include line.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:36 +01:00
Colin Ian King de9a009b93 staging: rts5208: remove unncessary result set and check, just return SUCCESS
Minor clean up, there is no need to assign result to zero, then
check if it is less than zero. Just return SUCCESS.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:36 +01:00
Colin Ian King 041b67b389 staging: rts5208: remove redundant retval status check
The retval status checks in the proceeding do loop return out
of function ms_read_attritbute_info if there is an error
condition,  thus we never reach the end of the loop with
retval failed status.  Therefore, the retval status check
at end of the do loop is redundant and can be removed.

Detected with CoverityScan, CID#143000 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:36 +01:00
Arnd Bergmann 22eb36b814 staging: fbtft: change 'gamma' array to u32
Having a local variable of 1024 bytes on 64-bit architectures is a bit
too much, and I ran into this warning while trying to see what functions
use the largest stack:

drivers/staging/fbtft/fbtft-sysfs.c: In function 'store_gamma_curve':
drivers/staging/fbtft/fbtft-sysfs.c:132:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]

As there is no need for 64-bit gamma values (on 32-bit architectures,
we don't use those either), I'm changing the type from 'unsigned long'
to 'u32' here, which cuts the required space in half everywhere.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:36 +01:00
Arnd Bergmann 26190d41b9 staging: rtl8192u: move stats_IndicateArray off stack
Putting 128 pointers on the stack is rather wasteful, in particular
on 64-bit architectures:

drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c: In function 'RxPktPendingTimeout':
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:92:1: warning: the frame size of 1072 bytes is larger than 1024 bytes [-Wframe-larger-than=]

The rtl8192e driver has the exact same function, except that stores the
array in its 'ieee' structure. Let's do it the same way here for consistency.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:36 +01:00
Arnd Bergmann 156650083f staging: bcm2835: don't mark 'bcm2835_v4l2_debug' as static
This one unfortunately slipped through my own build testing, my patch
caused a new build error:

bcm2835-camera.c:53:12: error: static declaration of 'bcm2835_v4l2_debug' follows non-static declaration

We want the symbol to be global as it is indeed used in more than one
file and declared 'extern' in a header.

Fixes: 757b9bd074 ("staging: bcm2835: mark all symbols as 'static'")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:21:51 +01:00
Arushi 284a4e3ab5 staging: rtl8192e: Aligning the * on each line in block comments
This patch fixes the issue by aligning the * on each line in block comments.

Signed-off-by: Arushi <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:12:22 +01:00
David Kershner d308d2b584 staging: unisys: visorbus: get rid of unused payload info
We no longer send payloads back to the s-Par firmware, we can get rid of
the initialize and destroy functions since they weren't actually being
used just created and destroyed.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:10:49 +01:00
David Kershner 85afaa681b staging: unisys: visorbus: remove putfile data structures
There were several unused data structures dealing with putfile that are no
longer being used. So get rid of them.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:10:49 +01:00
Tim Sell 9c70ee32ff staging: unisys: visornic: prevent hang doing 'modprobe -r visornic'
A stray+extraneous 'netif_napi_add()' that we were doing in
visornic_probe() was causing havoc when we got into visornic_remove(),
called during 'modprobe -r visornic'. The symptom was a processor busy-wait
loop on the modprobe process, which '/proc/<pid>/stack' would show looping
doing napi things.

Presumably the stray line got there as a result of some merging snafoo, and
has been deleted to fix the problem. With this patch 'modprobe -r visornic'
and a subsequent 'modprobe visornic' both complete successfully, and result
in an operational network.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:10:49 +01:00
David Binder 7289a8dd2b staging: unisys: visorbus: Consolidate kobject functions
Simplifies kobject usage in visorchipset.c by combining pairs of functions
that are better expressed combined.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:10:48 +01:00
David Binder 308ee8aa1f staging: unisys: visorbus: Check controlvm message payload size
Checks the controlvm message's payload size before copying it into a
parser_context struct's name region.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:10:48 +01:00
David Binder 0c773962cf staging: unisys: visorbus: Remove unused struct in visorchannel.c
Removes struct safe_uis_queue, which is within struct visorchannel. The
struct is not used anywhere in the s-Par drivers.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:10:48 +01:00
Miquel Raynal a8e39c57c1 staging: bcm2835-audio: fix style problem in vc_vchi_audioserv_defs.h
Remove spaces around parenthesized expression to conform to the
kernel coding style. Issue found by checkpatch.pl script.

Signed-off-by: Miquel Raynal <raynal.miquel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:05:06 +01:00
Colin Ian King 7dd551e20e staging: bcm2835-audio: use | instead of || otherwise result is just boolean 1
The incorrect or operator is being used resulting in cookies being
set to 1 (true) rather than the intended hex value.  Fix this by
using | instead of ||.

Issue found with static analysis with cppcheck

Fixes: 0cec463e39 ("staging: bcm2835-audio: Simplify callback structure for write data")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:05:06 +01:00
Arnd Bergmann f440d90908 staging: lustre: remove CLASSERT macro
lustre uses a fake switch() statement as a compile-time assert, but unfortunately
each use of that causes a warning when building with clang:

drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2907:2: warning: no case matching constant switch condition '42'
drivers/staging/lustre/lnet/klnds/socklnd/../../../include/linux/libcfs/libcfs_private.h:294:36: note: expanded from macro 'CLASSERT'
 #define CLASSERT(cond) do {switch (42) {case (cond): case 0: break; } } while (0)

As Greg suggested, let's just kill off this macro completely instead of
fixing it. This replaces it with BUILD_BUG_ON(), which means we have
to negate all the conditions in the process.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:03:04 +01:00
Arnd Bergmann 757b9bd074 staging: bcm2835: mark all symbols as 'static'
I got a link error in allyesconfig:

drivers/staging/media/platform/bcm2835/bcm2835-camera.o: In function `vidioc_enum_framesizes':
bcm2835-camera.c:(.text.vidioc_enum_framesizes+0x0): multiple definition of `vidioc_enum_framesizes'
drivers/media/platform/vivid/vivid-vid-cap.o:vivid-vid-cap.c:(.text.vidioc_enum_framesizes+0x0): first defined here

While both drivers are equally at fault for this problem, the bcm2835 one was
just added and is easier to fix, as it is only one file, and none of its symbols
need to be globally visible. This marks the three global symbols as static.

Fixes: 7b3ad5abf0 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:01:32 +01:00
Arnd Bergmann b07525b89f staging: bcm2835-audio: fix empty-body warning
gcc-7 warns about debug statements being left out here:

drivers/staging/bcm2835-audio/bcm2835-vchiq.c: In function 'bcm2835_audio_set_ctls':
drivers/staging/bcm2835-audio/bcm2835-vchiq.c:572:54: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]

It's better to use no_printk(), which has the added advantage of checking
the format strings.

Fixes: 23b028c871 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:01:32 +01:00
Arnd Bergmann fe822dc6c1 staging: bcm2835-audio: remove incorrect include path
The driver introduces a new instance of the missing-include-dirs warning that
is enabled at the "make W=1" level but has no other output:

cc1: error: /git/arm-soc/drivers/staging/vc04_services/interface/vcos/linuxkernel: No such file or directory [-Werror=missing-include-dirs]

In order to let us enable the warning by default in the future, we should
just remove the incorrect argument here.

Fixes: 23b028c871 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:01:32 +01:00
Arnd Bergmann 3ad13763b5 staging: bcm2835-v4l: remove incorrect include path
The driver introduces a new instance of the missing-include-dirs warning that
is enabled at the "make W=1" level but has no other output:

cc1: error: drivers/staging/vc04_services/interface/vcos/linuxkernel: No such file or directory [-Werror=missing-include-dirs]
cc1: all warnings being treated as errors
scripts/Makefile.build:307: recipe for target 'drivers/staging/media/platform/bcm2835/bcm2835-camera.o' failed

In order to let us enable the warning by default in the future, we should
just remove the incorrect argument here.

Fixes: 97b35807cc ("staging: bcm2835-v4l2: Add a build system for the module.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:01:32 +01:00
Michael Zoran d3a4e613bc staging: bcm2835/mmal-vchiq: Replace call to vchi_msg_queue with vchi_queue_kernel_message
The function vchi_msg_queue was made static in vc04_services
and replaced with vchi_queue_kernel_message.

Change the call to vchi_msg_queue to vchi_queue_kernel_message

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:01:31 +01:00
Michael Zoran c07acb97fd staging: bcm2835-audio: Replace call to vchi_msg_queue with vchi_queue_kernel_message
The function vchi_msg_queue was made static in vc04_services
and replaced with vchi_queue_kernel_message.

Change the call to vchi_msg_queue to vchi_queue_kernel_message

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:01:31 +01:00
Greg Kroah-Hartman fa6a8adf3a Third set of new device support, features and cleanups for IIO in the 4.11 cycle
This also involves a merge of the ib-mid-iio-pwm-4.11 branch from mfd to
 bring in support for the stm32 timer triggers needed for the buffered
 features in the stm32 adc driver.
 
 New device support:
 * Amligic Meson SAR ADC
   - new driver and bindings
 * cros_ec barometer
   - new driver
 * max5481 digital potentiometers
   - new driver for 5481, 5482, 5483 and 5484
 * Renesas GyroADC - a very specific spi offload engine for ADCs
   - new driver and bindings.
 * srf08 ultrasonic ranger
   - new driver, bindings and ABI docs,
 
 New features
 * Qualcomm PM8xxx ADC bindings.
   - due to a trivial build issues the driver will be following shortly.
 * stm32 ADC
   - Triggered buffer mode
   - Allow use of stm32 timer triggers
   - Add trigger polarity control
   - Optional DMA support with bindings update
 * stx104
   - add support for gpio names
   - support set_multiple callback
 * tmp007
   - optional interrupt support
 
 Cleanups
 * ad7150
   - alignment fix.
 * ad7816
   - octal rather than symbolic permissions.
 * lsm6dsx
   - allow selection of data ready pin via device tree bindings.
 * ssp_sensors
   - use devm_iio_device_register to handle unregister automatically.
 * stx104
   - use devm functions in probe allowing removal or the remove function.
   - drop unneeded struct stx104_dev
 * tmp007
   - fix the name attribute to be a meaninful description of the part.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAliSM5IRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FogLaBAApj79bVoAcO+aznbW1ipg1sZEl8617610
 60Wq23pXqQRVi8osklnsUC+PBEdQhpGq8ijDMppjJD7ta3UEUBEFDUTAEWnkfugb
 B65H0XVO2m0ZCyEh7mqb9R9PXK/et1YU1Wj0Q7VTLDqX3oUCg4tPNDI+VBsA5ZFa
 OWFtDEiSY9GpLiotUi9cGGAx+qt1pOzimukrZkIFwt+UXju4rCySLymjESv++G7+
 3Kqumvjz+BQqWqqEcj2X0SYORDadpTNkS/3z477Kc4b4ykYsuRIHYM+zrDAtziKu
 Yxd2aggnFkM3BSvk1Uld0WM9xpwBuCMOZVvN8S0QkkNGIvrM/faWsH4UmANkmDeG
 dtldakTp7rHrWi8bGvzVXswXELANyDL7+SB/MWqJhf3LqLnt5KM0DoFxxGfUWuXG
 bg3yGwgxxOaUrZJIqxVXGHOiYK+TA3fU/dz0+qp/rbtLV0bbF9TMST0UH5o2+cXy
 NkisXiAQSWXRV6YMNiMwEoqt5d3SuUJb0bcryMeIPl3bbjc2YBQPo5n/2Q7UWsWt
 GdFwuw9Y6IvRw61RQRceGjEs5sVIUXm2JnRdOFluJA1YDb3WUfxrA8lL4M08ZCa5
 bt+tGtf1SCRcTeourYzn7+xMVvCurRA62p5DOkFKeJ8Ck+tr6eTyP3gE5shdzVrv
 skwSqrkRUPg=
 =smLx
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.11c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third set of new device support, features and cleanups for IIO in the 4.11 cycle

This also involves a merge of the ib-mid-iio-pwm-4.11 branch from mfd to
bring in support for the stm32 timer triggers needed for the buffered
features in the stm32 adc driver.

New device support:
* Amligic Meson SAR ADC
  - new driver and bindings
* cros_ec barometer
  - new driver
* max5481 digital potentiometers
  - new driver for 5481, 5482, 5483 and 5484
* Renesas GyroADC - a very specific spi offload engine for ADCs
  - new driver and bindings.
* srf08 ultrasonic ranger
  - new driver, bindings and ABI docs,

New features
* Qualcomm PM8xxx ADC bindings.
  - due to a trivial build issues the driver will be following shortly.
* stm32 ADC
  - Triggered buffer mode
  - Allow use of stm32 timer triggers
  - Add trigger polarity control
  - Optional DMA support with bindings update
* stx104
  - add support for gpio names
  - support set_multiple callback
* tmp007
  - optional interrupt support

Cleanups
* ad7150
  - alignment fix.
* ad7816
  - octal rather than symbolic permissions.
* lsm6dsx
  - allow selection of data ready pin via device tree bindings.
* ssp_sensors
  - use devm_iio_device_register to handle unregister automatically.
* stx104
  - use devm functions in probe allowing removal or the remove function.
  - drop unneeded struct stx104_dev
* tmp007
  - fix the name attribute to be a meaninful description of the part.
2017-02-02 11:26:23 +01:00