platform/kernel/linux-rpi.git
7 years agostaging: fsl-mc: fix resource_size.cocci warnings
Julia Lawall [Thu, 20 Jul 2017 05:49:35 +0000 (07:49 +0200)]
staging: fsl-mc: fix resource_size.cocci warnings

 Use resource_size function on resource object
 instead of explicit computation.

Generated by: scripts/coccinelle/api/resource_size.cocci

Fixes: a037b7ec2eb7 ("staging: fsl-mc: allow the driver compile multi-arch")
CC: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: allow the driver compile multi-arch
Laurentiu Tudor [Wed, 19 Jul 2017 11:42:32 +0000 (14:42 +0300)]
staging: fsl-mc: allow the driver compile multi-arch

Add an alternate dependency on COMPILE_TEST, thus leaving
this driver compile on other architectures.
Also, other drivers depending on the bus are updated to depend
on ARCH_LAYERSCAPE until they'll also be made multi-arch.
This was compiled tested on:
 - booke powerpc (corenet{32,64}_smp_defconfig)
 - x86 (i386_defconfig, x86_64_defconfig, needs CONFIG_OF)
 - arm64 (defconfig)

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: make the driver compile on 32-bit
Laurentiu Tudor [Wed, 19 Jul 2017 11:42:31 +0000 (14:42 +0300)]
staging: fsl-mc: make the driver compile on 32-bit

Since there's no real constrain in MC to do only atomic 64-bit we can
enable this driver on 32-bit platforms too.
Include linux/io-64-nonatomic-hi-lo.h to make quad device io apis used
in the driver available on 32-bit platforms.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: don't use raw device io functions
Laurentiu Tudor [Wed, 19 Jul 2017 11:42:30 +0000 (14:42 +0300)]
staging: fsl-mc: don't use raw device io functions

