- Apr 07, 2021
-
-
Fabio Aiuto authored
fix the following post-commit hook checkpatch warning: WARNING: Comparisons should place the constant on the right side of the test 683: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2204: + if (_SUCCESS != rtw_set_chplan_cmd(padapter, channel_plan_req, 1, 1)) Signed-off-by:
Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/41c98d13d5c74b1329ae125f097b780745cf8246.1617802415.git.fabioaiuto83@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio Aiuto authored
fix following post-commit hook checkpatch warnings: CHECK: Comparison to NULL could be written "!psta" 97: FILE: drivers/staging/rtl8723bs/core/rtw_ap.c:2115: + if (psta == NULL) Signed-off-by:
Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/0c6d53c851d1b07eb0183108e0bad7b4f273f04b.1617802415.git.fabioaiuto83@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio Aiuto authored
remove all if-else empty {} blocks left by spatch application. removed unused variables and an unused static function definition after if-else blocks removal, to suppress compiler warnings. Signed-off-by:Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/56055b20bc064d7ac1e8f14bd1ed42aba6b02c36.1617802415.git.fabioaiuto83@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio Aiuto authored
remove DBG_781X macro definitions. Remove all of the DBG_871X logs as they currently do nothing as they require the code to be modified by hand in order to be turned on. This obviously has not happened since the code was merged, so just remove them as they are unused. Signed-off-by:
Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/53632cddb1da639c84fa52c2818904b0e1298a6e.1617802415.git.fabioaiuto83@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio Aiuto authored
remove all commented out DBG_871X logs unmatched by semantic patch. Signed-off-by:
Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/125e216e3bb5bc938e06b15dadfbbf51d9517dde.1617802415.git.fabioaiuto83@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio Aiuto authored
Remove a DBG_871X log untouched by cocci, maybe due to the presence of a trailing \, for it is inside a macro definition. Signed-off-by:
Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/740bf0eeef550de36e772bdf7d051499627773e5.1617802415.git.fabioaiuto83@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio Aiuto authored
Remove all of the DBG_871X logs as they currently do nothing as they require the code to be modified by hand in order to be turned on. This obviously has not happened since the code was merged, so just remove them as they are unused. applied the following semantic patch script: @@ expression a, b, c, d, e, f, g, h, i, j, k; constant B, C, D, E; @@ ( - DBG_871X(a); | - DBG_871X(a, b); | - DBG_871X(a, B); | - DBG_871X(a, b, c); | - DBG_871X(a, B, c); | - DBG_871X(a, b, C); | - DBG_871X(a, B, C); | - DBG_871X(a, b, c, d); | - DBG_871X(a, B, c, d); | - DBG_871X(a, b, C, d); | - DBG_871X(a, b, c, D); | - DBG_871X(a, B, C, d); | - DBG_871X(a, B, c, D); | - DBG_871X(a, b, C, D); | - DBG_871X(a, B, C, D); | - DBG_871X(a, b, c, d, e); | - DBG_871X(a, B, c, d, e); | - DBG_871X(a, b, C, d, e); | - DBG_871X(a, b, c, D, e); | - DBG_871X(a, b, c, d, E); | - DBG_871X(a, B, C, d, e); | - DBG_871X(a, B, c, D, e); | - DBG_871X(a, B, c, d, E); | - DBG_871X(a, b, C, D, e); | - DBG_871X(a, b, C, d, E); | - DBG_871X(a, b, c, D, E); | - DBG_871X(a, B, C, D, e); | - DBG_871X(a, B, C, d, E); | - DBG_871X(a, B, c, D, E); | - DBG_871X(a, b, C, D, E); | - DBG_871X(a, B, C, D, E); | - DBG_871X(a, b, c, d, e, f); | - DBG_871X(a, b, c, d, e, f, g); | - DBG_871X(a, b, c, d, e, f, g, h); | - DBG_871X(a, b, c, d, e, f, g, h, i); | - DBG_871X(a, b, c, d, e, f, g, h, i, j); | - DBG_871X(a, b, c, d, e, f, g, h, i, j, k); ) Signed-off-by:
Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/89a39f551107ba73b44dd2422765cf8ce371501a.1617802415.git.fabioaiuto83@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio Aiuto authored
This patch prepares the application of the semantic patch aimed to remove all DBG_871X logs. One occurrence of the DBG_871X macro has one repeated argument, that's not even comma separated value with the previous one nor a format string parameter associated. In normal conditions this worked, for the macro is usually not expanded (the do nothing behaviour), but if I try to apply the sempantic patch to remove all macro occurrences, all macros call after that abnormal declaration are left untouched (not removed). Remove all of the DBG_871X logs as they currently do nothing as they require the code to be modified by hand in order to be turned on. This obviously has not happened since the code was merged, so just remove them as they are unused. Signed-off-by:
Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/3473925ae9ee5a3bcd0ab86613dbce80b6d3f33f.1617802415.git.fabioaiuto83@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
The definition of the `unittest_fptr` function pointer type has the wrong function return type `void *` instead of `void`. The problem is hidden by a bunch of unnecessary type-casts. Fix the type definition and remove the type-casts. Cc: Spencer E. Olson <olsonse@umich.edu> Signed-off-by:
Ian Abbott <abbotti@mev.co.uk> Link: https://lore.kernel.org/r/20210407140142.447250-6-abbotti@mev.co.uk Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
Fix checkpatch.pl issues such as the following: CHECK: Lines should not end with a '(' + unittest( Cc: Spencer E. Olson <olsonse@umich.edu> Signed-off-by:Ian Abbott <abbotti@mev.co.uk> Link: https://lore.kernel.org/r/20210407140142.447250-5-abbotti@mev.co.uk Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
Rename the `RVi` macro to `RVI` to avoid this checkpatch.pl issue: CHECK: #27: FILE: drivers/staging/comedi/drivers/tests/ni_routes_test.c:27: +#define RVi(table, src, dest) ((table)[(dest) * NI_NUM_NAMES + (src)]) Cc: Spencer E. Olson <olsonse@umich.edu> Signed-off-by:
Ian Abbott <abbotti@mev.co.uk> Link: https://lore.kernel.org/r/20210407140142.447250-4-abbotti@mev.co.uk Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
Fix checkpatch.pl errors such as: ERROR: Macros with complex values should be enclosed in parentheses +#define I1(x1) \ + (int[]){ \ + x1, 0 \ + } Also, wrap that `x1` in parentheses. Cc: Spencer E. Olson <olsonse@umich.edu> Signed-off-by:Ian Abbott <abbotti@mev.co.uk> Link: https://lore.kernel.org/r/20210407140142.447250-3-abbotti@mev.co.uk Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
The `ni_routes_test` module is not currently selectable using the Kconfig files, but can be built by specifying `CONFIG_COMEDI_TESTS=m` on the "make" command line. It currently fails to compile due to an extra parameter added to the `ni_assign_device_routes` function by commit e3b7ce73 ("staging: comedi: ni_routes: Allow alternate board name for routes"). Fix it by supplying the value `NULL` for the added `alt_board_name` parameter (which specifies that there is no alternate board name). Fixes: e3b7ce73 ("staging: comedi: ni_routes: Allow alternate board name for routes") Cc: Spencer E. Olson <olsonse@umich.edu> Signed-off-by:
Ian Abbott <abbotti@mev.co.uk> Link: https://lore.kernel.org/r/20210407140142.447250-2-abbotti@mev.co.uk Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Colin Ian King authored
There is a spelling mistake in a comment. Fix it. Signed-off-by:
Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210407111301.486853-1-colin.king@canonical.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio M. De Francesco authored
Remove camelcase. Issue detected by checkpatch.pl. The symbols aren't used in other files, so this change doesn't break the driver's code. Signed-off-by:
Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210407100410.8058-1-fmdefrancesco@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
This driver does not set URB_ZERO_PACKET. The rtl8188eu driver that's available from Realtek/Edimax has some commented-out code that sets zero packet. It was removed from this driver before it was imported. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-11-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Remove unnecessary variable, summarize declaration and assignment. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-10-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Remove unnecessary variable, summarize declaration and assignment. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-9-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Remove unnecessary variable, summarize declaration and assignment. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-8-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Remove unnecessary variable, summarize declaration and assignment. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-7-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Remove unnecessary variable, summarize declaration and assignment. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-6-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Remove unnecessary variable, summarize declaration and assignment. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-5-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
At the moment, usbctrl_vendorreq's requesttype parameter must be set to 1 for reading and 0 for writing. It's then converted to the actual bmRequestType for the USB control request. We can simplify the code and avoid this conversion if the caller passes the actual bmRequestType. We already have defines for the read and write request types. Move them to usb_ops_linux.c, they're used only inside this file. Replace the numeric values with USB constants to make their meaning clearer. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-4-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
The index for rtl8188eu's vendor-specific control requests is not used. Remove the index parameter from usbctrl_vendorreq and pass index 0 to usb_control_msg. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-3-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
The bRequest value for the vendor specific control requests sent by this driver is always 0x05. Replace the function parameter with a define. Use the same define as the rtlwifi driver. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-2-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
struct hal_data_8188e contains some components related to efuses which are not used for rtl8188eu. Signed-off-by:
Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210406204829.18130-1-martin@kaiser.cx Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vardhan H G authored
When comparing a constant with variable, it is recommeneded to have the constant on the right side of the test. This patch silences the following checkpatch.pl warning: "Comparisons should place the constant on the right side of the test" Signed-off-by:
Vardhan H G <crazylonestar7@gmail.com> Link: https://lore.kernel.org/r/20210407061749.13460-1-crazylonestar7@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiapeng Chong authored
Fix the following gcc warning: drivers/staging/rtl8192u/r8192U_core.c:3419:6: warning: variable ‘reset_status’ set but not used [-Wunused-but-set-variable]. Reported-by:
Abaci Robot <abaci@linux.alibaba.com> Signed-off-by:
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/1617775650-42645-1-git-send-email-jiapeng.chong@linux.alibaba.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiapeng Chong authored
Fix the following gcc warning: drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:693:15: warning: variable ‘tmpRegC’ set but not used [-Wunused-but-set-variable]. Reported-by:
Abaci Robot <abaci@linux.alibaba.com> Signed-off-by:
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/1617767558-114050-1-git-send-email-jiapeng.chong@linux.alibaba.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Christophe JAILLET authored
Some constants defined in wifi.h are already defined in <linux/ieee80211.h> with some other (but similar) names. Be consistent and use the ones from <linux/ieee80211.h>. The conversions made are: _SSID_IE_ --> WLAN_EID_SSID _SUPPORTEDRATES_IE_ --> WLAN_EID_SUPP_RATES _DSSET_IE_ --> WLAN_EID_DS_PARAMS _IBSS_PARA_IE_ --> WLAN_EID_IBSS_PARAMS _ERPINFO_IE_ --> WLAN_EID_ERP_INFO _EXT_SUPPORTEDRATES_IE_ --> WLAN_EID_EXT_SUPP_RATES _HT_CAPABILITY_IE_ --> WLAN_EID_HT_CAPABILITY _HT_EXTRA_INFO_IE_ --> WLAN_EID_HT_OPERATION (not used) _HT_ADD_INFO_IE_ --> WLAN_EID_HT_OPERATION _VENDOR_SPECIFIC_IE_ --> WLAN_EID_VENDOR_SPECIFIC _RESERVED47_ --> (not used) Signed-off-by:
Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/fe35fb45323adc3a30f31b7280cec7700fd325d8.1617741313.git.christophe.jaillet@wanadoo.fr Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Zhansaya Bagdauletkyzy authored
Move constant variables to the right side of comparisons to increase consistency with Linux kernel code base. Reported by checkpatch. Signed-off-by:
Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com> Link: https://lore.kernel.org/r/20210406161131.GA103324@zhans Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio M. De Francesco authored
Added spaces around operators in file HalBtc8723b1Ant.h. Issue detected by checkpatch.pl. Spaces are preferred to improve readibility. Signed-off-by:
Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210406164001.13646-1-fmdefrancesco@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio M. De Francesco authored
Added spaces around operators in file HalBtc8723b2Ant.c. Issue detected by checkpatch.pl. Spaces are preferred to improve readibility. Signed-off-by:
Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210406170011.20753-1-fmdefrancesco@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio M. De Francesco authored
Added spaces around operators. Issue detected by checkpatch.pl. Spaces around operators are preferred to improve readibility. Signed-off-by:
Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210406181428.15097-1-fmdefrancesco@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Beatriz Martins de Carvalho authored
Cleans up warnings of "line over 100 characters" but avoiding more than 90 characters in file rtw_ap.c Signed-off-by:
Beatriz Martins de Carvalho <martinsdecarvalhobeatriz@gmail.com> Link: https://lore.kernel.org/r/20210406155815.90271-1-martinsdecarvalhobeatriz@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio M. De Francesco authored
Added spaces around operators in file HalBtc8723b1Ant.c. Issue detected by checkpatch.pl. Spaces are preferred to improve readibility. Signed-off-by:
Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210406154635.23191-1-fmdefrancesco@gmail.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Greg Kroah-Hartman authored
Merge tag 'iio-for-5.13b-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: 2nd set of IIO features, cleanups etc for 5.13 Trying again as a wrong fixes tag managed to beat the checking script I was running. A few of these are fixes for major rework earlier in cycle. Bulk of patches are the ad7150 pre graduation cleanup, some link fixes in maintainers and set using the new IRQF_NO_AUTOEN flag. Note includes a merge of a tag from tip to get the IRQF_NO_AUTOEN support (one patch only from Barry Song) Staging graduation * adi,ad7150 CDC - A lot of precursor patches cleaning it up first. - Includes core support for timeout event ABI where after a time a adaptive threshold jumps to fix slow tracking problems. Cleanups and minor / late breaking fixes * core - Use sysfs_emit() and sysfs_emit_at() as appropriate - Fix a bug introduced in this cycle for iio_read_channel_processed_scale() - Fix handling of getfd ioctl as IIO_IOCTL_UNHANDLED is a valid ioctl number - Tidy up some pointless type conversion in string formatting and odd indentation. * dac - Use sysfs_emit() for powerdown attribute show() functions. * docs - Fix dead links due to txt to yaml binding conversions. * treewide - Use IRQF_NO_AUTOEN * various - Typo fixes in comments. * triggers/hr-timer-trigger - Fix an overflow handing issue. * ad,ad7923 - Device managed functions in probe() * ad,ad9467 - Fix kconfig dependency issue * adi,adis16201 - Fix a wrong axis assignment that stops the driver loading. * invensense,mpu6050 - Allow use as a standalone trigger (no channels enabled) - Drop unnecessary manual assignment of indio_dev->modes - Make device function in a basic way if no interrupt wired. - Sanity check scale writes. * semtech,sx9310 - Fix access to a variable length array in DT binding. - Sanity check input before writing debounce register. * st,stm32-dfsdm - Drop __func__ from dev_dbg() and pr_debug(). * yamaha,yas530 - Include asm/unaligned.h instead of be_byteshift.h - Fix an issue with return value on an error path. * tag 'iio-for-5.13b-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (76 commits) iio: inv_mpu6050: Fully validate gyro and accel scale writes iio: sx9310: Fix write_.._debounce() iio: sx9310: Fix access to variable DT array iio: adc: Kconfig: make AD9467 depend on ADI_AXI_ADC symbol iio: magnetometer: yas530: Include right header iio: magnetometer: yas530: Fix return value on error path iio:cdc:ad7150: Fix use of uninitialized ret iio: hrtimer-trigger: Fix potential integer overflow in iio_hrtimer_store_sampling_frequency iio:adc: Fix trivial typo iio:adc:ad7476: Fix remove handling iio:adc:ad_sigma_delta: Use IRQF_NO_AUTOEN rather than request and disable iio:imu:adis: Use IRQF_NO_AUTOEN instead of irq request then disable iio:chemical:scd30: Use IRQF_NO_AUTOEN to avoid irq request then disable iio:adc:sun4i-gpadc: Use new IRQF_NO_AUTOEN flag instead of request then disable iio:adc:nau7802: Use IRQF_NO_AUTOEN instead of request then disable iio:adc:exynos-adc: Use new IRQF_NO_AUTOEN flag rather than separate irq_disable() iio:adc:ad7766: Use new IRQF_NO_AUTOEN to reduce boilerplate iio: buffer: use sysfs_attr_init() on allocated attrs iio: trigger: Fix strange (ladder-type) indentation iio: trigger: Replace explicit casting and wrong specifier with proper one ...
-
Lars-Peter Clausen authored
When setting the gyro or accelerometer scale the inv_mpu6050 driver ignores the integer part of the value. As a result e.g. all of 0.13309, 1.13309, 12345.13309, ... are accepted as a valid gyro scale and 0.13309 is the scale that gets set in all those cases. Make sure to check that the integer part of the scale value is 0 and reject it otherwise. Fixes: 09a642b7 ("Invensense MPU6050 Device Driver.") Signed-off-by:
Lars-Peter Clausen <lars@metafoo.de> Acked-by:
Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Link: https://lore.kernel.org/r/20210405114441.24167-1-lars@metafoo.de Cc: <Stable@vger.kernel.org> Signed-off-by:
Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Gwendal Grignou authored
Check input to be sure it matches Semtech sx9310 specification and can fit into debounce register. Compare argument writen to thresh_.._period with read from same sysfs attribute: Before: Afer: write | read write | read -1 | 8 -1 fails: -EINVAL 0 | 8 0 | 0 1 | 0 1 | 0 2..15 | 2^log2(N) 2..15 | 2^log2(N) 16 | 0 >= 16 fails: -EINVAL Fixes: 1b687201 ("iio: sx9310: Support setting debounce values") Signed-off-by:
Gwendal Grignou <gwendal@chromium.org> Cc: stable@vger.kernel.org Reviewed-by:
Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210331182222.219533-1-gwendal@chromium.org Signed-off-by:
Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Gwendal Grignou authored
With the current code, we want to read 4 entries from DT array "semtech,combined-sensors". If there are less, we silently fail as of_property_read_u32_array() returns -EOVERFLOW. First count the number of entries and if between 1 and 4, collect the content of the array. Fixes: 5b19ca2c ("iio: sx9310: Set various settings from DT") Signed-off-by:
Gwendal Grignou <gwendal@chromium.org> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210326184603.251683-2-gwendal@chromium.org Cc: <stable@vger.kernel.org> Signed-off-by:
Jonathan Cameron <Jonathan.Cameron@huawei.com>
-