platform_driver_register will set the .owner field. So it is safe
to remove the redundant assignment.
The issue is detected with the help of Coccinelle.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Currently the pointer wilc is being null checked several times
and yet not checked for the final workqueue flush and destroy
(which can lead to a null pointer dereference if wilc is null);
these missing null checks were overlooked in an earlier core
refactoring commit.
Clean up the code by checking wilc at the start and bailing out
early if it is null allowing the subsequent null checks to be
removed, this also fixes the potential null pointer deferences
on the workqueue flush and destroy calls.
Detected by CoverityScan, CID#1473305 ("Dereference after null check")
Fixes: b3ee105c33 ("staging: wilc1000: refactor code to move initilization in wilc_netdev_init()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There is a merge commit in here to pull in regmap support for repeatedly
reading the same register (to read out FIFOs). Used by the adxl372 driver.
This will find uses elsewhere once we tidy up various drivers that are
effectively doing this and relying on not enabling regcache.
New device support
* Analog devices ADXL372 accelerometer
- new driver for this accelerometer including fifo and and interrupt support.
Follow up patches enforce trigger validation, add sampling frequency
control and filter bandwidth control. A later series added i2c support
to the existing SPI support.
* ST lsm6dsx
- rework and add support fo the LSM6DSO 6 axis mems sensor.
* Linear LTC 1660 DAC
- new driver supporting the LTC 1660 and LTC 1665 SPI DACs.
* Microchip mcp3911 ADC.
- new driver for this integrated analog front end and ADC.
* Qualcomm SPMI PMIC5 adc driver
- using the spmi framework, new driver and bindings for this ADC.
Follow up patch adds some missing channels.
Features
* ad5758
- support hard reset using a gpio (if provided).
* mpu6050
- Regulator support
* qcom-spmi-adc5
- Sanity check the channel numbers provided by DT to make sure the
driver actually knows about them.
* sc27xx
- give raw data for channel 20 as it's used on all known boards for
the headset which needs a custom converstion function. If it turns
out someone builds a board where this isn't true we will deal with it
when it happens.
- add ADC scale calibration.
* tsl2772
- support device tree binding to set the proximity led settings.
- regulator supprot.
- binding for apds9930 - trivial addition as register compatible with tsl2772.
Cleanups / Minor fixes
* adxl345
- supress a static checker warning but explicitly checking if the id
object is null.
* bh1750
- avoid CONFIG_PM_SLEEP checks.
- SPDX.
* bme680
- spelling mistake
- use clamp rather than open coding.
- white space and other similar fixes.
- rename MSK to MASK for clarifty and use GENMASK to specify them.
- use the FIELD_GET macro rather than a very odd accessor of dividing by
16 to get the shift.
- rework to share handing for oversampling of the various channels in a
unified way.
- check explicitly for val2 in write_raw function to ensure it is 0.
- drop some field defines that don't add anything.
* dpot-adc
- SPDX
* envelope detector
- SPDX
* isl29501
- fix an ancient compiler warning mostly because it results in much
nicer code.
* max30102
- mark switch fall throughs.
* max44000
- drop an unused variable.
* max512
- avoid CONFIG_PM_SLEEP checks.
* max5481
- use of_device_get_match_data rather than open coding it.
* max5821
- avoid CONFIG_PM_SLEEP checks.
* max9611
- explicity cast an enum to an integer to make it totally clear that
this is intended.
* mcp4018
- fix an inconsistent MODULE_LICENSE.
- use of_device_get_match_data rather than open coding it.
* mcp4531
- use of_device_get_match_data rather than open coding it.
- SPDX
* mcp4725
- avoid CONFIG_PM_SLEEP checks.
* mcp4922
- Fix error handling and prevent writing a negative to when setting the
output voltage.
* ms5611
- drop deprecated compatible strings without manufacturer from being
explicitly listed. They are handled anyway.
- SPDX
* multiplexer
- SPDX
* qcom-vadc
- fix inconsistent documentation for reg.
* ti-dac5571
- provide and of_match_table.
* treewide
- update Michael Hennerich's email address.
- Use %pOFn rather than device_node.name.
* documentation.
- tidy up a wrong kernel version for the introduction of the
position_relative ABI.
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAluave0RHGppYzIzQGtl
cm5lbC5vcmcACgkQVIU0mcT0Fogr/A//bfXkfYPO2tPQOe+Ut/isyKvceDFs4faJ
0ogmVxrH5hwFe96vfB0RWcYhovKXONrRtqreMCiVPMjKxg5o+F3Q+eSj0qhxhG77
bDV5CnF1GXiBe/02WSEs9B3L4oxu6Z/PGq2sGrlTfTy8NZxJW6biER1aWeBbxmR6
nPBb9SXH4vuqiiF8UOwRB2ETelx2jXXCNFxmUVQ0bzCYgAp/n7B2ZJu6OxWIhBGC
NEPYofFajNATJEGgTQmwmKNv6xL4wVSpZXMLO1hzKPe8arARBqPGjIg14srl+nWs
HsOdsl/GkeOcPsI7aUvQO0zC5nOgU9iXtQFZQLq8D1xMQP9LzfRuLhymy8dH8hg+
uUfxkJf0OwhqEW+6GJ0g4A2xaDHyM7JFQAV1/XCNS93qjpcgC7rcLbnSDy9u6SC/
j3g3EFUXVYqOuFXbr+1TLrg/oJhnOkXp3Wbm/Di0zXJNYOtzQ9zSLp55HZLxvOOl
zzLWCSkse9EAwHzVnl4BAd03Zw3Ewh9aAJlXQ7JKGtQSXo+PpFyIiyn8woQpzGV8
OePhhmooOYVxI2Aua0UKhwa6lPeZT71zjpJyFCTFJqRwU3I/8HEDH5g+9dX6Vk6h
CLF/fCLCkRa1ccDzFQbHai91xLflaYUsXdjOnQymJ5CYToni/IyPukrZ05b2IdvO
XnMIaoVrAUU=
=+9gG
-----END PGP SIGNATURE-----
Merge tag 'iio-for-4.20a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
1st round of IIO new device support, features and cleanups in the 4.20 cycle.
There is a merge commit in here to pull in regmap support for repeatedly
reading the same register (to read out FIFOs). Used by the adxl372 driver.
This will find uses elsewhere once we tidy up various drivers that are
effectively doing this and relying on not enabling regcache.
New device support
* Analog devices ADXL372 accelerometer
- new driver for this accelerometer including fifo and and interrupt support.
Follow up patches enforce trigger validation, add sampling frequency
control and filter bandwidth control. A later series added i2c support
to the existing SPI support.
* ST lsm6dsx
- rework and add support fo the LSM6DSO 6 axis mems sensor.
* Linear LTC 1660 DAC
- new driver supporting the LTC 1660 and LTC 1665 SPI DACs.
* Microchip mcp3911 ADC.
- new driver for this integrated analog front end and ADC.
* Qualcomm SPMI PMIC5 adc driver
- using the spmi framework, new driver and bindings for this ADC.
Follow up patch adds some missing channels.
Features
* ad5758
- support hard reset using a gpio (if provided).
* mpu6050
- Regulator support
* qcom-spmi-adc5
- Sanity check the channel numbers provided by DT to make sure the
driver actually knows about them.
* sc27xx
- give raw data for channel 20 as it's used on all known boards for
the headset which needs a custom converstion function. If it turns
out someone builds a board where this isn't true we will deal with it
when it happens.
- add ADC scale calibration.
* tsl2772
- support device tree binding to set the proximity led settings.
- regulator supprot.
- binding for apds9930 - trivial addition as register compatible with tsl2772.
Cleanups / Minor fixes
* adxl345
- supress a static checker warning but explicitly checking if the id
object is null.
* bh1750
- avoid CONFIG_PM_SLEEP checks.
- SPDX.
* bme680
- spelling mistake
- use clamp rather than open coding.
- white space and other similar fixes.
- rename MSK to MASK for clarifty and use GENMASK to specify them.
- use the FIELD_GET macro rather than a very odd accessor of dividing by
16 to get the shift.
- rework to share handing for oversampling of the various channels in a
unified way.
- check explicitly for val2 in write_raw function to ensure it is 0.
- drop some field defines that don't add anything.
* dpot-adc
- SPDX
* envelope detector
- SPDX
* isl29501
- fix an ancient compiler warning mostly because it results in much
nicer code.
* max30102
- mark switch fall throughs.
* max44000
- drop an unused variable.
* max512
- avoid CONFIG_PM_SLEEP checks.
* max5481
- use of_device_get_match_data rather than open coding it.
* max5821
- avoid CONFIG_PM_SLEEP checks.
* max9611
- explicity cast an enum to an integer to make it totally clear that
this is intended.
* mcp4018
- fix an inconsistent MODULE_LICENSE.
- use of_device_get_match_data rather than open coding it.
* mcp4531
- use of_device_get_match_data rather than open coding it.
- SPDX
* mcp4725
- avoid CONFIG_PM_SLEEP checks.
* mcp4922
- Fix error handling and prevent writing a negative to when setting the
output voltage.
* ms5611
- drop deprecated compatible strings without manufacturer from being
explicitly listed. They are handled anyway.
- SPDX
* multiplexer
- SPDX
* qcom-vadc
- fix inconsistent documentation for reg.
* ti-dac5571
- provide and of_match_table.
* treewide
- update Michael Hennerich's email address.
- Use %pOFn rather than device_node.name.
* documentation.
- tidy up a wrong kernel version for the introduction of the
position_relative ABI.
It's a little bit strange when fault_injection related
option fail with -EINVAL which was already disabled
from config, so surround all fault_injection related option
parsing code using CONFIG_EROFS_FAULT_INJECTION. Meanwhile,
slightly change warning message to keep consistency with
option POSIX_ACL and FS_XATTR.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'"
detected by checkpatch.pl.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The the last two parameters of write_cam() have type u8.
Change the type of the passed arrays from unsigned char to u8.
Clears a line over 80 characters checkpatch warning.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wrap lines over 80 characters where appropriate to
clear checkpatch warnings.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove unnecessary parentheses from conditionals.
Also clears 'Alignment should match open parenthesis'
checkpatch issue.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor switch cases in SwLedControlMode1() to reduce
indentation level. Also clears line over 80 characters
checkpatch warnings.
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cleanup to remove handle_hif_exit_work(), as after code refactoring its
not required anymore.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the wilc_netdev_init() to cleanup the memory for error
scenario and remove unnecessary 'dev' pointer check.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor code to move the initialization of wilc related parameters in
wilc_netdev_init() and move their deinitialization in
wilc_netdev_cleanup(). For 'hif_workqueue' creation 'clients_count' check
is not required as the single instance is maintained.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the use of unnecessary static variable 'p2p_listen_state'.
Already 'p2p_listen_state' is present in 'wilc_priv' struct. So making
use of that variable as its getting set in channel ready and
remain on channel expired callback.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Move static variable 'wilc_connecting' as part of 'wilc_vif' private
struct. Remove "wilc_" prefix from name as its already part of wilc_vif
struct.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Move the static variable as part of 'wilc' priv struct.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cleanup code to remove the variables related to setting and getting IP
address as this case was not handled from firmware side.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use short variable names to avoid line over 80 chars checkpatch warning
in tcp_process().
struct pending_acks_info --> struct pending_ack
int tcp_pending_ack_idx --> int ack_idx
u32 pending_ack --> u32 pending_ack_idx
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Avoid use of static variables and move them as part of wilc_vif struct.
Move all the parameters related to tcp_ack_filter algo to wilc_vif
struct.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cleanup patch to use lowercase name for get_BSSID() and HIL variable.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor tcp_process() to avoid unnecessary leading tabs in the
function.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Avoid use of static variable and move 'rcv_assoc_resp' as part of
'hif_drv' struct. Rename from 'rcv_assoc_resp' to 'assoc_resp'.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cleanup patch to use appropriate variable name to fetch the periodic
statistics.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor code to move 'periodic_rssi' as part of wilc_vif struct. Move
'dummy_statistics' from 'wilc' struct to 'wilc_vif' to maintain for
each interface separately.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Avoid use of static variable hif_workqueue and move it inside 'wilc'
structure.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the code to avoid use of 'wilc_set_multicast_list' global
variable. Allocate the memory required to keep the multicast mac address
and pass it to the worker thread.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Avoid use of static variable 'clients_count' and move it part of 'wilc'
structure.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cleanup patch to avoid the avoid extra 'if' condition and clubbed the
same condition in single 'if' block.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
After code refactor in previous commit now 'op_ifcs' is not require any
more, so remove it.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Avoid use of static variables and moved the varibles as part of private
data. last_scanned_shadow & last_scanned_cnt variable is moved to
'wilc_priv' to maintain for each interface. After moving static
variable, clear_shadow_scan() doesn't require check 'op_ifcs'
count as now for each interface the againg timer is initiated.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cleanup patch to remove the unnecessary NULL check before freeing up ies
information in clear_shadow_scan().
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes to use correct index to free the allocated memory for ies
information. The check was done using 'last_scanned_cnt' index and its
not correct, so use the correct index ('i') to check for before freeing
the allocated memory.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Moved 'aging_timer' to wilc_priv struct instead of having it as static
variable.
As 'aging_timer' is maintained for each interfaces so 'op_ifcs' check is
not required before the timer_setup() and del_timer_sync() call.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Instead of having 'wilc_enable_ps' as global variable moved it to 'wilc'
structure. Rename 'wilc_enable_ps' to 'enable_ps' as its already part of
'wilc' structure
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Currently szLine[i] is being accessed before the index i is being
ranged checked. Fix this by checking the range first. Also, evaluate
the length of the string szLine just once rather than multiple times and
move the loop variable i to an inner scope and make it an int.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix checkpatch.pl errors that missing space before ','.
Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the typedef directive from enumerated type opt_rst_type_e,
this change clears the checkpatch issue with defining new types in
the code.
This is a coding style change which should not impact runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the typedef directive from enumerated type firmware_init_step_e
this clears the checkpatch issue with adding new types to the code.
This is a coding style change which should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The MACRO GET_COMMAND_PACKET_FRAG_THRESHOLD causes a number of
checkpatch issues so has been refactored to use braces around the
parameter 'v' to avoid precedence issues, and to add spaces around
operators.
These changes are coding style changes which should have no impact
on runtime code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The defined constant RTL8190_CPU_START_OFFSET is not used in the code
so has been removed. This is a coding style change which should have
no impact on runtime code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the spacing issues, remove space after cast operation, and replace
spaces at start of line with tab.
These changes are purely coding style changes to resolve checkpatch
issues. There should be no impact on runtime code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the MACRO RT_TRACE to add parentheses around the parameter
'component', this clears the checkpatch warning with respect to
precedence issues.
This is a coding style change which should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rename the MACRO Rx_Smooth_Factor to RX_SMOOTH_FACTOR, this clears the
checkpatch issue with CamelCase naming.
This is a coding style change which should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rename the MACRO RTL819xU_MODULE_NAME to RTL819XU_MODULE_NAME, this
clears the checkpatch issue with CamelCase naming.
This is a coding style change which should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add SPDX-License-Identifier tag to the start of header file. This is
a coding style change which should have no impact on runtime code
execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove unused function declarations. This is a coding style change
which should have no impact on runtime code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the function read_cam(), as it is unused in code.
Simple style change which should not impact runtime code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the function write_cam() as it is unused.
Simple style change which should not impact runtime code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>