platform/kernel/linux-starfive.git
4 years agoiio: accel: adxl372: Fix push to buffers lost samples
Stefan Popa [Tue, 10 Sep 2019 14:44:21 +0000 (17:44 +0300)]
iio: accel: adxl372: Fix push to buffers lost samples

One in two sample sets was lost by multiplying fifo_set_size with
sizeof(u16). Also, the double number of available samples were pushed to
the iio buffers.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Fixes: f4f55ce38e5f ("iio:adxl372: Add FIFO and interrupts support")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: accel: adxl372: Fix/remove limitation for FIFO samples
Stefan Popa [Tue, 10 Sep 2019 14:43:32 +0000 (17:43 +0300)]
iio: accel: adxl372: Fix/remove limitation for FIFO samples

Currently, the driver sets the FIFO_SAMPLES register with the number of
sample sets (maximum of 170 for 3 axis data, 256 for 2-axis and 512 for
single axis). However, the FIFO_SAMPLES register should store the number
of samples, regardless of how the FIFO format is configured.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Fixes: f4f55ce38e5f ("iio:adxl372: Add FIFO and interrupts support")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: hx711: fix bug in sampling of data
Andreas Klinger [Mon, 9 Sep 2019 12:37:21 +0000 (14:37 +0200)]
iio: adc: hx711: fix bug in sampling of data

Fix bug in sampling function hx711_cycle() when interrupt occures while
PD_SCK is high. If PD_SCK is high for at least 60 us power down mode of
the sensor is entered which in turn leads to a wrong measurement.

Switch off interrupts during a PD_SCK high period and move query of DOUT
to the latest point of time which is at the end of PD_SCK low period.

This bug exists in the driver since it's initial addition. The more
interrupts on the system the higher is the probability that it happens.

Fixes: c3b2fdd0ea7e ("iio: adc: hx711: Add IIO driver for AVIA HX711")
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: fix center temperature of bmc150-accel-core
Pascal Bouwmann [Thu, 29 Aug 2019 05:29:41 +0000 (07:29 +0200)]
iio: fix center temperature of bmc150-accel-core

The center temperature of the supported devices stored in the constant
BMC150_ACCEL_TEMP_CENTER_VAL is not 24 degrees but 23 degrees.

It seems that some datasheets were inconsistent on this value leading
to the error.  For most usecases will only make minor difference so
not queued for stable.

Signed-off-by: Pascal Bouwmann <bouwmann@tau-tec.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: forbid 0 sensor sensitivity
Lorenzo Bianconi [Sat, 31 Aug 2019 11:18:22 +0000 (13:18 +0200)]
iio: imu: st_lsm6dsx: forbid 0 sensor sensitivity

Do not allow configuring null sensor gain since it will force to 0
device outputs

