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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAl1uyTgRHGppYzIzQGtl
cm5lbC5vcmcACgkQVIU0mcT0Foideg//fknN/aM40zRZlClkWx9XqUsByS/3XUAl
dZL//5DGh566D8/auBeacQxt6SzOFRpj2XwWI/K8mGJi39y9LFOywOn4dDgOBh3x
VWe/1eCNFg9Y1eMCXncYHBtxxobuV3UKEjVtYFtzg210HP/KM6C3fWdPTpmj1zNZ
PYSnKGiBGxeJHMCUjN0QweifIRvTy0MLkxPc9CUHcFq0XiMD2enI4TwHYuZ/CNQw
oisDPPksbPTW5R547vLEnQe/p16MtoFMX57yehbzKIp6qYBEVR+D5ne5kxct8x80
Ma7YVWLyWTxYF/MwLi3felIniEeyYhgTFVhy2rhZGt6eKDmNFTwTrJG5iTweeHQm
3FJPbZ04lDjE3RhoETGDc2aSqY5/Xy1nnOJcMjZ1twbDxPGmN2/rCP3YxYRmGL/P
VCsCZYeQF6cKi7FyFiViqALTPH0k/Ebklol1f/IG8CuFCs8r/m6kKMeSJX3+miHZ
gIxA2lX5uj8FIiB1bZxORN76W5PzxLji5IiCPy1KtlBin3E3oWM3nQLXNHpzp2Fw
5A8IyHb/qDoKnO1MlTkprIxdIzKqV4gtWqkY1kTBYyNyreMP/dsiw/lC1rnzWMm/
v7JHuTbO/Ay5gvT58goK7FD77CyvRTvy3bmi7PNkWJyogWpnRTLiPusMDz7FwxK4
Ffrbi7+qijk=
=rPVR
-----END PGP SIGNATURE-----
Merge tag 'iio-for-5.4b-take3' of git://git.kernel.org/pub/scm/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
...
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>
Get rid of invalid sensitivity value for LSM9DS1 gyro sensor
Fixes: 52f4b1f196 ("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>
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>
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>
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: ed1f2e85da ("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>
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: c03f2c5368 ("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>
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>
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>
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>
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>
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>
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: c48c9f7ff3 ("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>
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: 2870b52bae ("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>
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>
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>
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>
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: c48c9f7ff3 ("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>