As raw device io functions are not portable and don't handle byte-order
(triggering suspicion that endianness isn't handled well) switch to
using the standard api.
Since MC expects LE byte-order and the upper layers already take care
of that, we need to trick the device io api by doing a LE -> CPU
conversion just before calling it. This way, the CPU -> LE conversion
done in the api puts the data back in the right byte-order. Obviously,
for reads the extra step is mirrored: there's a CPU -> LE conversion
following the API call.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: fix formating of phys_addr_t on 32 bits
Laurentiu Tudor [Wed, 19 Jul 2017 11:42:29 +0000 (14:42 +0300)]
staging: fsl-mc: fix formating of phys_addr_t on 32 bits

Use correct format specifier for phys_addr_t variables (%pa) instead
of %llx. This fixes these warnings on 32 bit targets:
 "format '%llx' expects argument of type 'long long unsigned int',
  but argument 4 has type 'phys_addr_t' [-Wformat=]"

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: fix compilation with non-generic msi domain ops
Laurentiu Tudor [Wed, 19 Jul 2017 11:42:28 +0000 (14:42 +0300)]
staging: fsl-mc: fix compilation with non-generic msi domain ops

The bus driver relies on generic msi domain ops.
Fix compilation for architectures that don't provide it (e.g. x86_64).

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: drop useless gic v3 related #include
Laurentiu Tudor [Wed, 19 Jul 2017 11:42:27 +0000 (14:42 +0300)]
staging: fsl-mc: drop useless gic v3 related #include

Nothing from linux/irqchip/arm-gic-v3.h is used, so the #include can be
safely dropped.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: use generic memory barriers
Laurentiu Tudor [Wed, 19 Jul 2017 11:42:26 +0000 (14:42 +0300)]
staging: fsl-mc: use generic memory barriers

No need to use arch-specific memory barriers; switch to using generic
ones. The rmb()s were useless so drop them.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: add missing fsl_mc comment in struct msi_desc
Laurentiu Tudor [Wed, 19 Jul 2017 11:42:25 +0000 (14:42 +0300)]
staging: fsl-mc: add missing fsl_mc comment in struct msi_desc

The mc-bus specific field, fsl_mc in struct msi_desc is missing its
comment so add it.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8723bs: rtw_efuse: Fix a misspell
Xaralampos Mainas [Tue, 18 Jul 2017 15:12:47 +0000 (18:12 +0300)]
staging: rtl8723bs: rtw_efuse: Fix a misspell

Fix a comment misspell

Signed-off-by: Xaralampos Mainas <xmrancho@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: wlan-ng: Fixing coding style warnings
Simo Koskinen [Tue, 18 Jul 2017 08:23:45 +0000 (10:23 +0200)]
Staging: wlan-ng: Fixing coding style warnings

Removes following warnings found by checkpatch.pl script:

WARNING: Prefer using '"%s...", __func__' to using 'xxx',
this function's name, in a string

Signed-off-by: Simo Koskinen <koskisoft@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: goldfish: Use __func__ instead of function name
Chris Coffey [Tue, 18 Jul 2017 14:43:56 +0000 (15:43 +0100)]
staging: goldfish: Use __func__ instead of function name

Replace hard-coded function names in strings with "%s", __func__
in the goldfish_nand.c file. Issue found by checkpatch.pl.

Signed-off-by: Chris Coffey <cmc@babblebit.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lov: remove dead code
Dmitriy Cherkasov [Sat, 29 Jul 2017 00:13:43 +0000 (17:13 -0700)]
staging: lustre: lov: remove dead code

This #if 0 block has been commented out for years. Assume it is not
needed and remove it.

Signed-off-by: Dmitriy Cherkasov <dmitriy@oss-tech.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: llite: set security xattr using __vfs_setxattr
James Simmons [Wed, 26 Jul 2017 15:22:36 +0000 (11:22 -0400)]
staging: lustre: llite: set security xattr using __vfs_setxattr

Currently ll_initxattrs() initializes the security xattrs in
a very non-standard using get_xattr_types() to get the struct
handler that lustre created to then call indirectly the function
to set the xattr. The available __vfs_setxattr() function does
the same thing and also handles the case of when size is zero
the xattr should be set to empty EA.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183
Reviewed-on: https://review.whamcloud.com/27240
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Sebastien Buisson <sbuisson@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>
7 years agostaging: lustre: llite: add xattr.h header to xattr.c
Dmitry Eremin [Wed, 26 Jul 2017 15:22:35 +0000 (11:22 -0400)]
staging: lustre: llite: add xattr.h header to xattr.c

The reason xattr.c can compile without xattr.h is due
to lustre_compact.h being included. That header will
eventually go away so lets directly include xattr.h.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7244
Reviewed-on: http://review.whamcloud.com/16707
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: llite: allow cached acls
Dmitry Eremin [Wed, 26 Jul 2017 15:22:33 +0000 (11:22 -0400)]
staging: lustre: llite: allow cached acls

Move the freeing of all cached acls from ll_get_acl() to the
function ll_clear_inode(). This way we free all cached acls
for the inode just before clearing it. This allow us to take
advantage of cached acls and correctly free them before free.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-on: https://review.whamcloud.com/25965
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183
Reviewed-by: Bob Glossman <bob.glossman@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>
7 years agostaging: lustre: libcfs: fix test for libcfs_ioctl_hdr minimum size
James Simmons [Wed, 26 Jul 2017 15:22:32 +0000 (11:22 -0400)]
staging: lustre: libcfs: fix test for libcfs_ioctl_hdr minimum size

The function libcfs_ioctl_getdata() test to see if libcfs_ioctl_hdr
is smaller than struct libcfs_ioctl_data in size. This is wrong
and it breaks the ioctl that is used to collect LNet stats. The
correct size to compare against is struct libcfs_ioctl_hdr.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5935
Reviewed-on: http://review.whamcloud.com/12782
Fixes: ed2f549dc0f6 ("staging: lustre: libcfs: test if userland data is to small")
Reported-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.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>
7 years agostaging: lustre: ptlrpc: print times in microseconds
Bob Glosman [Wed, 26 Jul 2017 15:22:31 +0000 (11:22 -0400)]
staging: lustre: ptlrpc: print times in microseconds

report times and time diffs in seconds.microseconds instead of seconds

Signed-off-by: Bob Glosman <bob.glossman@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7733
Reviewed-on: http://review.whamcloud.com/18335
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Minh Diep <minh.diep@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>
7 years agostaging: lustre: ptlrpc: don't use CFS_DURATION_T for time64_t
James Simmons [Wed, 26 Jul 2017 15:22:30 +0000 (11:22 -0400)]
staging: lustre: ptlrpc: don't use CFS_DURATION_T for time64_t

The libcfs CFS_DURATION_T define is really only for
jiffies and its being used with time64_t in some of
the ptlrpc code. Lets remove CFS_DURATION_T and
replaced it with normal %lld instead.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/24977
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4423
Reviewed-by: Bob Glossman <bob.glossman@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>
7 years agostaging: lustre: ptlrpc: restore 64-bit time for struct ptlrpc_cli_req
James Simmons [Wed, 26 Jul 2017 15:22:29 +0000 (11:22 -0400)]
staging: lustre: ptlrpc: restore 64-bit time for struct ptlrpc_cli_req

During the reorganization of ptlrpc_request some of the
time64_t fields were incorrectly turned into time_t.
Restore those fields back to time_64_t.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/24977
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4423
Fixes: 32c8728d87dc ("staging/lustre/ptlrpc: reorganize ptlrpc_request")
CC: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@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>
7 years agostaging: lustre: linkea: linkEA size limitation
Fan Yong [Wed, 26 Jul 2017 15:22:28 +0000 (11:22 -0400)]
staging: lustre: linkea: linkEA size limitation

Under DNE mode, if we do not restrict the linkEA size, and if there
are too many cross-MDTs hard links to the same object, then it will
cause the llog overflow. On the other hand, too many linkEA entries
in the linkEA will serious affect the linkEA performance because we
only support to locate linkEA entry consecutively.

So we need to restrict the linkEA size. Currently, it is 4096 bytes,
that is independent from the backend. If too many hard links caused
the linkEA overflowed, we will add overflow timestamp in the linkEA
header.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8569
Reviewed-on: https://review.whamcloud.com/23500
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: wangdi <di.wang@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>
7 years agostaging: lustre: lustre: fix all less than 0 comparison for unsigned values
James Simmons [Wed, 26 Jul 2017 15:22:27 +0000 (11:22 -0400)]
staging: lustre: lustre: fix all less than 0 comparison for unsigned values

Remove all test of less than zero for unsigned values
found with -Wtype-limits.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8843
Reviewed-on: https://review.whamcloud.com/23811
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jian Yu <jian.yu@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>
7 years agostaging: lustre: ldlm: restore interval_iterate_reverse function
James Simmons [Wed, 26 Jul 2017 15:22:26 +0000 (11:22 -0400)]
staging: lustre: ldlm: restore interval_iterate_reverse function

Earlier the function interval_iterate_reverse function was
removed since it wasn't used by anyone. Now it is being
restored since it will be used by a future patch.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ptlrpc: no need to reassign mbits for replay
Niu Yawei [Wed, 26 Jul 2017 15:22:25 +0000 (11:22 -0400)]
staging: lustre: ptlrpc: no need to reassign mbits for replay

It's not necessary reassgin & re-adjust rq_mbits for replay
request in ptlrpc_set_bulk_mbits(), they all must have already
been correctly assigned before.

Such unecessary reassign could make the first matchbit not
PTLRPC_BULK_OPS_MASK aligned, that'll trigger LASSERT in
ptlrpc_register_bulk():

- ptlrpc_set_bulk_mbits() is called when first time sending
  request, rq_mbits is set as xid, which is BULK_OPS aligned;

- ptlrpc_set_bulk_mbits() continue to adjust the mbits for
  multi-bulk RPC, rq_mbits is not aligned anymore, then rq_xid
  is changed accordingly if client is connecting to an old
  server, so rq_xid became unaligned too;

- The request is replayed, ptlrpc_set_bulk_mbits() reassign
  the rq_mbits as rq_xid, which isn't aligned already, but
  ptlrpc_register_bulk() still assumes this value as the
  first matchbits and LASSERT it's BULK_OPS aligned.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6808
Reviewed-on: http://review.whamcloud.com/23048
Reviewed-by: Fan Yong <fan.yong@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>
7 years agostaging: lustre: ptlrpc: correct use of list_add_tail()
John L. Hammond [Wed, 26 Jul 2017 15:22:24 +0000 (11:22 -0400)]
staging: lustre: ptlrpc: correct use of list_add_tail()

With people starting to test security enabled ptlrpc
a list_del corruption was reported. The reason for
this error was tracked down to wrong arguments to
list_add_tail(). In sptlrpc_gc_add_sec() swap the
arguments to list_add_tail() so that it does what
we meant it to do.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8270
Reviewed-on: http://review.whamcloud.com/20784
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@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>
7 years agostaging: lustre: lov: Ensure correct operation for large object sizes
Nathaniel Clark [Wed, 26 Jul 2017 15:22:23 +0000 (11:22 -0400)]
staging: lustre: lov: Ensure correct operation for large object sizes

If a backing filesystem (ZFS) returns that it supports very large
(LLONG_MAX) object sizes, that should be correctly supported.  This
fixes the check for unitialized stripe_maxbytes in
lsm_unpackmd_common(), so that ZFS can return LLONG_MAX and it will be
okay. This issue is excersized by writing to or past the 2TB boundry
of a singly stripped file.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7890
Reviewed-on: http://review.whamcloud.com/19066
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>
7 years agostaging: lustre: lmv: assume a real connection in lmv_connect()
John L. Hammond [Wed, 26 Jul 2017 15:22:22 +0000 (11:22 -0400)]
staging: lustre: lmv: assume a real connection in lmv_connect()

Assume a real connection in lmv_connect(). Mark OBD_CONNECT_REAL
obsolete. Remove the then unnecessary refcount and exp members of
struct lmv_obd. Remove calls to lmv_check_connect(). Disconnect the
export in the appropriate error path of lmv_connect().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7669
Reviewed-on: http://review.whamcloud.com/18018
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lov: remove unused code
John L. Hammond [Wed, 26 Jul 2017 15:22:21 +0000 (11:22 -0400)]
staging: lustre: lov: remove unused code

Remove:
  the tested but never set flag OBD_STATFS_PTLRPCD,
  the empty file lustre/lov/lovsub_io.c,
  the unused ld_emerg member of struct lov_device,
  the unused struct lov_device_emerg and supporting functions,
  the unused struct lov_lock_link and supporting functions, and
  the unused, get only, or set only members of struct
  lovsub_device, lovsub_lock, lov_sublock_env, lov_thread_info,
  lov_io_sub, lov_io, lov_request, and lov_request_set.
Reduce the scope of several functions from lov_request.c.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5814
Reviewed-on: http://review.whamcloud.com/14878
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Ben Evans <bevans@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>
7 years agostaging: lustre: lov: fix 'control flow' error in lov_io_init_released
Sebastien Buisson [Wed, 26 Jul 2017 15:22:20 +0000 (11:22 -0400)]
staging: lustre: lov: fix 'control flow' error in lov_io_init_released

Fix "control flow" issues found by Coverity version 6.6.1:
Logically dead code (DEADCODE)
Execution cannot reach this statement.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4048
Reviewed-on: http://review.whamcloud.com/7824
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.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>
7 years agostaging: lustre: ldlm: crash on umount in cleanup_resource
Andriy Skulysh [Wed, 26 Jul 2017 15:22:19 +0000 (11:22 -0400)]
staging: lustre: ldlm: crash on umount in cleanup_resource

cfs_hash_for_each_relax() assumes that cfs_hash_put_locked()
doesn't release bd lock, but it isn't true for
ldlm_res_hop_put_locked().

Add recfcount on next hnode in cfs_hash_for_each_relax() and
remove ldlm_res_hop_put_locked()

Signed-off-by: Andriy Skulysh <andriy.skulysh@seagate.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6304
Xyratex-bug-id: MRP-2352
Reviewed-by: Vitaly Fertman <vitaly.fertman@seagate.com>
Reviewed-by: Alexander Boyko <alexander.boyko@seagate.com>
Tested-by: Alexander Lezhoev <alexander.lezhoev@seagate.com>
Reviewed-on: http://review.whamcloud.com/13908
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>
7 years agostaging: lustre: ldlm: restore missing newlines in ldlm sysfs files
John L. Hammond [Wed, 26 Jul 2017 15:22:18 +0000 (11:22 -0400)]
staging: lustre: ldlm: restore missing newlines in ldlm sysfs files

Restore the missing trailing newlines in
/sys/fs/lustre/ldlm/namespaces/*/lru_{max_age,size}.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9109
Reviewed-on: https://review.whamcloud.com/25522
Reviewed-by: James Simmons <uja.ornl@yahoo.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>
7 years agostaging: lustre: osc: soft lock - osc_makes_rpc()
Bobi Jam [Wed, 26 Jul 2017 15:22:17 +0000 (11:22 -0400)]
staging: lustre: osc: soft lock - osc_makes_rpc()

It is possible that an osc_extent contains more than 256 chunks, and
the IO engine won't add this extent in one RPC
(try_to_add_extent_for_io) so that osc_check_rpcs() run into a loop
upon this extent and never break.

This patch changes osc_max_write_chunks() to make sure the value
can cover all possible osc_extent, so that all osc_extent will be
added into one RPC.

This patch also add another field erd_max_extents in extent_rpc_data
to make sure not to add too many fragments in a single RPC.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8680
Reviewed-on: http://review.whamcloud.com/23326
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@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>
7 years agostaging: lustre: lov: refactor lov_object_fiemap()
Bobi Jam [Wed, 26 Jul 2017 15:37:59 +0000 (11:37 -0400)]
staging: lustre: lov: refactor lov_object_fiemap()

Add fiemap_for_stripe() to get file map extent from each stripe
device.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8773
Reviewed-on: https://review.whamcloud.com/23461
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
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>
7 years agostaging: lustre: lov: use u64 instead of loff_t in lov_object_fiemap()
Bobi Jam [Wed, 26 Jul 2017 15:37:58 +0000 (11:37 -0400)]
staging: lustre: lov: use u64 instead of loff_t in lov_object_fiemap()

Change loff_t to u64 in lov_object_fiemap() since loff_t is a signed
value type.

Otherwise there could be an overflow in
drivers/staging/lustre/lustre/lov/lov_object.c:1241 lov_object_fiemap()
warn: signed overflow undefined. 'fm_start + fm_length < fm_start'

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8773
Reviewed-on: https://review.whamcloud.com/23461
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
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>
7 years agostaging: lustre: obdclass: linux: constify attribute_group structures.
Arvind Yadav [Fri, 21 Jul 2017 05:59:53 +0000 (11:29 +0530)]
staging: lustre: obdclass: linux: constify attribute_group structures.

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: constify attribute_group structures.
Arvind Yadav [Fri, 21 Jul 2017 05:59:52 +0000 (11:29 +0530)]
staging: lustre: ldlm: constify attribute_group structures.

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: constify attribute_group structures.
Arvind Yadav [Fri, 21 Jul 2017 05:59:51 +0000 (11:29 +0530)]
staging: lustre: constify attribute_group structures.

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text    data     bss     dec     hex filename
   9489     992      40   10521    2919 lustre/lustre/osc/lproc_osc.o
   1289     288       0    1577     629 lustre/lustre/lmv/lproc_lmv.o
   3794     928      40    4762    129a lustre/lustre/lov/lproc_lov.o
   3802     576      40    4418    1142 lustre/lustre/mdc/lproc_mdc.o

File size After adding 'const':
   text    data     bss     dec     hex filename
   9553     928      40   10521    2919 lustre/lustre/osc/lproc_osc.o
   1353     224       0    1577     629 lustre/lustre/lmv/lproc_lmv.o
   3858     864      40    4762    129a lustre/lustre/lov/lproc_lov.o
   3866     512      40    4418    1142 lustre/lustre/mdc/lproc_mdc.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: fix incorrect arguments order calling lstcon_session_new
Colin Ian King [Wed, 19 Jul 2017 16:20:36 +0000 (17:20 +0100)]
staging: lustre: lnet: fix incorrect arguments order calling lstcon_session_new

The arguments args->lstio_ses_force and args->lstio_ses_timeout are
in the incorrect order. Fix this by swapping them around.

Detected by CoverityScan, CID#1226833 ("Arguments in wrong order")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: ni_mio_common.c: fix coding style issue
Christopher MÃ¥rtensson [Sun, 23 Jul 2017 11:05:09 +0000 (13:05 +0200)]
staging: comedi: ni_mio_common.c: fix coding style issue

"checkpatch.pl -f ..." gave
ERROR: open brace '{' following function definitions go on the next line

Signed-off-by: Christopher MÃ¥rtensson <cribalik@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: Convert to using %pOF instead of full_name
Rob Herring [Tue, 18 Jul 2017 21:43:33 +0000 (16:43 -0500)]
staging: fsl-mc: Convert to using %pOF instead of full_name

Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Stuart Yoder <stuyoder@gmail.com>
Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agogreybus: usb: constify hc_driver structures
Julia Lawall [Fri, 28 Jul 2017 20:41:57 +0000 (22:41 +0200)]
greybus: usb: constify hc_driver structures

The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: array underflow in fbtft_request_gpios_match()
Dan Carpenter [Tue, 18 Jul 2017 09:30:10 +0000 (12:30 +0300)]
staging: fbtft: array underflow in fbtft_request_gpios_match()

"val" can be negative, so we'd write before the start of the
par->gpio.db[] array.

Fixes: c296d5f9957c ("staging: fbtft: core support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: gs_fpgaboot: return valid error codes
Jacob von Chorus [Fri, 28 Jul 2017 21:06:18 +0000 (17:06 -0400)]
staging: gs_fpgaboot: return valid error codes

The return values on error are modified to be valid error codes. Theses
error codes are propagated back to the init function's return.

Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: gs_fpgaboot: change char to u8
Jacob von Chorus [Fri, 28 Jul 2017 21:06:17 +0000 (17:06 -0400)]
staging: gs_fpgaboot: change char to u8

The bitstream storage variables were changed from char to u8 arrays to
prevent issues such as negative lengths. This change makes the code
compatible with the "data" field in "struct firmware" which is of type
u8.

Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: gs_fpgaboot: add buffer overflow checks
Jacob von Chorus [Fri, 28 Jul 2017 21:06:16 +0000 (17:06 -0400)]
staging: gs_fpgaboot: add buffer overflow checks

Four fields in struct fpgaimage are char arrays of length MAX_STR (256).
The amount of data read into these buffers is controlled by a length
field in the bitstream file read from userspace. If a corrupt or
malicious firmware file was supplied, kernel data beyond these buffers
can be overwritten arbitrarily.

This patch adds a check of the bitstream's length value to ensure it
fits within the bounds of the allocated buffers. An error condition is
returned from gs_read_bitstream if any of the reads fail.

Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: skein: move macros into header file
Dmytro Shynkevych [Fri, 28 Jul 2017 19:56:59 +0000 (22:56 +0300)]
staging: skein: move macros into header file

Move macro definitions from source file into respective header file

This concludes macro cleanup as outlined in TODO

Signed-off-by: Dmytro Shynkevych <dm.shynk@gmail.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vboxvideo: make a couple of symbols static
Colin Ian King [Wed, 19 Jul 2017 09:36:16 +0000 (10:36 +0100)]
staging: vboxvideo: make a couple of symbols static

Module parameter vbox_modeset and structure vbox_bo_driver do not need to
be in global scope and hence can be made static.

Cleans up a couple of sparse warnings:
symbol 'vbox_modeset' was not declared. Should it be static?
symbol 'vbox_bo_driver' was not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Michael Thayer <michael.thayer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vboxvideo: remove unused variables
Paolo Cretaro [Sat, 22 Jul 2017 10:55:53 +0000 (12:55 +0200)]
staging: vboxvideo: remove unused variables

Fix compiler warnings:
vbox_mode.c:57:15: warning: variable â€˜crtc_id’ set but not used
vbox_mode.c:581:25: warning: variable â€˜vbox_connector’ set but not used

Signed-off-by: Paolo Cretaro <paolocretaro@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Michael Thayer <michael.thayer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vboxvideo: Kconfig: Fix typos in help text
Martin Kepplinger [Mon, 24 Jul 2017 08:30:44 +0000 (10:30 +0200)]
staging: vboxvideo: Kconfig: Fix typos in help text

This fixes typos in vboxvideo's help text. Most notably, "to builtin
this module" becomes "to build this driver built-in to the kernel".

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vboxvideo: select GENERIC_ALLOCATOR
Hans de Goede [Tue, 25 Jul 2017 08:50:46 +0000 (10:50 +0200)]
staging: vboxvideo: select GENERIC_ALLOCATOR

The vboxvideo code uses various gen_pool_* functions, so it needs
lib/genalloc.c to be built. In some configs this is not happening,
so add select GENERIC_ALLOCATOR to the Kconfig file to enforce this.

Note all other Kconfig references to GENERIC_ALLOCATOR also use select.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: pi433: use div_u64 for 64-bit division
Arnd Bergmann [Fri, 28 Jul 2017 13:23:12 +0000 (15:23 +0200)]
staging: pi433: use div_u64 for 64-bit division

I ran into this link error on an ARM OABI build:

drivers/staging/pi433/rf69.o: In function `rf69_set_frequency':
rf69.c:(.text+0xc9c): undefined reference to `__udivdi3'

No idea why I didn't see it with the default EABI configurations,
but the right solution here seems to be to use div_u64()
to get the external division implementation.

Fixes: 874bcba65f9a ("staging: pi433: New driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: pi433: Style fix - align block comments
Derek Robson [Sat, 22 Jul 2017 03:50:50 +0000 (15:50 +1200)]
staging: pi433: Style fix - align block comments

Fixed the alignment of block comments
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: pi433: Make functions rf69_set_bandwidth_intern static
Colin Ian King [Tue, 18 Jul 2017 13:03:59 +0000 (14:03 +0100)]
staging: pi433: Make functions rf69_set_bandwidth_intern static

The function rf69_set_bandwidth_intern is local to the source
and do not need to be in global scope, so make it static. Also
break overly wide line.

Cleans up sparse warning:
symbol 'update_share_count' was not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: pi433: check error after kthread_run()
Joseph Wright [Sun, 16 Jul 2017 14:48:58 +0000 (14:48 +0000)]
Staging: pi433: check error after kthread_run()

Error should be checked with IS_ERR after calling kthread_run()
instead of comparing the returned pointer to an int.

Found by sparse warning:

incompatible types for operation (<)
    left side has type struct task_struct *tx_task_struct
    right side has type int

Signed-off-by: Joseph Wright <rjosephwright@gmail.com>
Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Tested-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: pi433: declare functions static
Joseph Wright [Sun, 16 Jul 2017 14:48:57 +0000 (14:48 +0000)]
Staging: pi433: declare functions static

Declare functions static to fix sparse warnings:

warning: symbol 'pi433_receive' was not declared. Should it be static?
warning: symbol 'pi433_tx_thread' was not declared. Should it be static?

Signed-off-by: Joseph Wright <rjosephwright@gmail.com>
Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: pi433: depends on SPI
Randy Dunlap [Wed, 19 Jul 2017 23:58:28 +0000 (16:58 -0700)]
staging: pi433: depends on SPI

The pi433 driver uses SPI interfaces so it should depend on SPI.
Also, the "default n" can be removed since that is already the
default.

Fixes these build errors when SPI is not enabled:

drivers/staging/pi433/pi433_if.o: In function `pi433_probe':
pi433_if.c:(.text+0x1135): undefined reference to `spi_setup'
pi433_if.c:(.text+0x1177): undefined reference to `spi_write_then_read'
drivers/staging/pi433/pi433_if.o: In function `pi433_init':
pi433_if.c:(.init.text+0xb8): undefined reference to `__spi_register_driver'
drivers/staging/pi433/rf69.o: In function `rf69_read_fifo':
rf69.c:(.text+0x102): undefined reference to `spi_sync'
drivers/staging/pi433/rf69.o: In function `rf69_write_fifo':
rf69.c:(.text+0x248): undefined reference to `spi_sync'
drivers/staging/pi433/rf69.o: In function `rf69_read_reg':
rf69.c:(.text+0x290): undefined reference to `spi_write_then_read'
drivers/staging/pi433/rf69.o: In function `rf69_write_reg':
rf69.c:(.text+0x523): undefined reference to `spi_sync'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: pi433: return -EFAULT if copy_to_user() fails
dan.carpenter@oracle.com [Wed, 19 Jul 2017 09:51:40 +0000 (12:51 +0300)]
staging: pi433: return -EFAULT if copy_to_user() fails

copy_to_user() to user returns the number of bytes that weren't copied,
but we should be returning -EFAULT to the user.

Fixes: 874bcba65f9a ("staging: pi433: New driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: Fix unnecessary NULL check before kfree'ing it
Suniel Mahesh [Thu, 20 Jul 2017 13:37:07 +0000 (19:07 +0530)]
staging: ccree: Fix unnecessary NULL check before kfree'ing it

kfree(NULL) is safe and their is no need for a NULL check. Pointed out
by checkpatch.

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Acked-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: remove func name from log messages
Gilad Ben-Yossef [Thu, 27 Jul 2017 10:43:17 +0000 (13:43 +0300)]
staging: ccree: remove func name from log messages

The SSI_LOG macros already add __func__ to log messages, so remove
log message that add them a second time in the log message itself.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: Fix alignment issues in ssi_request_mgr.c
Simon Sandström [Tue, 18 Jul 2017 20:03:57 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_request_mgr.c

Fixes checkpatch.pl alignment warnings.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: Fix alignment issues in ssi_ivgen.c
Simon Sandström [Tue, 18 Jul 2017 20:03:56 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_ivgen.c

Fixes checkpatch.pl alignment warnings.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: Fix alignment issues in ssi_cipher.c
Simon Sandström [Tue, 18 Jul 2017 20:03:55 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_cipher.c

Fixes checkpatch.pl alignment warnings.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: Fix alignment issues in ssi_buffer_mgr.c
Simon Sandström [Tue, 18 Jul 2017 20:03:54 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_buffer_mgr.c

Fixes checkpatch.pl alignment warnings.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: Fix alignment issues in ssi_hash.c
Simon Sandström [Tue, 18 Jul 2017 20:03:53 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_hash.c

Fixes checkpatch.pl alignment warnings.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: Fix alignment issues in ssi_aead.c
Simon Sandström [Tue, 18 Jul 2017 20:03:52 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_aead.c

Fixes checkpatch.pl alignment warnings.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: rtl8188eu: core: fix brace coding style issue in rtw_mlme_ext.c
Armin Schoenlieb [Tue, 25 Jul 2017 19:14:26 +0000 (21:14 +0200)]
Staging: rtl8188eu: core: fix brace coding style issue in rtw_mlme_ext.c

This is a patch to the rtw_mlme_ext.c file that fixes up a brace error
found by the checkpatch.pl tool

Signed-off-by: Armin Schoenlieb <armetallica@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: fix spelling mistake: "Senondary" -> "Secondary"
Colin Ian King [Mon, 24 Jul 2017 21:48:42 +0000 (22:48 +0100)]
staging: rtl8192u: fix spelling mistake: "Senondary" -> "Secondary"

Trivial fix to spelling mistake in IEEE80211_DEBUG message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: fix incorrect mask and shift on u8 data
Colin Ian King [Fri, 21 Jul 2017 13:42:52 +0000 (14:42 +0100)]
staging: rtl8192u: fix incorrect mask and shift on u8 data

The cfg_action bit comes from the high bit of pmsg[4] so the
current mask and shift are in correct and always result in
zero.  Fix this by using the correct mask and shif to get the
correct cfg_action bit value.

Detected by CoverityScan, CID#142890 ("Operands don't affect result")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: Move { after function to new line
Munir Contractor [Thu, 20 Jul 2017 01:41:25 +0000 (21:41 -0400)]
staging: rtl8188eu: Move { after function to new line

Fix an error detected by checkpatch.pl on line 75 and move the opening
brace after the function signature to a new line.

Signed-off-by: Munir Contractor <munircontractor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: Fix coding style issue for column width
Deb McLemore [Wed, 26 Jul 2017 22:13:30 +0000 (17:13 -0500)]
staging: greybus: Fix coding style issue for column width

checkpatch.pl line over 80 characters so fix the formatting
for coding style compliance.

Signed-off-by: Deb McLemore <debmc@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: Remove unnecessary platform_set_drvdata
Amitoj Kaur Chawla [Thu, 27 Jul 2017 03:19:07 +0000 (23:19 -0400)]
staging: greybus: Remove unnecessary platform_set_drvdata

Unnecessary platform_set_drvdata() has been removed since the driver
core clears the driver data to NULL after device release or on
probe failure. There is no need to manually clear the device
driver data to NULL.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@@
struct platform_device *pdev;
@@
- platform_set_drvdata(pdev, NULL);
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: fix parenthesis alignments
Diwakar Sharma [Sun, 23 Jul 2017 17:51:46 +0000 (23:21 +0530)]
staging: greybus: fix parenthesis alignments

Parenthesis alignment issues reported by checkpatch,
fixed here.

Signed-off-by: Diwakar Sharma <sharmalxmail@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Constify attribute_group structures.
Arvind Yadav [Tue, 18 Jul 2017 08:10:54 +0000 (13:40 +0530)]
staging: unisys: visorbus: Constify attribute_group structures.

attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoMerge tag 'iio-for-4.14a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Fri, 28 Jul 2017 04:29:49 +0000 (21:29 -0700)]
Merge tag 'iio-for-4.14a' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First round of IIO new device support, features and cleanups for the 4.14 cycle.

4 completely new drivers in this set and plenty of other stuff.

One ABI change due to a silly mistake a long time back. Hopefully no
one will notice.  It effects the numerical order of consumer device
channels which was the reverse of the obvious.  It's going the slow
way to allow us some margin to spot if we have broken userspace or
not (seems unlikely)

New Device Support
* ccs811
  - new driver for the Volatile Organic Compounds (VOC) sensor.
* dln2 adc
  - new driver for the ADC on this flexible usb board.
* EP93xx
  - new driver for this Cirrus logic SoC ADC.
* ltc2471
  - new ADC driver support the ltc2471 and ltc2473
* st_accel
  - add trivial table entries to support H3LIS331DL, LIS331DL, LIS3LV02DL.
* st_gyro
  - add L3GD20H support (again) having fixed the various things that were
    broken in the first try.  Includes devicetree binding.
* stm32 dac
  - add support for the DACs in the STM32F4 series

Features
* Documentation
  - add missing power attribute documentation to the ABI docs.
* at91-sama5d2
  - add hardware trigger and buffered capture support with bindings.
  - suspend and resume functionality.
* bmc150
  - support for the BOSC0200 ACPI device id seen on some tablets.
* hdc100x
  - devicetree bindings
  - document supported devices
  - match table and device ids.
* hts221
  - support active low interrupts (with bindings)
  - open drain mode with bindings.
* htu21
  - OF match table and bindings.
* lsm6dsx
  - open drain mode with bindings
* ltc2497
  - add support for board file based consumer mapping.
* ms5367
  - OF match table and bindings.
* mt7622
  - binding document and OF match table.
  - suspend and resume support.
* rpr0521
  - triggered buffer support.
* tsys01
  - OF match table and bindings.

Cleanups and minor fixes
* core
  - fix ordering of IIO channels to entry numbers when using
    iio_map_array_register rather than reversing them.
  - use the new %pOF format specifier rather than full name for the
    device tree nodes.
* ad7280a
  - fix potential issue with macro argument reuse.
* ad7766
  - drop a pointless NULL value check as it's done in the gpiod code.
* adis16400
  - unsigned -> unsigned int.
* at91 adc
  - make some init data static to reduce code size.
* at91-sama5d2 ADC
  - make some init data static to reduce code size.
* da311
  - make some init data static to reduce code size.
* hid-sensor-rotation
  - drop an unnecessary static.
* hts221
  - refactor the write_with_mask code.
  - move the BDU configuration to probe time as there is no reason for it
    to change.
  - avoid overwriting reserved data during power-down.  This is a fix, but
    the infrastructure need was too invasive to send it to mainline except
    in a merge window.  It's not a regression as it was always wrong.
  - avoid reconfigure the sampling frequency multiple times by just
    doing it in the write_raw function directly.
  - refactor the power_on/off calls into a set_enable.
  - move the dry-enable logic into trig_set_state as that is the only
    place it was used.
* ina219
  - fix polling of ina226 conversion ready flag.
* imx7d
  - add vendor name in kconfig for consistency with similar parts.
* mcp3422
  - Change initial channel to 0 as it feels more logical.
  - Check for some errors in probe.
* meson-saradc
  - add a check of of_match_device return value.
* mpu3050
  - allow open drain for any interrupt type.
* rockchip adc
  - add check on of_match_device return value.
* sca3000
  - drop a trailing whitespace.
* stm32 adc
  - make array stm32h7_adc_ckmodes_spec static.
* stm32 dac
  - fix an error message.
* stm32 timers
  - fix clock name in docs to match reality after changes.
* st_accel
  - explicit OF table (spi).
  - add missing entries to OF table (i2c).
  - rename of_device_id table to drop the part name.
  - adding missing lis3l02dq entry to bindings.
  - rename H3LIS331DL_DRIVER_NAME to line up with similar entries in driver.
* st_gyro
  - explicit OF table (spi).
* st_magn
  - explicit OF table (spi).
  - enable multiread for lis3mdl.
* st_pressure
  - explicit OF table (spi).
* st_sensors common.
  - move st_sensors_of_i2c_probe and rename to make it available for spi
  drivers.
* tsc3472
  - don't write an extra byte when writing the ATIME register.
  - add a link to the datasheet.
* tsl2x7x - continued staging cleanups
  - add of_match_table.
  - drop redundant power_state sysfs attribute.
  - drop wrapper tsl2x7x_i2c_read.
  - clean up i2c calls made in tsl2x7x_als_calibrate.
  - refactor the read and write _event_value callbacks to handle additional
    elements.
  - use usleep_range instead of mdelay.
  - check return value from tsl2x7x_invoke_change.
* zpa2326
  - add some newline to the end of logging macros.

7 years agoiio: humidity: hts221: move drdy enable logic in hts221_trig_set_state()
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:05 +0000 (19:39 +0200)]
iio: humidity: hts221: move drdy enable logic in hts221_trig_set_state()

Move data-ready configuration in hts221_buffer.c since it is only related
to trigger logic

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agodt-bindings: iio: humidity: hts221: support open drain mode
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:04 +0000 (19:39 +0200)]
dt-bindings: iio: humidity: hts221: support open drain mode

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: support open drain mode
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:03 +0000 (19:39 +0200)]
iio: humidity: hts221: support open drain mode

Add open drain support in order to share requested IRQ line between
hts221 device and other peripherals

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: adc: New driver for Cirrus Logic EP93xx ADC
Alexander Sverdlin [Mon, 24 Jul 2017 20:51:45 +0000 (22:51 +0200)]
iio: adc: New driver for Cirrus Logic EP93xx ADC

New driver adding support for ADC found on Cirrus Logic EP93xx series of SoCs.
Board specific code must take care to create plaform device with all necessary
resources.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoMerge 4.13-rc2 into staging-next
Greg Kroah-Hartman [Mon, 24 Jul 2017 02:53:30 +0000 (19:53 -0700)]
Merge 4.13-rc2 into staging-next

This resolves a merge issue and gets the vmbox drm driver into this
branch to be able to start taking fixes for it...

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoLinux 4.13-rc2
Linus Torvalds [Sun, 23 Jul 2017 23:15:17 +0000 (16:15 -0700)]
Linux 4.13-rc2

7 years agoProperly alphabetize MAINTAINERS file
Linus Torvalds [Sun, 23 Jul 2017 23:06:21 +0000 (16:06 -0700)]
Properly alphabetize MAINTAINERS file

This adds a perl script to actually parse the MAINTAINERS file, clean up
some whitespace in it, warn about errors in it, and then properly sort
the end result.

My perl-fu is atrocious, so the script has basically been created by
randomly putting various characters in a pile, mixing them around, and
then looking it the end result does anything interesting when used as a
perl script.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7 years agoFix up MAINTAINERS file problems
Linus Torvalds [Sun, 23 Jul 2017 22:08:05 +0000 (15:08 -0700)]
Fix up MAINTAINERS file problems

Prepping for scripting the MAINTAINERS file cleanup (and possible split)
showed a couple of cases where the headers for a couple of entries were
bogus.

There's a few different kinds of bogosities:

 - the X-GENE SOC EDAC case was confused and split over two lines

 - there were four entries for "GREYBUS PROTOCOLS DRIVERS" that were all
   different things.

 - the NOKIA N900 CAMERA SUPPORT" was duplicated

all of which were more obvious when you started doing associative arrays
in perl to track these things by the header (so that we can alphabetize
this thing properly, and so that we might split it up by the data too).

Cc: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7 years agoMerge tag 'for-linus-4.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 23 Jul 2017 18:22:45 +0000 (11:22 -0700)]
Merge tag 'for-linus-4.13b-rc2-tag' of git://git./linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:
 "Some fixes and cleanups for running under Xen"

* tag 'for-linus-4.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen/balloon: don't online new memory initially
  xen/x86: fix cpu hotplug
  xen/grant-table: log the lack of grants
  xen/x86: Don't BUG on CPU0 offlining

7 years agoxen/balloon: don't online new memory initially
Juergen Gross [Mon, 10 Jul 2017 08:10:45 +0000 (10:10 +0200)]
xen/balloon: don't online new memory initially

When setting up the Xenstore watch for the memory target size the new
watch will fire at once. Don't try to reach the configured target size
by onlining new memory in this case, as the current memory size will
be smaller in almost all cases due to e.g. BIOS reserved pages.

Onlining new memory will lead to more problems e.g. undesired conflicts
with NVMe devices meant to be operated as block devices.

Instead remember the difference between target size and current size
when the watch fires for the first time and apply it to any further
size changes, too.

In order to avoid races between balloon.c and xen-balloon.c init calls
do the xen-balloon.c initialization from balloon.c.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
7 years agoxen/x86: fix cpu hotplug
Juergen Gross [Wed, 5 Jul 2017 14:05:20 +0000 (16:05 +0200)]
xen/x86: fix cpu hotplug

Commit dc6416f1d711eb4c1726e845d653235dcaae12e1 ("xen/x86: Call
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE) from xen_play_dead()")
introduced an error leading to a stack overflow of the idle task when
a cpu was brought offline/online many times: by calling
cpu_startup_entry() instead of returning at the end of xen_play_dead()
do_idle() would be entered again and again.

Don't use cpu_startup_entry(), but cpuhp_online_idle() instead allowing
to return from xen_play_dead().

Cc: <stable@vger.kernel.org> # 4.12
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
7 years agoxen/grant-table: log the lack of grants
Wengang Wang [Tue, 18 Jul 2017 07:40:35 +0000 (09:40 +0200)]
xen/grant-table: log the lack of grants

log a message when we enter this situation:
1) we already allocated the max number of available grants from hypervisor
and
2) we still need more (but the request fails because of 1)).

Sometimes the lack of grants causes IO hangs in xen_blkfront devices.
Adding this log would help debuging.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
7 years agoxen/x86: Don't BUG on CPU0 offlining
Vitaly Kuznetsov [Mon, 26 Jun 2017 16:39:30 +0000 (18:39 +0200)]
xen/x86: Don't BUG on CPU0 offlining

CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests
BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a
leftover from ancient times when CPU0 hotplug was impossible, it works
just fine for HVM.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
7 years agoiio: Convert to using %pOF instead of full_name
Rob Herring [Tue, 18 Jul 2017 21:43:08 +0000 (16:43 -0500)]
iio: Convert to using %pOF instead of full_name

Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Carlo Caione <carlo@caione.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: linux-iio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoStaging: iio: adc: ad7280a.c: Fixed Macro argument reuse
Jaya Durga [Wed, 19 Jul 2017 12:25:57 +0000 (17:55 +0530)]
Staging: iio: adc: ad7280a.c: Fixed Macro argument reuse

CHECK: Macro argument reuse 'addr' - possible side-effects?

convert AD7280A_DEVADDR to ad7280a_devaddr static function
to fix checkpath check

v3: small style changes

Signed-off-by: Jaya Durga <rjdurga@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agodt-bindings: iio: humidity: hts221: support active-low interrupts
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:02 +0000 (19:39 +0200)]
dt-bindings: iio: humidity: hts221: support active-low interrupts

Update hts221 device binding with active-low interrupts support
(IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING).

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: support active-low interrupts
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:01 +0000 (19:39 +0200)]
iio: humidity: hts221: support active-low interrupts

Add support for active low interrupts (IRQF_TRIGGER_LOW and
IRQF_TRIGGER_FALLING). Configure the device as active high or low
according to the requested irq line.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: squash hts221_power_on/off in hts221_set_enable
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:00 +0000 (19:39 +0200)]
iio: humidity: hts221: squash hts221_power_on/off in hts221_set_enable

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: avoid useless ODR reconfiguration
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:59 +0000 (19:38 +0200)]
iio: humidity: hts221: avoid useless ODR reconfiguration

Configure sensor ODR just in hts221_write_raw() in order to avoid
to set device sample rate multiple times.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: do not overwrite reserved data during power-down
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:58 +0000 (19:38 +0200)]
iio: humidity: hts221: do not overwrite reserved data during power-down

GENMASK(6, 3) in CTRL_REG1 and GENMASK(6, 2) in CTRL_REG2 are marked
reserved. Do not changed the original value (not declared in the
datasheet) during power-down/suspend routines.

Fixes: e4a70e3e7d84 (iio: humidity: add support to hts221 rh/temp device)
Fixes: b7079eeac5da (iio: humidity: hts221: add power management support)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: move BDU configuration in probe routine
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:57 +0000 (19:38 +0200)]
iio: humidity: hts221: move BDU configuration in probe routine

Enable Block Data Update in hts221_probe() in order to avoid to reconfigure
it every time the sensor is enabled

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: refactor write_with_mask code
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:56 +0000 (19:38 +0200)]
iio: humidity: hts221: refactor write_with_mask code

Move bit-shift in hts221_write_with_mask() instead of coding
the shift depth in the configured value. That change will be necessary
to fix an issue in device power-down procedure.
Simplify hts221_avg_list table management

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: chemical: ccs811: Add support for AMS CCS811 VOC sensor
Narcisa Ana Maria Vasile [Mon, 17 Jul 2017 19:28:03 +0000 (22:28 +0300)]
iio: chemical: ccs811: Add support for AMS CCS811 VOC sensor

Add support for CCS811 VOC sensor. This patch adds support
for reading current and voltage across the sensor and TVOC
and equivalent CO2 values.

Scale and offset values have been computed according to datasheet:
    - For current: raw value is in microamps
        => 0.001 scale to convert to milliamps
    - For voltage: 1.65V = 1023, therefore 1650mV = 1023
        => 1650.0/1023 = 1.612903 scale to convert to millivolts
    - For eCO2: raw value range is from 400ppm to 8192ppm.
        => (val - 400) * (100 - 0) / (8192 - 400) + 0 =
           (val - 400) * 0.01283367 => offset: -400, scale = 0.012834
           to get a percentage value
    -For TVOC: raw value range is from 0ppb to 1187ppb.
        => (val - 0) * 100 / (1187 - 0) + 0 = val * 0.0842459 =>
            scale = 0.084246 for getting a percentage value

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoMerge tag 'hwmon-for-linus-v4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 22 Jul 2017 16:25:00 +0000 (09:25 -0700)]
Merge tag 'hwmon-for-linus-v4.13-rc2' of git://git./linux/kernel/git/groeck/linux-staging

Pull hwmon fix from Guenter Roeck:
 "Avoid buffer overruns in applesmc driver"

* tag 'hwmon-for-linus-v4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (applesmc) Avoid buffer overruns

7 years agoMerge tag 'tty-4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Sat, 22 Jul 2017 16:00:24 +0000 (09:00 -0700)]
Merge tag 'tty-4.13-rc2' of git://git./linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
 "Here are some small tty and serial driver fixes for 4.13-rc2. Nothing
  huge at all, a revert of a patch that turned out to break things, a
  fix up for a new tty ioctl we added in 4.13-rc1 to get the uapi
  definition correct, and a few minor serial driver fixes for reported
  issues.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'tty-4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  tty: Fix TIOCGPTPEER ioctl definition
  tty: hide unused pty_get_peer function
  tty: serial: lpuart: Fix the logic for detecting the 32-bit type UART
  serial: imx: Prevent TX buffer PIO write when a DMA has been started
  Revert "serial: imx-serial - move DMA buffer configuration to DT"
  serial: sh-sci: Uninitialized variables in sysfs files
  serial: st-asc: Potential error pointer dereference

7 years agoMerge tag 'char-misc-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
Linus Torvalds [Sat, 22 Jul 2017 15:57:24 +0000 (08:57 -0700)]
Merge tag 'char-misc-4.13-rc1' of git://git./linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
 "Here are some small char and misc driver fixes for 4.13-rc2. All fix
  reported problems with 4.13-rc1 or older kernels (like the binder
  fixes). Full details in the shortlog.

  All have been in linux-next with no reported issues"

* tag 'char-misc-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  w1: omap-hdq: fix error return code in omap_hdq_probe()
  regmap: regmap-w1: Fix build troubles
  w1: Fix slave count on 1-Wire bus (resend)
  mux: mux-core: unregister mux_class in mux_exit()
  mux: remove the Kconfig question for the subsystem
  nvmem: rockchip-efuse: amend compatible rk322x-efuse to rk3228-efuse
  drivers/fsi: fix fsi_slave_mode prototype
  fsi: core: register with postcore_initcall
  thunderbolt: Correct access permissions for active NVM contents
  vmbus: re-enable channel tasklet
  spmi: pmic-arb: Always allocate ppid_to_apid table
  MAINTAINERS: Add entry for SPMI subsystem
  spmi: Include OF based modalias in device uevent
  binder: Use wake up hint for synchronous transactions.
  binder: use group leader instead of open thread
  Revert "android: binder: Sanity check at binder ioctl"