Fixes: c8d4066c7246 ("iio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: meson_saradc: Fix memory allocation order
Remi Pommarel [Sun, 1 Sep 2019 10:54:10 +0000 (12:54 +0200)]
iio: adc: meson_saradc: Fix memory allocation order

meson_saradc's irq handler uses priv->regmap so make sure that it is
allocated before the irq get enabled.

This also fixes crash when CONFIG_DEBUG_SHIRQ is enabled, as device
managed resources are freed in the inverted order they had been
allocated, priv->regmap was freed before the spurious fake irq that
CONFIG_DEBUG_SHIRQ adds called the handler.

Fixes: 3af109131b7eb8 ("iio: adc: meson-saradc: switch from polling to interrupt mode")
Reported-by: Elie Roudninski <xademax@gmail.com>
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Elie ROUDNINSKI <xademax@gmail.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: rtl8723bs: hal: remove redundant variable n
Colin Ian King [Thu, 5 Sep 2019 15:22:27 +0000 (16:22 +0100)]
staging: rtl8723bs: hal: remove redundant variable n

The variable n is being assigned a value that is never read inside
an if statement block, the assignment is redundant and can be removed.
With this removed, n is only being used for a constant loop bounds
check, so replace n with that value instead and remove n completely.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190905152227.4610-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: pi433: Fix typo in documentation
Rohit Sarkar [Thu, 5 Sep 2019 13:22:19 +0000 (18:52 +0530)]
staging: pi433: Fix typo in documentation

Fixes a typo in the documentation.

Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
Link: https://lore.kernel.org/r/20190905132219.GA1004@SARKAR
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: stop using 32-bit time_t
Arnd Bergmann [Fri, 6 Sep 2019 15:09:05 +0000 (17:09 +0200)]
staging: exfat: stop using 32-bit time_t

time_t suffers from overflow problems and should not be used.

In exfat, it is currently used in two open-coded time64_to_tm()
implementations. Changes those to use the existing function instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20190906150917.1025250-2-arnd@arndb.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: stopusing CONFIG_FAT_DEFAULT_IOCHARSET
Arnd Bergmann [Fri, 6 Sep 2019 15:09:04 +0000 (17:09 +0200)]
staging: exfat: stopusing CONFIG_FAT_DEFAULT_IOCHARSET

When CONFIG_VFAT_FS is disabled, the reference to CONFIG_FAT_DEFAULT_IOCHARSET
causes a link failure:

drivers/staging/exfat/exfat_super.c:46:41: error: use of undeclared identifier 'CONFIG_FAT_DEFAULT_IOCHARSET'
static char exfat_default_iocharset[] = CONFIG_FAT_DEFAULT_IOCHARSET;

I could not figure out why the correct code is commented
out, but using that fixes the problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20190906150917.1025250-1-arnd@arndb.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoiio: hid-sensor-attributes: Fix divisions for 32-bit platforms
Andy Shevchenko [Thu, 5 Sep 2019 11:27:59 +0000 (14:27 +0300)]
iio: hid-sensor-attributes: Fix divisions for 32-bit platforms

The commit 473d12f7638c

  ("iio: hid-sensor-attributes: Convert to use int_pow()")

converted to use generic int_pow() helper. Though, the generic one returns
64-bit value and, in cases when it is used as divisor, it compels 64-bit
division from compiler.

In order to fix this, introduce a temporary 32-bit variable to hold the result
of int_pow() and use it as divisor afterwards.

In couple of cases, replace int_pow() with a predefined unit factors for time
and frequency.

Fixes: 473d12f7638c ("iio: hid-sensor-attributes: Convert to use int_pow()")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20190905112759.13035-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: use read_cache_page_gfp for erofs_get_meta_page
Gao Xiang [Wed, 4 Sep 2019 02:09:12 +0000 (10:09 +0800)]
erofs: use read_cache_page_gfp for erofs_get_meta_page

As Christoph said [1], "I'd much prefer to just use
read_cache_page_gfp, and live with the fact that this
allocates bufferheads behind you for now.  I'll try to
speed up my attempts to get rid of the buffer heads on
the block device mapping instead. "

This simplifies the code a lot and a minor thing is
"no REQ_META (e.g. for blktrace) on metadata at all..."

[1] https://lore.kernel.org/r/20190903153704.GA2201@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-26-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: always use iget5_locked
Gao Xiang [Wed, 4 Sep 2019 02:09:11 +0000 (10:09 +0800)]
erofs: always use iget5_locked

As Christoph said [1] [2], "Just use the slightly
more complicated 32-bit version everywhere so that
you have a single actually tested code path.
And then remove this helper. "

[1] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
[2] https://lore.kernel.org/r/20190902125320.GA16726@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-25-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: use read_mapping_page instead of sb_bread
Gao Xiang [Wed, 4 Sep 2019 02:09:10 +0000 (10:09 +0800)]
erofs: use read_mapping_page instead of sb_bread

As Christoph said [1], "This seems to be your only direct
use of buffer heads, which while not deprecated are a bit
of an ugly step child.  So if you can easily avoid creating
a buffer_head dependency in a new filesystem I think you
should avoid it. "

[1] https://lore.kernel.org/r/20190902125109.GA9826@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-24-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: rename errln/infoln/debugln to erofs_{err, info, dbg}
Gao Xiang [Wed, 4 Sep 2019 02:09:09 +0000 (10:09 +0800)]
erofs: rename errln/infoln/debugln to erofs_{err, info, dbg}

Add prefix "erofs_" to these functions and print
sb->s_id as a prefix to erofs_{err, info} so that
the user knows which file system is affected.

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-23-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: save one level of indentation
Gao Xiang [Wed, 4 Sep 2019 02:09:08 +0000 (10:09 +0800)]
erofs: save one level of indentation

As Christoph said [1], ".. and save one
level of indentation."

[1] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-22-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: kill use_vmap module parameter
Gao Xiang [Wed, 4 Sep 2019 02:09:07 +0000 (10:09 +0800)]
erofs: kill use_vmap module parameter

As Christoph said [1],
"vm_map_ram is supposed to generally behave better.  So if
it doesn't please report that that to the arch maintainer
and linux-mm so that they can look into the issue.  Having
user make choices of deep down kernel internals is just
a horrible interface.

Please talk to maintainers of other bits of the kernel
if you see issues and / or need enhancements. "

Let's redo the previous conclusion and kill the vmap
approach.

[1] https://lore.kernel.org/r/20190830165533.GA10909@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-21-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: kill all erofs specific fault injection
Gao Xiang [Wed, 4 Sep 2019 02:09:06 +0000 (10:09 +0800)]
erofs: kill all erofs specific fault injection

As Christoph suggested [1], "Please just use plain kmalloc
everywhere and let the normal kernel error injection code
take care of injeting any errors."

[1] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-20-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: add "erofs_" prefix for common and short functions
Gao Xiang [Wed, 4 Sep 2019 02:09:05 +0000 (10:09 +0800)]
erofs: add "erofs_" prefix for common and short functions

Add erofs_ prefix to free_inode, alloc_inode, ...

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-19-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: kill __submit_bio()
Gao Xiang [Wed, 4 Sep 2019 02:09:04 +0000 (10:09 +0800)]
erofs: kill __submit_bio()

As Christoph pointed out [1], "
Why is there __submit_bio which really just obsfucates
what is going on?  Also why is __submit_bio using
bio_set_op_attrs instead of opencode it as the comment
right next to it asks you to? "

Let's use submit_bio directly instead.

[1] https://lore.kernel.org/r/20190830162812.GA10694@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-18-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: kill prio and nofail of erofs_get_meta_page()
Gao Xiang [Wed, 4 Sep 2019 02:09:03 +0000 (10:09 +0800)]
erofs: kill prio and nofail of erofs_get_meta_page()

As Christoph pointed out [1],
"Why is there __erofs_get_meta_page with the two weird
booleans instead of a single erofs_get_meta_page that
gets and gfp_t for additional flags and an unsigned int
for additional bio op flags."

And since all callers can handle errors, let's kill
prio and nofail and erofs_get_inline_page() now.

[1] https://lore.kernel.org/r/20190830162812.GA10694@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-17-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: localize erofs_grab_bio()
Gao Xiang [Wed, 4 Sep 2019 02:09:02 +0000 (10:09 +0800)]
erofs: localize erofs_grab_bio()

As Christoph pointed out [1], "erofs_grab_bio tries to
handle a bio_alloc failure, except that the function will
not actually fail due the mempool backing it."

Sorry about useless code, fix it now and
localize erofs_grab_bio [2].

[1] https://lore.kernel.org/r/20190830162812.GA10694@infradead.org/
[2] https://lore.kernel.org/r/20190902122016.GL15931@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-16-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: kill verbose debug info in erofs_fill_super
Gao Xiang [Wed, 4 Sep 2019 02:09:01 +0000 (10:09 +0800)]
erofs: kill verbose debug info in erofs_fill_super

As Christoph said [1], "That is some very verbose
debug info.  We usually don't add that and let
people trace the function instead. "

[1] https://lore.kernel.org/r/20190829101545.GC20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-15-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: use dsb instead of layout for ondisk super_block
Gao Xiang [Wed, 4 Sep 2019 02:09:00 +0000 (10:09 +0800)]
erofs: use dsb instead of layout for ondisk super_block

As Christoph pointed out [1], "Why is the variable name
for the on-disk subperblock layout? We usually still
calls this something with sb in the name, e.g. dsb.
for disksuper block. " Let's fix it.

[1] https://lore.kernel.org/r/20190829101545.GC20598@infradead.org/
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-14-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: better erofs symlink stuffs
Gao Xiang [Wed, 4 Sep 2019 02:08:59 +0000 (10:08 +0800)]
erofs: better erofs symlink stuffs

Fix as Christoph suggested [1] [2], "remove is_inode_fast_symlink
and just opencode it in the few places using it"

and
"Please just set the ops directly instead of obsfucating that in
a single caller, single line inline function.  And please set it
instead of the normal symlink iops in the same place where you
also set those."

[1] https://lore.kernel.org/r/20190830163910.GB29603@infradead.org/
[2] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-13-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: update comments in inode.c
Gao Xiang [Wed, 4 Sep 2019 02:08:58 +0000 (10:08 +0800)]
erofs: update comments in inode.c

As Christoph suggested [1], update them all.

[1] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-12-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: update erofs_fs.h comments
Gao Xiang [Wed, 4 Sep 2019 02:08:57 +0000 (10:08 +0800)]
erofs: update erofs_fs.h comments

As Christoph said [1] [2], update it now.

[1] https://lore.kernel.org/r/20190902124521.GA22153@infradead.org/
[2] https://lore.kernel.org/r/20190902120548.GB15931@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-11-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: use erofs_inode naming
Gao Xiang [Wed, 4 Sep 2019 02:08:56 +0000 (10:08 +0800)]
erofs: use erofs_inode naming

As Christoph suggested [1], "Why is this called vnode instead
of inode?  That seems like a rather odd naming for a Linux
file system."

[1] https://lore.kernel.org/r/20190829101545.GC20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-10-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: kill erofs_{init,exit}_inode_cache
Gao Xiang [Wed, 4 Sep 2019 02:08:55 +0000 (10:08 +0800)]
erofs: kill erofs_{init,exit}_inode_cache

As Christoph said [1] "having this function seems
entirely pointless", let's kill those.

filesystem                              function name
ext2,f2fs,ext4,isofs,squashfs,cifs,...  init_inodecache

In addition, add a necessary "rcu_barrier()" on exit_fs();

[1] https://lore.kernel.org/r/20190829101545.GC20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-9-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: better naming for erofs inode related stuffs
Gao Xiang [Wed, 4 Sep 2019 02:08:54 +0000 (10:08 +0800)]
erofs: better naming for erofs inode related stuffs

updates inode naming
 - kill is_inode_layout_compression [1]
 - kill magic underscores [2] [3]
 - better naming for datamode & data_mapping_mode [3]
 - better naming erofs_inode_{compact, extended} [4]

[1] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
[2] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
[3] https://lore.kernel.org/r/20190902122627.GN15931@infradead.org/
[4] https://lore.kernel.org/r/20190902125438.GA17750@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-8-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: use feature_incompat rather than requirements
Gao Xiang [Wed, 4 Sep 2019 02:08:53 +0000 (10:08 +0800)]
erofs: use feature_incompat rather than requirements

As Christoph said [1], "This is only cosmetic, why
not stick to feature_compat and feature_incompat?"

In my thought, requirements means "incompatible"
instead of "feature" though.

[1] https://lore.kernel.org/r/20190902125109.GA9826@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-7-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: update erofs_inode_is_data_compressed helper
Gao Xiang [Wed, 4 Sep 2019 02:08:52 +0000 (10:08 +0800)]
erofs: update erofs_inode_is_data_compressed helper

As Christoph said, "This looks like a really obsfucated
way to write:
return datamode == EROFS_INODE_FLAT_COMPRESSION ||
datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY; "

Although I had my own consideration, it's the right way for now.

[1] https://lore.kernel.org/r/20190829095954.GB20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-6-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: kill __packed for on-disk structures
Gao Xiang [Wed, 4 Sep 2019 02:08:51 +0000 (10:08 +0800)]
erofs: kill __packed for on-disk structures

As Christoph suggested "Please don't add __packed" [1],
remove all __packed except struct erofs_dirent here.

Note that all on-disk fields except struct erofs_dirent
(12 bytes with a 8-byte nid) in EROFS are naturally aligned.

[1] https://lore.kernel.org/r/20190829095954.GB20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-5-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: some macros are much more readable as a function
Gao Xiang [Wed, 4 Sep 2019 02:08:50 +0000 (10:08 +0800)]
erofs: some macros are much more readable as a function

As Christoph suggested [1], these macros are much
more readable as a function.

[1] https://lore.kernel.org/r/20190829095954.GB20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-4-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: on-disk format should have explicitly assigned numbers
Gao Xiang [Wed, 4 Sep 2019 02:08:49 +0000 (10:08 +0800)]
erofs: on-disk format should have explicitly assigned numbers

As Christoph suggested [1], on-disk format should have
explicitly assigned numbers.

[1] https://lore.kernel.org/r/20190829095954.GB20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-3-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: remove all the byte offset comments
Gao Xiang [Wed, 4 Sep 2019 02:08:48 +0000 (10:08 +0800)]
erofs: remove all the byte offset comments

As Christoph suggested [1], "Please remove all the byte offset comments.
that is something that can easily be checked with gdb or pahole."

[1] https://lore.kernel.org/r/20190829095954.GB20598@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-2-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: Remove return statement from void function
Leandro Ribeiro [Wed, 4 Sep 2019 21:06:31 +0000 (21:06 +0000)]
staging: rtl8723bs: Remove return statement from void function

Fix the following checkpatch warning:

"WARNING: void function return statements are not generally useful"

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
Link: https://lore.kernel.org/r/20190904210631.13599-1-leandrohr@riseup.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8192e: remove unnecessary blank line
Beatriz Martins de Carvalho [Wed, 4 Sep 2019 21:03:26 +0000 (21:03 +0000)]
staging: rtl8192e: remove unnecessary blank line

Fix checkpath error "CHECK: Blank lines aren't necessary after an open
brace '{'"
in rtllib.h:482.

Signed-off-by: Beatriz Martins de Carvalho <martinsdecarvalhobeatriz@gmail.com>
Link: https://lore.kernel.org/r/20190904210326.17983-1-martinsdecarvalhobeatriz@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: Use kmemdup in exfat_symlink()
YueHaibing [Thu, 5 Sep 2019 03:00:47 +0000 (03:00 +0000)]
staging: exfat: Use kmemdup in exfat_symlink()

Use kmemdup rather than duplicating its implementation

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190905030047.88401-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: remove unused including <linux/version.h>
YueHaibing [Thu, 5 Sep 2019 02:56:23 +0000 (02:56 +0000)]
staging: exfat: remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190905025623.63210-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: remove duplicated include from exfat_super.c
YueHaibing [Thu, 5 Sep 2019 02:56:08 +0000 (02:56 +0000)]
staging: exfat: remove duplicated include from exfat_super.c

Remove duplicated include.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190905025608.61884-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: remove the redundant check when kfree an object in exfat_destroy_inode
zhong jiang [Wed, 4 Sep 2019 10:03:28 +0000 (18:03 +0800)]
staging: exfat: remove the redundant check when kfree an object in exfat_destroy_inode

kfree has taken the null check in account. hence it is unnecessary to add the
null check before kfree the object. Just remove it.

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Link: https://lore.kernel.org/r/1567591408-24268-1-git-send-email-zhongjiang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: Fix two missing unlocks on error paths
Dan Carpenter [Wed, 4 Sep 2019 09:59:08 +0000 (12:59 +0300)]
staging: exfat: Fix two missing unlocks on error paths

These two error paths need to unlock before we can return.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20190904095908.GA7007@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: using switch-case while checking the inode type.
Pratik Shinde [Fri, 30 Aug 2019 09:56:15 +0000 (15:26 +0530)]
erofs: using switch-case while checking the inode type.

while filling the linux inode, using switch-case statement to check
the type of inode.
switch-case statement looks more clean here.

Signed-off-by: Pratik Shinde <pratikshinde320@gmail.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190830095615.10995-1-pratikshinde320@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: cleanup explicit comparisons to NULL
Valentin Vidic [Tue, 3 Sep 2019 20:56:59 +0000 (22:56 +0200)]
staging: exfat: cleanup explicit comparisons to NULL

Fixes checkpatch.pl warnings:

  CHECK: Comparison to NULL could be written "expr"
  CHECK: Comparison to NULL could be written "!expr"

Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Link: https://lore.kernel.org/r/20190903205659.18856-1-vvidic@valentin-vidic.from.hr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoStaging: rtl8723bs: Use kzfree rather than its implementation
zhong jiang [Wed, 4 Sep 2019 03:01:19 +0000 (11:01 +0800)]
Staging: rtl8723bs: Use kzfree rather than its implementation

Use kzfree instead of memset() + kfree().

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Link: https://lore.kernel.org/r/1567566079-7412-4-git-send-email-zhongjiang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoMerge tag 'iio-for-5.4b-take3' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Tue, 3 Sep 2019 20:27:46 +0000 (22:27 +0200)]
Merge tag 'iio-for-5.4b-take3' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Second set of new device support, cleanups and features for IIO in the 5.4 cycle

Revised pull request to fix up a missing Signed-off-by and roll in
a fix in the lsm9ds1 support after I broke it when applying.
Revised again because the fix changed a hash meaning a fix
that previously followed it now had the wrong fixes tag.

A few fixes in here that could have gone a faster path but aren't quite
worth the rush for 5.3.

New device support
* ad7606
  - Support the ad7606b which adds a software controlled mode alongside
    the pin controlled only approach of the ad7606. Including dt-bindings.
* lsm6dsx
  - Add support for the gyro and accelerometer part of the lsm9ds1 which is
    a compound device also including a magnetometer (st_sensors driver).
    Includes bindings and precursor rework of the driver.

Features
* ad7192
  - Add support for low pass filter control.
  - DT binding docs.

Cleanups and minor fixes
* MAINTAINERS
  - Fix a typo in a path.
  - Add entry for ad7606
* ad5380
  - Fix a failure to dereference a pointer before atempting to assign the
    value.
* ad7192
  - Drop platform data as not used in mainline and we now have full DT bindings.
* ad7606
  - YAML conversion for dt-bindings.
* adis16240
  - Rework write_raw to make it more readable using GENMASK.
* adis16460
  - Fix and issue with an unsigned variable holding potential negatives.
* cros_ec
  - Fix missing default of calibration vector so that we get 'something'
    before calibration is complete on a given axis.
* hid-sensors
  - Use int_pow instead of opencoding.
* isl29501
  - rename dt-binding docs to include renesas inline with other renesas parts
    and general current convention.
* kxcjk1013
  - Improve comments on the 'unusual' ACPI ids used to identify which sensor
    is which in certain laptops.
* lsm6dsx
  - Add one bit to the fifo status masks for a number of parts.
  - Drop a reserved entry from the sensitivity values to tidy up interface.
  - Use core conversion macro from G to m/s^2 for lsm9ds1 to make it easier
    to relate to the datasheet and consistent with other parts supported.
* max1027
  - Use device managed APIs to avoid manual error handling and cleanup.
* rfd77402
  - Typo in Kconfig help.
* sc27xx
  - Switch to polling mode from interrupts as interrupt handling typically
    to slow for very short sleeps.
* st-sensors
  - Fix some missing selects for regmap.
* tools
  - Add a .gitignore containing the binary outputs.

* tag 'iio-for-5.4b-take3' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (27 commits)
  iio: imu: st_lsm6dsx: rely on IIO_G_TO_M_S_2 for gain definition for LSM9DS1
  iio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1
  iio: cros_ec: set calibscale for 3d MEMS to unit vector
  iio: dac: ad5380: fix incorrect assignment to val
  iio: imu: st_lsm6dsx: Fix FIFO diff mask for tagged fifo
  dt-bindings: iio: imu: st_lsm6dsx: add lsm9ds1 device bindings
  iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1
  iio: imu: st_lsm6dsx: move register definitions to sensor_settings struct
  iio: imu: st_lsm6dsx: introduce update_fifo function pointer
  dt-bindings: iio: light: isl29501: Rename bindings documentation file
  Kconfig: Fix the reference to the RFD77402 ToF sensor in the 'help' section
  iio: st_sensors: Fix build error
  dt-bindings: iio: adc: Add AD7606B ADC documentation
  dt-bindings: iio: adc: Migrate AD7606 documentation to yaml
  MAINTAINERS: Add Beniamin Bia for AD7606 driver
  iio: adc: ad7606: Add support for AD7606B ADC
  tools: iio: add .gitignore
  iio: adc: sc27xx: Change to polling mode to read data
  iio: hid-sensor-attributes: Convert to use int_pow()
  iio: adc: max1027: Use device-managed APIs
  ...

4 years agoiio: imu: st_lsm6dsx: rely on IIO_G_TO_M_S_2 for gain definition for LSM9DS1
Lorenzo Bianconi [Tue, 27 Aug 2019 08:29:06 +0000 (10:29 +0200)]
iio: imu: st_lsm6dsx: rely on IIO_G_TO_M_S_2 for gain definition for LSM9DS1

Rely on IIO_G_TO_M_S_2 macro for LSM9DS1 accelerometer gain definitions

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1
Lorenzo Bianconi [Tue, 27 Aug 2019 08:26:35 +0000 (10:26 +0200)]
iio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1

Get rid of invalid sensitivity value for LSM9DS1 gyro sensor

Fixes: 52f4b1f19679 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: exfat: drop local TRUE/FALSE defines
Valentin Vidic [Tue, 3 Sep 2019 18:55:37 +0000 (20:55 +0200)]
staging: exfat: drop local TRUE/FALSE defines

Replace with bool where it makes sense. Also drop unused local
variable lossy in fat_find_dir_entry.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Link: https://lore.kernel.org/r/20190903185537.25099-1-vvidic@valentin-vidic.from.hr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: fix spelling errors in comments
Valentin Vidic [Tue, 3 Sep 2019 16:54:08 +0000 (18:54 +0200)]
staging: exfat: fix spelling errors in comments

Fixes checkpatch.pl warnings:

  CHECK: 'consistancy' may be misspelled - perhaps 'consistency'?
  CHECK: 'stuct' may be misspelled - perhaps 'struct'?

Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Link: https://lore.kernel.org/r/20190903165408.16010-1-vvidic@valentin-vidic.from.hr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: cleanup braces for if/else statements
Valentin Vidic [Tue, 3 Sep 2019 16:47:32 +0000 (18:47 +0200)]
staging: exfat: cleanup braces for if/else statements

Fixes checkpatch.pl warnings:

  CHECK: Unbalanced braces around else statement
  CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Link: https://lore.kernel.org/r/20190903164732.14194-1-vvidic@valentin-vidic.from.hr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoiio: cros_ec: set calibscale for 3d MEMS to unit vector
Gwendal Grignou [Mon, 26 Aug 2019 23:02:58 +0000 (16:02 -0700)]
iio: cros_ec: set calibscale for 3d MEMS to unit vector

By default, set the calibscale vector to unit vector.
When calibrating one axis, the other axis calibrations  are sent as well.
If left to 0, sensor data from uncalibrated axis are zero'ed out until
all axis are calibrated.

Fixes: ed1f2e85da79 ("iio: cros_ec: Add calibscale for 3d MEMS ")
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: dac: ad5380: fix incorrect assignment to val
Colin Ian King [Thu, 15 Aug 2019 11:58:46 +0000 (12:58 +0100)]
iio: dac: ad5380: fix incorrect assignment to val

Currently the pointer val is being incorrectly incremented
instead of the value pointed to by val. Fix this by adding
in the missing * indirection operator.

Addresses-Coverity: ("Unused value")
Fixes: c03f2c536818 ("staging:iio:dac: Add AD5380 driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: Fix FIFO diff mask for tagged fifo
mario tesi [Thu, 22 Aug 2019 13:22:19 +0000 (15:22 +0200)]
iio: imu: st_lsm6dsx: Fix FIFO diff mask for tagged fifo

According to the latest version of datasheet the mask
for number of unread sensor data in FIFO_STATUS registers
has been extended to 10 bits

The devices involved are:
 - LSM6DSO
 - LSM6DSOX
 - ASM330LHH
 - LSM6DSR
 - ISM330DHCX

Signed-off-by: mario tesi <mario.tesi@st.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: imu: st_lsm6dsx: add lsm9ds1 device bindings
Martin Kepplinger [Wed, 21 Aug 2019 13:25:20 +0000 (15:25 +0200)]
dt-bindings: iio: imu: st_lsm6dsx: add lsm9ds1 device bindings

Note the binding is st,lsm9ds1-imu.  This device is effectively
two separate devices in the same package. (separate addreses,
chip selects etc) The magnetometer is already supported
as lsm9ds1-mag.  imu may not be the best name but it's the best
that anyone has yet come up with for a gyro and accel part.

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1
Martin Kepplinger [Wed, 21 Aug 2019 13:25:19 +0000 (15:25 +0200)]
iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1

The LSM9DS1's accelerometer / gyroscope unit and it's magnetometer (separately
supported in iio/magnetometer/st_magn*) are located on a separate i2c addresses
on the bus.

For the datasheet, see https://www.st.com/resource/en/datasheet/lsm9ds1.pdf

Treat it just like the LSM6* devices and, despite it's name, hook it up
to the st_lsm6dsx driver, using it's basic functionality.

accelerometer and gyroscope are not independently clocked. It runs at the gyro
frequencies if both are enabled, see chapter 7.12 of the datasheet.
We could have handled this as a single IIO device but we have split
it up to be more consistent with the other more flexible devices.

Despite supporting and testing the LSM9DS1, we call the gyro channels
iio_chan_spec struct "st_lsm6ds0_gyro_channels" because the register
description is equal. This suggests that supporting LSM6DS0 should be
trivial to do.

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: rtl8723bs: replace __inline by inline
Rasmus Villemoes [Fri, 30 Aug 2019 23:15:22 +0000 (01:15 +0200)]
staging: rtl8723bs: replace __inline by inline

Currently, __inline is #defined as inline in compiler_types.h, so this
should not change functionality. It is preparation for removing said
#define.

While at it, change some "inline static" to the customary "static
inline" order.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Link: https://lore.kernel.org/r/20190830231527.22304-2-linux@rasmusvillemoes.dk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: r8188eu: use skb_put_data instead of skb_put/memcpy pair
Ivan Safonov [Sun, 1 Sep 2019 19:53:01 +0000 (22:53 +0300)]
staging: r8188eu: use skb_put_data instead of skb_put/memcpy pair

skb_put_data is shorter and clear.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20190901195301.GA16043@alpha
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: kpc2000: Fix long constant sparse warning
Harsh Jain [Sat, 31 Aug 2019 11:55:32 +0000 (17:25 +0530)]
staging: kpc2000: Fix long constant sparse warning

It fixed following warning in kpc2000 driver
"constant XXXX is so big it is unsigned long"

Signed-off-by: Harsh Jain <harshjain32@gmail.com>
Link: https://lore.kernel.org/r/20190831115532.2398-1-harshjain32@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: check for null return from call to FAT_getblk
Colin Ian King [Fri, 30 Aug 2019 17:50:50 +0000 (18:50 +0100)]
staging: exfat: check for null return from call to FAT_getblk

A call to FAT_getblk is missing a null return check which can
lead to a null pointer dereference.  Fix this by adding a null
check to match all the other FAT_getblk return sanity checks.

Addresses-Coverity: ("Dereference null return")
Fixes: c48c9f7ff32b ("staging: exfat: add exfat filesystem code to staging")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190830175050.12706-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: light: fix a couple double frees
Dan Carpenter [Thu, 29 Aug 2019 12:28:39 +0000 (15:28 +0300)]
staging: greybus: light: fix a couple double frees

The problem is in gb_lights_request_handler().  If we get a request to
change the config then we release the light with gb_lights_light_release()
and re-allocated it.  However, if the allocation fails part way through
then we call gb_lights_light_release() again.  This can lead to a couple
different double frees where we haven't cleared out the original values:

gb_lights_light_v4l2_unregister(light);
...
kfree(light->channels);
kfree(light->name);

I also made a small change to how we set "light->channels_count = 0;".
The original code handled this part fine and did not cause a use after
free but it was sort of complicated to read.

Fixes: 2870b52bae4c ("greybus: lights: add lights implementation")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Link: https://lore.kernel.org/r/20190829122839.GA20116@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rts5208: Fix checkpath warning
P SAI PRASANTH [Sat, 31 Aug 2019 03:49:26 +0000 (09:19 +0530)]
staging: rts5208: Fix checkpath warning

This patch fixes the following checkpath warning
in the file drivers/staging/rts5208/rtsx_transport.c:546

WARNING: line over 80 characters
+                               option = RTSX_SG_VALID | RTSX_SG_END |
RTSX_SG_TRANS_DATA;

Signed-off-by: P SAI PRASANTH <saip2823@gmail.com>
Link: https://lore.kernel.org/r/20190831034926.GA17810@dell-inspiron
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rts5208: Fixed checkpath warning.
Prakhar Sinha [Fri, 30 Aug 2019 12:16:56 +0000 (17:46 +0530)]
staging: rts5208: Fixed checkpath warning.

This patch solves the following checkpatch.pl's message in drivers/staging/rts5208/rtsx_transport.c:397.

WARNING: line over 80 characters
+                               option = RTSX_SG_VALID | RTSX_SG_END | RTSX_SG_TRANS_DATA;

Signed-off-by: Prakhar Sinha <prakharsinha2808@gmail.com>
Link: https://lore.kernel.org/r/20190830121656.GA2740@MeraComputer
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rts5208: remove redundant sd30_mode checks
Colin Ian King [Fri, 30 Aug 2019 08:10:47 +0000 (09:10 +0100)]
staging: rts5208: remove redundant sd30_mode checks

There are two hunks of code that check if sd30_mode is true however
an earlier check in an outer code block on sd30_mode being false means
that sd30_mode can never be true at these points so these checks are
redundant.  Remove the dead code.

Addresses-Coverity: ("Logically dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190830081047.13630-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: remove return and error return via a goto
Colin Ian King [Mon, 2 Sep 2019 09:40:52 +0000 (10:40 +0100)]
staging: exfat: remove return and error return via a goto

The return statement is incorrect, the error exit should be by
assigning ret with the error code and exiting via label out.
Thanks to Valdis KlÄ“tnieks for correcting my original fix.

Addresses-Coverity: ("Structurally dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190902094052.28029-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: fix uninitialized variable ret
Colin Ian King [Fri, 30 Aug 2019 18:46:44 +0000 (19:46 +0100)]
staging: exfat: fix uninitialized variable ret

Currently there are error return paths in ffsReadFile that
exit via lable err_out that return and uninitialized error
return in variable ret. Fix this by initializing ret to zero.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: c48c9f7ff32b ("staging: exfat: add exfat filesystem code to staging")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>,
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lore.kernel.org/r/20190830184644.15590-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: use BIT macro for defining sizes
Valentin Vidic [Mon, 2 Sep 2019 18:43:19 +0000 (20:43 +0200)]
staging: exfat: use BIT macro for defining sizes

Fixes checkpatch.pl warning:

  CHECK: Prefer using the BIT macro

Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Link: https://lore.kernel.org/r/20190902184319.11971-1-vvidic@valentin-vidic.from.hr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: cleanup blank line warnings
Valentin Vidic [Mon, 2 Sep 2019 19:03:29 +0000 (21:03 +0200)]
staging: exfat: cleanup blank line warnings

Fixes checkpatch.pl warnings:

  CHECK: Please don't use multiple blank lines
  CHECK: Blank lines aren't necessary after an open brace '{'
  CHECK: Please use a blank line after function/struct/union/enum
         declarations

Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Link: https://lore.kernel.org/r/20190902190329.18685-1-vvidic@valentin-vidic.from.hr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: make exfat depend on BLOCK
Greg Kroah-Hartman [Mon, 2 Sep 2019 17:45:06 +0000 (19:45 +0200)]
staging: exfat: make exfat depend on BLOCK

This should fix a build error in some configurations when CONFIG_BLOCK
is not selected.  Also properly set the dependancy for no FAT support at
the same time.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Link: https://lore.kernel.org/r/20190902174631.GB31445@kroah.com
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agodrivers/staging/exfat - by default, prohibit mount of fat/vfat
Valdis Klētnieks [Fri, 30 Aug 2019 16:42:39 +0000 (12:42 -0400)]
drivers/staging/exfat - by default, prohibit mount of fat/vfat

Concerns have been raised about the exfat driver accidentally mounting
fat/vfat file systems.  Add an extra configure option to help prevent that.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Link: https://lore.kernel.org/r/245727.1567183359@turing-police
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: reduntant assignment in __erofs_get_meta_page()
Gao Xiang [Thu, 29 Aug 2019 17:17:41 +0000 (01:17 +0800)]
erofs: reduntant assignment in __erofs_get_meta_page()

As Joe Perches suggested [1],
  err = bio_add_page(bio, page, PAGE_SIZE, 0);
- if (unlikely(err != PAGE_SIZE)) {
+ if (err != PAGE_SIZE) {
  err = -EFAULT;
  goto err_out;
  }

The initial assignment to err is odd as it's not
actually an error value -E<FOO> but a int size
from a unsigned int len.

Here the return is either 0 or PAGE_SIZE.

This would be more legible to me as:

if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) {
err = -EFAULT;
goto err_out;
}

[1] https://lore.kernel.org/r/74c4784319b40deabfbaea92468f7e3ef44f1c96.camel@perches.com/
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190829171741.225219-1-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: remove all likely/unlikely annotations
Gao Xiang [Thu, 29 Aug 2019 16:38:27 +0000 (00:38 +0800)]
erofs: remove all likely/unlikely annotations

As Dan Carpenter suggested [1], I have to remove
all erofs likely/unlikely annotations.

[1] https://lore.kernel.org/linux-fsdevel/20190829154346.GK23584@kadam/
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190829163827.203274-1-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoMAINTAINERS: fix up exfat directory location
Greg Kroah-Hartman [Fri, 30 Aug 2019 06:56:37 +0000 (08:56 +0200)]
MAINTAINERS: fix up exfat directory location

I messed up on the exfat MAINTAINER entry, the code is in
drivers/staging/exfat/ not fs/exfat/

Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Reported-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: exfat: add exfat filesystem code to staging
Valdis Klētnieks [Wed, 28 Aug 2019 16:08:17 +0000 (18:08 +0200)]
staging: exfat: add exfat filesystem code to staging

The exfat code needs a lot of work to get it into "real" shape for
the fs/ part of the kernel, so put it into drivers/staging/ for now so
that it can be worked on by everyone in the community.

The full specification of the filesystem can be found at:
  https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20190828160817.6250-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: most: sound: Fix error path of audio_init
YueHaibing [Tue, 27 Aug 2019 13:13:46 +0000 (21:13 +0800)]
staging: most: sound: Fix error path of audio_init

If most_register_configfs_subsys() fails, we should
call most_deregister_component() do cleanup.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 919c03ae11b9 ("staging: most: enable configfs support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190827131346.12704-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8192u: Fix indentation
Stephen Brennan [Wed, 28 Aug 2019 04:35:42 +0000 (21:35 -0700)]
staging: rtl8192u: Fix indentation

Checkpatch reports WARNING:SUSPECT_CODE_INDENT in several places. Fix
this by aligning code properly with tabs.

Signed-off-by: Stephen Brennan <stephen@brennan.io>
Link: https://lore.kernel.org/r/20190828043542.3753-1-stephen@brennan.io
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: fix more header declarations
Rui Miguel Silva [Wed, 28 Aug 2019 12:48:25 +0000 (13:48 +0100)]
staging: greybus: fix more header declarations

More headers needed to be fixed when moving greybus out of staging and
enabling the COMPILE_TEST option.

Add forward declarations for the needed structures.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Reviewed-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20190828124825.20800-1-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoiio: imu: st_lsm6dsx: move register definitions to sensor_settings struct
Martin Kepplinger [Wed, 21 Aug 2019 13:25:18 +0000 (15:25 +0200)]
iio: imu: st_lsm6dsx: move register definitions to sensor_settings struct

Move some register definitions to the per-device array of struct
st_lsm6dsx_sensor_settings in order to simplify adding new sensor
devices to the driver.

Also, remove completely unused register definitions.

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: greybus: add missing includes
Rui Miguel Silva [Tue, 27 Aug 2019 15:53:02 +0000 (16:53 +0100)]
staging: greybus: add missing includes

Before moving greybus core out of staging and moving header files to
include/linux some greybus header files were missing the necessary
includes. This would trigger compilation faillures with some example
errors logged bellow for with CONFIG_KERNEL_HEADER_TEST=y.

So, add the necessary headers to compile clean before relocating the
header files.

./include/linux/greybus/hd.h:23:50: error: unknown type name 'u16'
  int (*cport_disable)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/greybus_protocols.h:1314:2: error: unknown type name '__u8'
  __u8 data[0];
  ^~~~
./include/linux/greybus/hd.h:24:52: error: unknown type name 'u16'
  int (*cport_connected)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/hd.h:25:48: error: unknown type name 'u16'
  int (*cport_flush)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/hd.h:26:51: error: unknown type name 'u16'
  int (*cport_shutdown)(struct gb_host_device *hd, u16 cport_id, ^~~
./include/linux/greybus/hd.h:27:5: error: unknown type name 'u8'
u8 phase, unsigned int timeout);
     ^~
./include/linux/greybus/hd.h:28:50: error: unknown type name 'u16'
  int (*cport_quiesce)(struct gb_host_device *hd, u16 cport_id, ^~~
./include/linux/greybus/hd.h:29:5: error: unknown type name 'size_t'
     size_t peer_space, unsigned int timeout);
     ^~~~~~
./include/linux/greybus/hd.h:29:5: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
./include/linux/greybus/hd.h:1:1:
+#include <stddef.h>
 /* SPDX-License-Identifier: GPL-2.0 */
./include/linux/greybus/hd.h:29:5:
     size_t peer_space, unsigned int timeout);
     ^~~~~~
./include/linux/greybus/hd.h:30:48: error: unknown type name 'u16'
  int (*cport_clear)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/hd.h:32:49: error: unknown type name 'u16'
  int (*message_send)(struct gb_host_device *hd, u16 dest_cport_id, ^~~
./include/linux/greybus/hd.h:33:32: error: unknown type name 'gfp_t'
struct gb_message *message, gfp_t gfp_mask); ^~~~~
./include/linux/greybus/hd.h:35:55: error: unknown type name 'u16'
  int (*latency_tag_enable)(struct gb_host_device *hd, u16 cport_id);

Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Gao Xiang <hsiangkao@aol.com>
Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20190827155302.25704-1-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: move es2 to drivers/greybus/
Greg Kroah-Hartman [Sun, 25 Aug 2019 05:54:29 +0000 (07:54 +0200)]
staging: greybus: move es2 to drivers/greybus/

The es2 Greybus host controller has long been stable, so move it out of
drivers/staging/ to drivers/greybus/

Cc: Johan Hovold <johan@kernel.org>
Cc: greybus-dev@lists.linaro.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Alex Elder <elder@kernel.org>
Link: https://lore.kernel.org/r/20190825055429.18547-10-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: move the greybus core to drivers/greybus
Greg Kroah-Hartman [Sun, 25 Aug 2019 05:54:28 +0000 (07:54 +0200)]
staging: greybus: move the greybus core to drivers/greybus

The Greybus core code has been stable for a long time, and has been
shipping for many years in millions of phones.  With the advent of a
recent Google Summer of Code project, and a number of new devices in the
works from various companies, it is time to get the core greybus code
out of staging as it really is going to be with us for a while.

Cc: Johan Hovold <johan@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: greybus-dev@lists.linaro.org
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Alex Elder <elder@kernel.org>
Link: https://lore.kernel.org/r/20190825055429.18547-9-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: move core include files to include/linux/greybus/
Greg Kroah-Hartman [Sun, 25 Aug 2019 05:54:27 +0000 (07:54 +0200)]
staging: greybus: move core include files to include/linux/greybus/

With the goal of moving the core of the greybus code out of staging, the
include files need to be moved to include/linux/greybus.h and
include/linux/greybus/

Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Cc: Rui Miguel Silva <rmfrfs@gmail.com>
Cc: David Lin <dtwlin@gmail.com>
Cc: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>
Cc: greybus-dev@lists.linaro.org
Cc: devel@driverdev.osuosl.org
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Alex Elder <elder@kernel.org>
Link: https://lore.kernel.org/r/20190825055429.18547-8-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: loopback: Fix up some alignment checkpatch issues
Greg Kroah-Hartman [Sun, 25 Aug 2019 05:54:26 +0000 (07:54 +0200)]
staging: greybus: loopback: Fix up some alignment checkpatch issues

Some function prototypes do not match the expected alignment formatting
so fix that up so that checkpatch is happy.

Cc: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>
Cc: Johan Hovold <johan@kernel.org>
Cc: greybus-dev@lists.linaro.org
Cc: devel@driverdev.osuosl.org
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Alex Elder <elder@kernel.org>
Link: https://lore.kernel.org/r/20190825055429.18547-7-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: log: Fix up some alignment checkpatch issues
Greg Kroah-Hartman [Sun, 25 Aug 2019 05:54:25 +0000 (07:54 +0200)]
staging: greybus: log: Fix up some alignment checkpatch issues

Some function prototypes do not match the expected alignment formatting
so fix that up so that checkpatch is happy.

Cc: David Lin <dtwlin@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: greybus-dev@lists.linaro.org
Cc: devel@driverdev.osuosl.org
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Alex Elder <elder@kernel.org>
Link: https://lore.kernel.org/r/20190825055429.18547-6-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: manifest: Fix up some alignment checkpatch issues
Greg Kroah-Hartman [Sun, 25 Aug 2019 05:54:24 +0000 (07:54 +0200)]
staging: greybus: manifest: Fix up some alignment checkpatch issues

Some function prototypes do not match the expected alignment formatting
so fix that up so that checkpatch is happy.

Cc: Johan Hovold <johan@kernel.org>
Cc: greybus-dev@lists.linaro.org
Cc: devel@driverdev.osuosl.org
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Alex Elder <elder@kernel.org>
Link: https://lore.kernel.org/r/20190825055429.18547-5-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: hd: Fix up some alignment checkpatch issues
Greg Kroah-Hartman [Sun, 25 Aug 2019 05:54:23 +0000 (07:54 +0200)]
staging: greybus: hd: Fix up some alignment checkpatch issues

Some function prototypes do not match the expected alignment formatting
so fix that up so that checkpatch is happy.

Cc: Johan Hovold <johan@kernel.org>
Cc: greybus-dev@lists.linaro.org
Cc: devel@driverdev.osuosl.org
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Alex Elder <elder@kernel.org>
Link: https://lore.kernel.org/r/20190825055429.18547-4-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: remove license "boilerplate"
Greg Kroah-Hartman [Sun, 25 Aug 2019 05:54:22 +0000 (07:54 +0200)]
staging: greybus: remove license "boilerplate"

When the greybus drivers were converted to SPDX identifiers for the
license text, some license boilerplate was not removed.  Clean this up
by removing this unneeded text now.

Cc: Johan Hovold <johan@kernel.org>
Cc: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Cc: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>
Cc: greybus-dev@lists.linaro.org
Cc: devel@driverdev.osuosl.org
Acked-by: Mark Greer <mgreer@animalcreekk.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Alex Elder <elder@kernel.org>
Link: https://lore.kernel.org/r/20190825055429.18547-3-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: fix up SPDX comment in .h files
Greg Kroah-Hartman [Sun, 25 Aug 2019 05:54:21 +0000 (07:54 +0200)]
staging: greybus: fix up SPDX comment in .h files

When these files originally got an SPDX tag, I used // instead of /* */
for the .h files.  Fix this up to use // properly.

Cc: Johan Hovold <johan@kernel.org>
Cc: greybus-dev@lists.linaro.org
Cc: devel@driverdev.osuosl.org
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Alex Elder <elder@kernel.org>
Link: https://lore.kernel.org/r/20190825055429.18547-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoerofs: fix compile warnings when moving out include/trace/events/erofs.h
Gao Xiang [Mon, 26 Aug 2019 13:26:53 +0000 (21:26 +0800)]
erofs: fix compile warnings when moving out include/trace/events/erofs.h

As Stephon reported [1], many compile warnings are raised when
moving out include/trace/events/erofs.h:

In file included from include/trace/events/erofs.h:8,
                 from <command-line>:
include/trace/events/erofs.h:28:37: warning: 'struct dentry' declared inside parameter list will not be visible outside of this definition or declaration
  TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
                                     ^~~~~~
include/linux/tracepoint.h:233:34: note: in definition of macro '__DECLARE_TRACE'
  static inline void trace_##name(proto)    \
                                  ^~~~~
include/linux/tracepoint.h:396:24: note: in expansion of macro 'PARAMS'
  __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),  \
                        ^~~~~~
include/linux/tracepoint.h:532:2: note: in expansion of macro 'DECLARE_TRACE'
  DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
  ^~~~~~~~~~~~~
include/linux/tracepoint.h:532:22: note: in expansion of macro 'PARAMS'
  DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
                      ^~~~~~
include/trace/events/erofs.h:26:1: note: in expansion of macro 'TRACE_EVENT'
 TRACE_EVENT(erofs_lookup,
 ^~~~~~~~~~~
include/trace/events/erofs.h:28:2: note: in expansion of macro 'TP_PROTO'
  TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
  ^~~~~~~~

That makes me very confused since most original EROFS tracepoint code
was taken from f2fs, and finally I found

commit 43c78d88036e ("kbuild: compile-test kernel headers to ensure they are self-contained")

It seems these warnings are generated from KERNEL_HEADER_TEST feature and
ext4/f2fs tracepoint files were in blacklist.

Anyway, let's fix these issues for KERNEL_HEADER_TEST feature instead
of adding to blacklist...

[1] https://lore.kernel.org/lkml/20190826162432.11100665@canb.auug.org.au/

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Link: https://lore.kernel.org/r/20190826132653.100731-1-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8192u: Add or remove blank lines as required
Sumera Priyadarsini [Mon, 26 Aug 2019 18:22:27 +0000 (23:52 +0530)]
staging: rtl8192u: Add or remove blank lines as required

This patch fixes the file r8190_rtl8256.c to avoid the following
checkpatch.pl warnings:
CHECK: Blank lines aren't necessary before a close brace '}'
CHECK: Please use a blank line after function/struct/union/enum declarations
CHECK: Please don't use multiple blank line

Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Link: https://lore.kernel.org/r/20190826182227.30738-1-sylphrenadin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8192u: Add or remove spaces to fix style issues
Sumera Priyadarsini [Mon, 26 Aug 2019 18:09:09 +0000 (23:39 +0530)]
staging: rtl8192u: Add or remove spaces to fix style issues

This patch fixes the file r8190_rtl8256.c to avoid the following
checkpatch.pl warnings:
CHECK: spaces preferred around that '<<' (ctx:VxV)
CHECK: spaces preferred around that '-' (ctx:VxV)
CHECK: No space is necessary after a cast

Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Link: https://lore.kernel.org/r/20190826180909.27775-1-sylphrenadin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8712: wifi: checkpatch style fix
Taihsiang Ho (tai271828) [Mon, 26 Aug 2019 05:20:18 +0000 (13:20 +0800)]
staging: rtl8712: wifi: checkpatch style fix

Remove multiple blank lines.

Signed-off-by: Taihsiang Ho (tai271828) <tai271828@gmail.com>
Link: https://lore.kernel.org/r/20190826052018.18649-1-tai271828@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: most-core: Fix checkpatch warnings
Peikan Tsai [Sun, 25 Aug 2019 17:58:49 +0000 (01:58 +0800)]
staging: most-core: Fix checkpatch warnings

Hi,

This patch solves the following checkpatch.pl's messages in drivers/staging/most/core.c.

WARNING: line over 80 characters
+ return snprintf(buf, PAGE_SIZE, "%s", ch_data_type[i].name);

CHECK: Please use a blank line after function/struct/union/enum declarations
+}
+/**

Signed-off-by: Peikan Tsai <peikantsai@gmail.com>
Link: https://lore.kernel.org/r/20190825175849.GA74586@MarkdeMacBook-Pro.local
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoiio: imu: st_lsm6dsx: introduce update_fifo function pointer
Lorenzo Bianconi [Wed, 21 Aug 2019 13:25:17 +0000 (15:25 +0200)]
iio: imu: st_lsm6dsx: introduce update_fifo function pointer

Introduce update_fifo routine pointer in st_lsm6dsx_fifo_ops data
structure since we will need a different update FIFO configuration
callback adding support for lsm6ds0/lsm9ds1 imu device

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: light: isl29501: Rename bindings documentation file
Simon Horman [Mon, 19 Aug 2019 14:17:08 +0000 (16:17 +0200)]
dt-bindings: iio: light: isl29501: Rename bindings documentation file

Rename the bindings documentation file for Renesas ISL29501 Time-of-flight
sensor from isl29501.txt to renesas,isl29501.txt.

This is part of an ongoing effort to name bindings documentation files for
Renesas IP blocks consistently, in line with the compat strings they
document.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoKconfig: Fix the reference to the RFD77402 ToF sensor in the 'help' section
Christophe JAILLET [Mon, 19 Aug 2019 04:48:27 +0000 (06:48 +0200)]
Kconfig: Fix the reference to the RFD77402 ToF sensor in the 'help' section

This should be RFD77402, not RFD77420.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: st_sensors: Fix build error
YueHaibing [Fri, 23 Aug 2019 12:18:52 +0000 (20:18 +0800)]
iio: st_sensors: Fix build error

IIO_ST_SENSORS_CORE select IIO_ST_SENSORS_I2C
unconditionally, if REGMAP_I2C is not set, build fails

drivers/iio/common/st_sensors/st_sensors_i2c.o: In function `st_sensors_i2c_configure':
st_sensors_i2c.c:(.text+0x58): undefined reference to `__devm_regmap_init_i2c'

This patch selects REGMAP_I2C to fix it.
IIO_ST_SENSORS_SPI is similar to SPI issue.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 062809ef7733 ("iio: make st_sensors drivers use regmap")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: adc: Add AD7606B ADC documentation
Beniamin Bia [Wed, 21 Aug 2019 14:16:56 +0000 (17:16 +0300)]
dt-bindings: iio: adc: Add AD7606B ADC documentation

Documentation for AD7606B Analog to Digital Converter and software
mode was added.

Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: adc: Migrate AD7606 documentation to yaml
Beniamin Bia [Wed, 21 Aug 2019 14:16:55 +0000 (17:16 +0300)]
dt-bindings: iio: adc: Migrate AD7606 documentation to yaml

The documentation for ad7606 was migrated to yaml.

Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>