2020-07-17 16:59:28

by Lee Jones

[permalink] [raw]
Subject: [PATCH 00/30] Second batch of W=1 fixes for IIO

This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

Only a couple left after this. I'll sort those next week.

Lee Jones (30):
iio: adc: ti_am335x_adc: Remove a couple of unused 'read' variables
iio: adc: twl4030-madc: Remove set but unused variables 'len'
iio: adc: twl4030-madc: Fix misnamed struct attribute
iio: magnetometer: hmc5843: 'hmc5843_pm_ops' is unused in 1 of 3 files
including hmc5843_core.h
iio: adc: twl6030-gpadc: Fix some misdocumentation and formatting
issues
iio: dac: ltc2632: Fix formatting in kerneldoc struct header
iio: light: si1145: Demote obvious misuse of kerneldoc to standard
comment blocks
iio: resolver: ad2s1200: Change ordering of compiler attribute macro
iio: temperature: mlx90632: Function parameter descriptions must match
exactly
iio: light: us5182d: Fix formatting in kerneldoc function block
iio: adc: ad799x: Demote seemingly unintentional kerneldoc header
iio: dac: ad5504: Fix formatting errors and demote non-compliant
kerneldoc
iio: adc: at91_adc: Fix 'bad line' warning
iio: adc: at91-sama5d2_adc: Struct kerneldoc titles need to start with
'struct '
iio: adc: cpcap-adc: Demote seemingly unintentional kerneldoc header
iio: accel: sca3000: Fix 2 misspellings and demote nonconforming
kerneldocs
iio: gyro: adxrs450: Change ordering of compiler attribute macro
iio: gyro: fxas21002c: Move 'fxas21002c_reg_fields' to the only file
its used
iio: imu: st_lsm6dsx: st_lsm6dsx: Reorder 'inline' declaration
iio: adc: max1363: Fix kerneldoc attribute formatting for 'lock'
iio: adc: max9611: Demote obvious misuse of kerneldoc to standard
comment blocks
iio: adc: mcp320x: Change ordering of compiler attribute macro
iio: adc: palmas_gpadc: Demote non-conforming kerneldoc header
iio: imu: inv_mpu6050: inv_mpu_core: Demote obvious misuse of
kerneldoc to standard comment blocks
iio: imu: inv_mpu6050: inv_mpu_ring: Demote seemingly unintentional
kerneldoc header
iio: adc: qcom-pm8xxx-xoadc: Demote standard comment block and supply
missing description
iio: magnetometer: ak8974: Add description for ak8974's 'scan'
attribute
iio: imu: st_lsm6dsx: st_lsm6dsx_shub: Demote obvious misuse of
kerneldoc to standard comment blocks
iio: imu: st_lsm6dsx: st_lsm6dsx: Mark 'st_lsm6dsx_accel_ext_info' as
__maybe_unused
iio: adc: rockchip_saradc: Demote Demote seemingly unintentional
kerneldoc header

drivers/iio/accel/sca3000.c | 12 ++--
drivers/iio/adc/ad799x.c | 2 +-
drivers/iio/adc/at91-sama5d2_adc.c | 4 +-
drivers/iio/adc/at91_adc.c | 2 +-
drivers/iio/adc/cpcap-adc.c | 6 +-
drivers/iio/adc/max1363.c | 2 +-
drivers/iio/adc/max9611.c | 4 +-
drivers/iio/adc/mcp320x.c | 2 +-
drivers/iio/adc/palmas_gpadc.c | 3 +-
drivers/iio/adc/qcom-pm8xxx-xoadc.c | 3 +-
drivers/iio/adc/rockchip_saradc.c | 2 +-
drivers/iio/adc/ti_am335x_adc.c | 8 +--
drivers/iio/adc/twl4030-madc.c | 14 ++---
drivers/iio/adc/twl6030-gpadc.c | 4 +-
drivers/iio/dac/ad5504.c | 7 +--
drivers/iio/dac/ltc2632.c | 6 +-
drivers/iio/gyro/adxrs450.c | 2 +-
drivers/iio/gyro/fxas21002c.h | 66 --------------------
drivers/iio/gyro/fxas21002c_core.c | 66 ++++++++++++++++++++
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 14 ++---
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 2 +-
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 5 +-
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 8 +--
drivers/iio/light/si1145.c | 6 +-
drivers/iio/light/us5182d.c | 8 +--
drivers/iio/magnetometer/ak8974.c | 1 +
drivers/iio/magnetometer/hmc5843.h | 6 +-
drivers/iio/resolver/ad2s1200.c | 2 +-
drivers/iio/temperature/mlx90632.c | 4 +-
29 files changed, 136 insertions(+), 135 deletions(-)

--
2.25.1


2020-07-17 16:59:33

by Lee Jones

[permalink] [raw]
Subject: [PATCH 03/30] iio: adc: twl4030-madc: Fix misnamed struct attribute

Fixes the following W=1 kernel build warning(s):

drivers/iio/adc/twl4030-madc.c:170: warning: Function parameter or member 'usb3v1' not described in 'twl4030_madc_data'

Cc: J Keerthy <[email protected]>
Cc: Mikko Ylinen <[email protected]>
Cc: Amit Kucheria <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/iio/adc/twl4030-madc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 826d8295e9b3c..882a678b44690 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -153,7 +153,7 @@ enum sample_type {
* struct twl4030_madc_data - a container for madc info
* @dev: Pointer to device structure for madc
* @lock: Mutex protecting this data structure
- * @regulator: Pointer to bias regulator for madc
+ * @usb3v1: Pointer to bias regulator for madc
* @requests: Array of request struct corresponding to SW1, SW2 and RT
* @use_second_irq: IRQ selection (main or co-processor)
* @imr: Interrupt mask register of MADC
@@ -161,7 +161,7 @@ enum sample_type {
*/
struct twl4030_madc_data {
struct device *dev;
- struct mutex lock; /* mutex protecting this data structure */
+ struct mutex lock;
struct regulator *usb3v1;
struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
bool use_second_irq;
--
2.25.1

2020-07-17 17:00:21

by Lee Jones

[permalink] [raw]
Subject: [PATCH 23/30] iio: adc: palmas_gpadc: Demote non-conforming kerneldoc header

Very few of the struct attributes have been documented here.

Fixes the following W=1 kernel build warning(s):

drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'dev' not described in 'palmas_gpadc'
drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'palmas' not described in 'palmas_gpadc'
drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'irq' not described in 'palmas_gpadc'
drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'irq_auto_0' not described in 'palmas_gpadc'
drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'irq_auto_1' not described in 'palmas_gpadc'
drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'adc_info' not described in 'palmas_gpadc'
drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'conv_completion' not described in 'palmas_gpadc'
drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'wakeup1_data' not described in 'palmas_gpadc'
drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'wakeup2_data' not described in 'palmas_gpadc'
drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'wakeup1_enable' not described in 'palmas_gpadc'
drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'wakeup2_enable' not described in 'palmas_gpadc'

Cc: Pradeep Goudagunta <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/iio/adc/palmas_gpadc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c
index 46e595eb889fa..81b0a76a767e8 100644
--- a/drivers/iio/adc/palmas_gpadc.c
+++ b/drivers/iio/adc/palmas_gpadc.c
@@ -76,7 +76,7 @@ static struct palmas_gpadc_info palmas_gpadc_info[] = {
PALMAS_ADC_INFO(IN15, 0, 0, 0, 0, INVALID, INVALID, true),
};

-/**
+/*
* struct palmas_gpadc - the palmas_gpadc structure
* @ch0_current: channel 0 current source setting
* 0: 0 uA
@@ -94,7 +94,6 @@ static struct palmas_gpadc_info palmas_gpadc_info[] = {
* This is the palmas_gpadc structure to store run-time information
* and pointers for this driver instance.
*/
-
struct palmas_gpadc {
struct device *dev;
struct palmas *palmas;
--
2.25.1

2020-07-17 17:00:25

by Lee Jones

[permalink] [raw]
Subject: [PATCH 06/30] iio: dac: ltc2632: Fix formatting in kerneldoc struct header

Kerneldoc expects attributes/parameters to be in '@*.: ' format.

Fixes the following W=1 kernel build warning(s):

drivers/iio/dac/ltc2632.c:50: warning: Function parameter or member 'powerdown_cache_mask' not described in 'ltc2632_state'
drivers/iio/dac/ltc2632.c:50: warning: Function parameter or member 'vref_mv' not described in 'ltc2632_state'
drivers/iio/dac/ltc2632.c:50: warning: Function parameter or member 'vref_reg' not described in 'ltc2632_state'

Cc: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: "Uwe Kleine-König" <[email protected]>
Cc: Silvan Murer <[email protected]>
Cc: Maxime Roussin-Belanger <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/iio/dac/ltc2632.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c
index f891311f05cfe..733f13d3e5df4 100644
--- a/drivers/iio/dac/ltc2632.c
+++ b/drivers/iio/dac/ltc2632.c
@@ -38,9 +38,9 @@ struct ltc2632_chip_info {
/**
* struct ltc2632_state - driver instance specific data
* @spi_dev: pointer to the spi_device struct
- * @powerdown_cache_mask used to show current channel powerdown state
- * @vref_mv used reference voltage (internal or external)
- * @vref_reg regulator for the reference voltage
+ * @powerdown_cache_mask: used to show current channel powerdown state
+ * @vref_mv: used reference voltage (internal or external)
+ * @vref_reg: regulator for the reference voltage
*/
struct ltc2632_state {
struct spi_device *spi_dev;
--
2.25.1

2020-07-17 17:00:33

by Lee Jones

[permalink] [raw]
Subject: [PATCH 18/30] iio: gyro: fxas21002c: Move 'fxas21002c_reg_fields' to the only file its used

'fxas21002c_reg_fields' is only used in '*core*', meaning that '*i2c*'
and '*spi*' complain of a defined but not used const variable. Let's
move it into the source file.

Fixes the following W=1 kernel build warning(s):

In file included from drivers/iio/gyro/fxas21002c_i2c.c:14:
drivers/iio/gyro/fxas21002c.h:79:31: warning: ‘fxas21002c_reg_fields’ defined but not used [-Wunused-const-variable=]
79 | static const struct reg_field fxas21002c_reg_fields[] = {
| ^~~~~~~~~~~~~~~~~~~~~
In file included from drivers/iio/gyro/fxas21002c_spi.c:14:
drivers/iio/gyro/fxas21002c.h:79:31: warning: ‘fxas21002c_reg_fields’ defined but not used [-Wunused-const-variable=]
79 | static const struct reg_field fxas21002c_reg_fields[] = {
| ^~~~~~~~~~~~~~~~~~~~~

Cc: Rui Miguel Silva <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/iio/gyro/fxas21002c.h | 66 ------------------------------
drivers/iio/gyro/fxas21002c_core.c | 66 ++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+), 66 deletions(-)

diff --git a/drivers/iio/gyro/fxas21002c.h b/drivers/iio/gyro/fxas21002c.h
index 566d92de26763..c81cecee121cb 100644
--- a/drivers/iio/gyro/fxas21002c.h
+++ b/drivers/iio/gyro/fxas21002c.h
@@ -76,72 +76,6 @@ enum fxas21002c_fields {
F_MAX_FIELDS,
};

-static const struct reg_field fxas21002c_reg_fields[] = {
- [F_DR_STATUS] = REG_FIELD(FXAS21002C_REG_STATUS, 0, 7),
- [F_OUT_X_MSB] = REG_FIELD(FXAS21002C_REG_OUT_X_MSB, 0, 7),
- [F_OUT_X_LSB] = REG_FIELD(FXAS21002C_REG_OUT_X_LSB, 0, 7),
- [F_OUT_Y_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_MSB, 0, 7),
- [F_OUT_Y_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_LSB, 0, 7),
- [F_OUT_Z_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_MSB, 0, 7),
- [F_OUT_Z_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_LSB, 0, 7),
- [F_ZYX_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 7, 7),
- [F_Z_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 6, 6),
- [F_Y_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 5, 5),
- [F_X_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 4, 4),
- [F_ZYX_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 3, 3),
- [F_Z_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 2, 2),
- [F_Y_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 1, 1),
- [F_X_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 0, 0),
- [F_OVF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 7, 7),
- [F_WMKF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 6, 6),
- [F_CNT] = REG_FIELD(FXAS21002C_REG_F_STATUS, 0, 5),
- [F_MODE] = REG_FIELD(FXAS21002C_REG_F_SETUP, 6, 7),
- [F_WMRK] = REG_FIELD(FXAS21002C_REG_F_SETUP, 0, 5),
- [F_EVENT] = REG_FIELD(FXAS21002C_REG_F_EVENT, 5, 5),
- [FE_TIME] = REG_FIELD(FXAS21002C_REG_F_EVENT, 0, 4),
- [F_BOOTEND] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 3, 3),
- [F_SRC_FIFO] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 2, 2),
- [F_SRC_RT] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 1, 1),
- [F_SRC_DRDY] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 0, 0),
- [F_WHO_AM_I] = REG_FIELD(FXAS21002C_REG_WHO_AM_I, 0, 7),
- [F_BW] = REG_FIELD(FXAS21002C_REG_CTRL0, 6, 7),
- [F_SPIW] = REG_FIELD(FXAS21002C_REG_CTRL0, 5, 5),
- [F_SEL] = REG_FIELD(FXAS21002C_REG_CTRL0, 3, 4),
- [F_HPF_EN] = REG_FIELD(FXAS21002C_REG_CTRL0, 2, 2),
- [F_FS] = REG_FIELD(FXAS21002C_REG_CTRL0, 0, 1),
- [F_ELE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 3, 3),
- [F_ZTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 2, 2),
- [F_YTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 1, 1),
- [F_XTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 0, 0),
- [F_EA] = REG_FIELD(FXAS21002C_REG_RT_SRC, 6, 6),
- [F_ZRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 5, 5),
- [F_ZRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 4, 4),
- [F_YRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 3, 3),
- [F_YRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 2, 2),
- [F_XRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 1, 1),
- [F_XRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 0),
- [F_DBCNTM] = REG_FIELD(FXAS21002C_REG_RT_THS, 7, 7),
- [F_THS] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 6),
- [F_RT_COUNT] = REG_FIELD(FXAS21002C_REG_RT_COUNT, 0, 7),
- [F_TEMP] = REG_FIELD(FXAS21002C_REG_TEMP, 0, 7),
- [F_RST] = REG_FIELD(FXAS21002C_REG_CTRL1, 6, 6),
- [F_ST] = REG_FIELD(FXAS21002C_REG_CTRL1, 5, 5),
- [F_DR] = REG_FIELD(FXAS21002C_REG_CTRL1, 2, 4),
- [F_ACTIVE] = REG_FIELD(FXAS21002C_REG_CTRL1, 1, 1),
- [F_READY] = REG_FIELD(FXAS21002C_REG_CTRL1, 0, 0),
- [F_INT_CFG_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 7, 7),
- [F_INT_EN_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 6, 6),
- [F_INT_CFG_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 5, 5),
- [F_INT_EN_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 4, 4),
- [F_INT_CFG_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 3, 3),
- [F_INT_EN_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 2, 2),
- [F_IPOL] = REG_FIELD(FXAS21002C_REG_CTRL2, 1, 1),
- [F_PP_OD] = REG_FIELD(FXAS21002C_REG_CTRL2, 0, 0),
- [F_WRAPTOONE] = REG_FIELD(FXAS21002C_REG_CTRL3, 3, 3),
- [F_EXTCTRLEN] = REG_FIELD(FXAS21002C_REG_CTRL3, 2, 2),
- [F_FS_DOUBLE] = REG_FIELD(FXAS21002C_REG_CTRL3, 0, 0),
-};
-
extern const struct dev_pm_ops fxas21002c_pm_ops;

int fxas21002c_core_probe(struct device *dev, struct regmap *regmap, int irq,
diff --git a/drivers/iio/gyro/fxas21002c_core.c b/drivers/iio/gyro/fxas21002c_core.c
index 89d2bb2282eac..f20033afc714c 100644
--- a/drivers/iio/gyro/fxas21002c_core.c
+++ b/drivers/iio/gyro/fxas21002c_core.c
@@ -42,6 +42,72 @@ enum fxas21002c_mode_state {

#define FXAS21002C_AXIS_TO_REG(axis) (FXAS21002C_REG_OUT_X_MSB + ((axis) * 2))

+static const struct reg_field fxas21002c_reg_fields[] = {
+ [F_DR_STATUS] = REG_FIELD(FXAS21002C_REG_STATUS, 0, 7),
+ [F_OUT_X_MSB] = REG_FIELD(FXAS21002C_REG_OUT_X_MSB, 0, 7),
+ [F_OUT_X_LSB] = REG_FIELD(FXAS21002C_REG_OUT_X_LSB, 0, 7),
+ [F_OUT_Y_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_MSB, 0, 7),
+ [F_OUT_Y_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_LSB, 0, 7),
+ [F_OUT_Z_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_MSB, 0, 7),
+ [F_OUT_Z_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_LSB, 0, 7),
+ [F_ZYX_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 7, 7),
+ [F_Z_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 6, 6),
+ [F_Y_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 5, 5),
+ [F_X_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 4, 4),
+ [F_ZYX_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 3, 3),
+ [F_Z_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 2, 2),
+ [F_Y_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 1, 1),
+ [F_X_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 0, 0),
+ [F_OVF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 7, 7),
+ [F_WMKF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 6, 6),
+ [F_CNT] = REG_FIELD(FXAS21002C_REG_F_STATUS, 0, 5),
+ [F_MODE] = REG_FIELD(FXAS21002C_REG_F_SETUP, 6, 7),
+ [F_WMRK] = REG_FIELD(FXAS21002C_REG_F_SETUP, 0, 5),
+ [F_EVENT] = REG_FIELD(FXAS21002C_REG_F_EVENT, 5, 5),
+ [FE_TIME] = REG_FIELD(FXAS21002C_REG_F_EVENT, 0, 4),
+ [F_BOOTEND] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 3, 3),
+ [F_SRC_FIFO] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 2, 2),
+ [F_SRC_RT] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 1, 1),
+ [F_SRC_DRDY] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 0, 0),
+ [F_WHO_AM_I] = REG_FIELD(FXAS21002C_REG_WHO_AM_I, 0, 7),
+ [F_BW] = REG_FIELD(FXAS21002C_REG_CTRL0, 6, 7),
+ [F_SPIW] = REG_FIELD(FXAS21002C_REG_CTRL0, 5, 5),
+ [F_SEL] = REG_FIELD(FXAS21002C_REG_CTRL0, 3, 4),
+ [F_HPF_EN] = REG_FIELD(FXAS21002C_REG_CTRL0, 2, 2),
+ [F_FS] = REG_FIELD(FXAS21002C_REG_CTRL0, 0, 1),
+ [F_ELE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 3, 3),
+ [F_ZTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 2, 2),
+ [F_YTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 1, 1),
+ [F_XTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 0, 0),
+ [F_EA] = REG_FIELD(FXAS21002C_REG_RT_SRC, 6, 6),
+ [F_ZRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 5, 5),
+ [F_ZRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 4, 4),
+ [F_YRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 3, 3),
+ [F_YRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 2, 2),
+ [F_XRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 1, 1),
+ [F_XRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 0),
+ [F_DBCNTM] = REG_FIELD(FXAS21002C_REG_RT_THS, 7, 7),
+ [F_THS] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 6),
+ [F_RT_COUNT] = REG_FIELD(FXAS21002C_REG_RT_COUNT, 0, 7),
+ [F_TEMP] = REG_FIELD(FXAS21002C_REG_TEMP, 0, 7),
+ [F_RST] = REG_FIELD(FXAS21002C_REG_CTRL1, 6, 6),
+ [F_ST] = REG_FIELD(FXAS21002C_REG_CTRL1, 5, 5),
+ [F_DR] = REG_FIELD(FXAS21002C_REG_CTRL1, 2, 4),
+ [F_ACTIVE] = REG_FIELD(FXAS21002C_REG_CTRL1, 1, 1),
+ [F_READY] = REG_FIELD(FXAS21002C_REG_CTRL1, 0, 0),
+ [F_INT_CFG_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 7, 7),
+ [F_INT_EN_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 6, 6),
+ [F_INT_CFG_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 5, 5),
+ [F_INT_EN_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 4, 4),
+ [F_INT_CFG_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 3, 3),
+ [F_INT_EN_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 2, 2),
+ [F_IPOL] = REG_FIELD(FXAS21002C_REG_CTRL2, 1, 1),
+ [F_PP_OD] = REG_FIELD(FXAS21002C_REG_CTRL2, 0, 0),
+ [F_WRAPTOONE] = REG_FIELD(FXAS21002C_REG_CTRL3, 3, 3),
+ [F_EXTCTRLEN] = REG_FIELD(FXAS21002C_REG_CTRL3, 2, 2),
+ [F_FS_DOUBLE] = REG_FIELD(FXAS21002C_REG_CTRL3, 0, 0),
+};
+
static const int fxas21002c_odr_values[] = {
800, 400, 200, 100, 50, 25, 12, 12
};
--
2.25.1

2020-07-17 17:00:39

by Lee Jones

[permalink] [raw]
Subject: [PATCH 16/30] iio: accel: sca3000: Fix 2 misspellings and demote nonconforming kerneldocs

Fixes the following W=1 kernel build warning(s):

drivers/iio/accel/sca3000.c:210: warning: Function parameter or member 'mot_det_mult_xz' not described in 'sca3000_chip_info'
drivers/iio/accel/sca3000.c:210: warning: Function parameter or member 'mot_det_mult_y' not described in 'sca3000_chip_info'
drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'indio_dev' not described in 'sca3000_read_event_value'
drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'chan' not described in 'sca3000_read_event_value'
drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'type' not described in 'sca3000_read_event_value'
drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'dir' not described in 'sca3000_read_event_value'
drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'info' not described in 'sca3000_read_event_value'
drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'val' not described in 'sca3000_read_event_value'
drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'val2' not described in 'sca3000_read_event_value'
drivers/iio/accel/sca3000.c:1110: warning: Function parameter or member 'indio_dev' not described in 'sca3000_read_event_config'
drivers/iio/accel/sca3000.c:1110: warning: Function parameter or member 'chan' not described in 'sca3000_read_event_config'
drivers/iio/accel/sca3000.c:1110: warning: Function parameter or member 'type' not described in 'sca3000_read_event_config'
drivers/iio/accel/sca3000.c:1110: warning: Function parameter or member 'dir' not described in 'sca3000_read_event_config'

Cc: Christophe JAILLET <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/iio/accel/sca3000.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
index 6e429072e44a4..3952187166ffa 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -186,9 +186,9 @@ struct sca3000_state {
* @option_mode_2_freq: option mode 2 sampling frequency
* @option_mode_2_3db_freq: 3db cutoff frequency of the low pass filter for
* the second option mode.
- * @mod_det_mult_xz: Bit wise multipliers to calculate the threshold
+ * @mot_det_mult_xz: Bit wise multipliers to calculate the threshold
* for motion detection in the x and z axis.
- * @mod_det_mult_y: Bit wise multipliers to calculate the threshold
+ * @mot_det_mult_y: Bit wise multipliers to calculate the threshold
* for motion detection in the y axis.
*
* This structure is used to hold information about the functionality of a given
@@ -859,9 +859,9 @@ static ssize_t sca3000_read_av_freq(struct device *dev,
*/
static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(sca3000_read_av_freq);

-/**
+/*
* sca3000_read_event_value() - query of a threshold or period
- **/
+ */
static int sca3000_read_event_value(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
@@ -1100,9 +1100,9 @@ static irqreturn_t sca3000_event_handler(int irq, void *private)
return IRQ_HANDLED;
}

-/**
+/*
* sca3000_read_event_config() what events are enabled
- **/
+ */
static int sca3000_read_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
--
2.25.1

2020-07-17 17:00:57

by Lee Jones

[permalink] [raw]
Subject: [PATCH 10/30] iio: light: us5182d: Fix formatting in kerneldoc function block

Kerneldoc expects attributes/parameters to be in '@*.: ' format.

Fixes the following W=1 kernel build warning(s):

drivers/iio/light/us5182d.c:457: warning: Function parameter or member 'data' not described in 'us5182d_update_dark_th'
drivers/iio/light/us5182d.c:457: warning: Function parameter or member 'index' not described in 'us5182d_update_dark_th'
drivers/iio/light/us5182d.c:479: warning: Function parameter or member 'data' not described in 'us5182d_apply_scale'
drivers/iio/light/us5182d.c:479: warning: Function parameter or member 'index' not described in 'us5182d_apply_scale'

Cc: Adriana Reus <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/iio/light/us5182d.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/light/us5182d.c b/drivers/iio/light/us5182d.c
index b995f21a33479..24843597beba5 100644
--- a/drivers/iio/light/us5182d.c
+++ b/drivers/iio/light/us5182d.c
@@ -446,8 +446,8 @@ static int us5182d_read_raw(struct iio_dev *indio_dev,

/**
* us5182d_update_dark_th - update Darh_Th registers
- * @data us5182d_data structure
- * @index index in us5182d_dark_ths array to use for the updated value
+ * @data: us5182d_data structure
+ * @index: index in us5182d_dark_ths array to use for the updated value
*
* Function needs to be called with a lock held because it needs two i2c write
* byte operations as these registers (0x27 0x28) don't work in word mode
@@ -469,8 +469,8 @@ static int us5182d_update_dark_th(struct us5182d_data *data, int index)

/**
* us5182d_apply_scale - update the ALS scale
- * @data us5182d_data structure
- * @index index in us5182d_scales array to use for the updated value
+ * @data: us5182d_data structure
+ * @index: index in us5182d_scales array to use for the updated value
*
* Function needs to be called with a lock held as we're having more than one
* i2c operation.
--
2.25.1

2020-07-17 17:00:56

by Lee Jones

[permalink] [raw]
Subject: [PATCH 11/30] iio: adc: ad799x: Demote seemingly unintentional kerneldoc header

This is the only use of function related kerneldoc in the sourcefile
and no descriptions are provided.

Fixes the following W=1 kernel build warning(s):

drivers/iio/adc/ad799x.c:192: warning: Function parameter or member 'irq' not described in 'ad799x_trigger_handler'
drivers/iio/adc/ad799x.c:192: warning: Function parameter or member 'p' not described in 'ad799x_trigger_handler'

Cc: Michael Hennerich <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/iio/adc/ad799x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c
index ef013af1aec07..007ec7ad94752 100644
--- a/drivers/iio/adc/ad799x.c
+++ b/drivers/iio/adc/ad799x.c
@@ -182,7 +182,7 @@ static int ad799x_update_config(struct ad799x_state *st, u16 config)
return 0;
}

-/**
+/*
* ad799x_trigger_handler() bh of trigger launched polling to ring buffer
*
* Currently there is no option in this driver to disable the saving of
--
2.25.1

2020-07-17 17:01:10

by Lee Jones

[permalink] [raw]
Subject: [PATCH 05/30] iio: adc: twl6030-gpadc: Fix some misdocumentation and formatting issues

Kerneldoc expects attributes/parameters to be in '@*.: ' format.

Fixes the following W=1 kernel build warning(s):

drivers/iio/adc/twl6030-gpadc.c:110: warning: Function parameter or member 'ideal' not described in 'twl6030_gpadc_platform_data'
drivers/iio/adc/twl6030-gpadc.c:110: warning: Function parameter or member 'channel_to_reg' not described in 'twl6030_gpadc_platform_data'

Cc: Stephen Boyd <[email protected]>
Cc: Nishant Kamat <[email protected]>
Cc: Balaji T K <[email protected]>
Cc: Graeme Gregory <[email protected]>
Cc: Girish S Ghongdemath <[email protected]>
Cc: Ambresh K <[email protected]>
Cc: Oleksandr Kozaruk <[email protected]>
Cc: Mikko Ylinen <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/iio/adc/twl6030-gpadc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/twl6030-gpadc.c b/drivers/iio/adc/twl6030-gpadc.c
index f24148bd15de4..a19a6ce65e390 100644
--- a/drivers/iio/adc/twl6030-gpadc.c
+++ b/drivers/iio/adc/twl6030-gpadc.c
@@ -94,9 +94,9 @@ struct twl6030_gpadc_data;
* struct twl6030_gpadc_platform_data - platform specific data
* @nchannels: number of GPADC channels
* @iio_channels: iio channels
- * @twl6030_ideal: pointer to calibration parameters
+ * @ideal: pointer to calibration parameters
* @start_conversion: pointer to ADC start conversion function
- * @channel_to_reg pointer to ADC function to convert channel to
+ * @channel_to_reg: pointer to ADC function to convert channel to
* register address for reading conversion result
* @calibrate: pointer to calibration function
*/
--
2.25.1

2020-07-17 17:01:29

by Lee Jones

[permalink] [raw]
Subject: [PATCH 01/30] iio: adc: ti_am335x_adc: Remove a couple of unused 'read' variables

Fixes the following W=1 kernel build warning(s):

drivers/iio/adc/ti_am335x_adc.c: In function ‘tiadc_buffer_preenable’:
drivers/iio/adc/ti_am335x_adc.c:297:21: warning: variable ‘read’ set but not used [-Wunused-but-set-variable]
297 | int i, fifo1count, read;
| ^~~~
drivers/iio/adc/ti_am335x_adc.c: In function ‘tiadc_buffer_predisable’:
drivers/iio/adc/ti_am335x_adc.c:346:21: warning: variable ‘read’ set but not used [-Wunused-but-set-variable]
346 | int fifo1count, i, read;
| ^~~~

Cc: Rachna Patil <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/iio/adc/ti_am335x_adc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index 9d984f2a8ba74..93b67bb165044 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -294,7 +294,7 @@ static int tiadc_start_dma(struct iio_dev *indio_dev)
static int tiadc_buffer_preenable(struct iio_dev *indio_dev)
{
struct tiadc_device *adc_dev = iio_priv(indio_dev);
- int i, fifo1count, read;
+ int i, fifo1count;

tiadc_writel(adc_dev, REG_IRQCLR, (IRQENB_FIFO1THRES |
IRQENB_FIFO1OVRRUN |
@@ -303,7 +303,7 @@ static int tiadc_buffer_preenable(struct iio_dev *indio_dev)
/* Flush FIFO. Needed in corner cases in simultaneous tsc/adc use */
fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT);
for (i = 0; i < fifo1count; i++)
- read = tiadc_readl(adc_dev, REG_FIFO1);
+ tiadc_readl(adc_dev, REG_FIFO1);

return 0;
}
@@ -343,7 +343,7 @@ static int tiadc_buffer_predisable(struct iio_dev *indio_dev)
{
struct tiadc_device *adc_dev = iio_priv(indio_dev);
struct tiadc_dma *dma = &adc_dev->dma;
- int fifo1count, i, read;
+ int fifo1count, i;

tiadc_writel(adc_dev, REG_IRQCLR, (IRQENB_FIFO1THRES |
IRQENB_FIFO1OVRRUN | IRQENB_FIFO1UNDRFLW));
@@ -358,7 +358,7 @@ static int tiadc_buffer_predisable(struct iio_dev *indio_dev)
/* Flush FIFO of leftover data in the time it takes to disable adc */
fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT);
for (i = 0; i < fifo1count; i++)
- read = tiadc_readl(adc_dev, REG_FIFO1);
+ tiadc_readl(adc_dev, REG_FIFO1);

return 0;
}
--
2.25.1

2020-07-18 15:31:59

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 01/30] iio: adc: ti_am335x_adc: Remove a couple of unused 'read' variables

On Fri, 17 Jul 2020 17:55:09 +0100
Lee Jones <[email protected]> wrote:

> Fixes the following W=1 kernel build warning(s):
>
> drivers/iio/adc/ti_am335x_adc.c: In function ‘tiadc_buffer_preenable’:
> drivers/iio/adc/ti_am335x_adc.c:297:21: warning: variable ‘read’ set but not used [-Wunused-but-set-variable]
> 297 | int i, fifo1count, read;
> | ^~~~
> drivers/iio/adc/ti_am335x_adc.c: In function ‘tiadc_buffer_predisable’:
> drivers/iio/adc/ti_am335x_adc.c:346:21: warning: variable ‘read’ set but not used [-Wunused-but-set-variable]
> 346 | int fifo1count, i, read;
> | ^~~~
>
> Cc: Rachna Patil <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
Applied to the togreg branch of iio.git which will get pushed out as testing for
the autobuilders to poke at these changes.
Still time or anyone one else to comment. I'm picking these up as they are
all noops and appear straight forward.

Thanks,

Jonathan

> ---
> drivers/iio/adc/ti_am335x_adc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
> index 9d984f2a8ba74..93b67bb165044 100644
> --- a/drivers/iio/adc/ti_am335x_adc.c
> +++ b/drivers/iio/adc/ti_am335x_adc.c
> @@ -294,7 +294,7 @@ static int tiadc_start_dma(struct iio_dev *indio_dev)
> static int tiadc_buffer_preenable(struct iio_dev *indio_dev)
> {
> struct tiadc_device *adc_dev = iio_priv(indio_dev);
> - int i, fifo1count, read;
> + int i, fifo1count;
>
> tiadc_writel(adc_dev, REG_IRQCLR, (IRQENB_FIFO1THRES |
> IRQENB_FIFO1OVRRUN |
> @@ -303,7 +303,7 @@ static int tiadc_buffer_preenable(struct iio_dev *indio_dev)
> /* Flush FIFO. Needed in corner cases in simultaneous tsc/adc use */
> fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT);
> for (i = 0; i < fifo1count; i++)
> - read = tiadc_readl(adc_dev, REG_FIFO1);
> + tiadc_readl(adc_dev, REG_FIFO1);
>
> return 0;
> }
> @@ -343,7 +343,7 @@ static int tiadc_buffer_predisable(struct iio_dev *indio_dev)
> {
> struct tiadc_device *adc_dev = iio_priv(indio_dev);
> struct tiadc_dma *dma = &adc_dev->dma;
> - int fifo1count, i, read;
> + int fifo1count, i;
>
> tiadc_writel(adc_dev, REG_IRQCLR, (IRQENB_FIFO1THRES |
> IRQENB_FIFO1OVRRUN | IRQENB_FIFO1UNDRFLW));
> @@ -358,7 +358,7 @@ static int tiadc_buffer_predisable(struct iio_dev *indio_dev)
> /* Flush FIFO of leftover data in the time it takes to disable adc */
> fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT);
> for (i = 0; i < fifo1count; i++)
> - read = tiadc_readl(adc_dev, REG_FIFO1);
> + tiadc_readl(adc_dev, REG_FIFO1);
>
> return 0;
> }

2020-07-18 15:36:10

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 03/30] iio: adc: twl4030-madc: Fix misnamed struct attribute

On Fri, 17 Jul 2020 17:55:11 +0100
Lee Jones <[email protected]> wrote:

> Fixes the following W=1 kernel build warning(s):
>
> drivers/iio/adc/twl4030-madc.c:170: warning: Function parameter or member 'usb3v1' not described in 'twl4030_madc_data'
>
> Cc: J Keerthy <[email protected]>
> Cc: Mikko Ylinen <[email protected]>
> Cc: Amit Kucheria <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
Applied with a note that this also cleans up the duplicate docs for lock.

Thanks,

Jonathan

> ---
> drivers/iio/adc/twl4030-madc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
> index 826d8295e9b3c..882a678b44690 100644
> --- a/drivers/iio/adc/twl4030-madc.c
> +++ b/drivers/iio/adc/twl4030-madc.c
> @@ -153,7 +153,7 @@ enum sample_type {
> * struct twl4030_madc_data - a container for madc info
> * @dev: Pointer to device structure for madc
> * @lock: Mutex protecting this data structure
> - * @regulator: Pointer to bias regulator for madc
> + * @usb3v1: Pointer to bias regulator for madc
> * @requests: Array of request struct corresponding to SW1, SW2 and RT
> * @use_second_irq: IRQ selection (main or co-processor)
> * @imr: Interrupt mask register of MADC
> @@ -161,7 +161,7 @@ enum sample_type {
> */
> struct twl4030_madc_data {
> struct device *dev;
> - struct mutex lock; /* mutex protecting this data structure */
> + struct mutex lock;
> struct regulator *usb3v1;
> struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
> bool use_second_irq;

2020-07-18 15:39:49

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 05/30] iio: adc: twl6030-gpadc: Fix some misdocumentation and formatting issues

On Fri, 17 Jul 2020 17:55:13 +0100
Lee Jones <[email protected]> wrote:

> Kerneldoc expects attributes/parameters to be in '@*.: ' format.
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/iio/adc/twl6030-gpadc.c:110: warning: Function parameter or member 'ideal' not described in 'twl6030_gpadc_platform_data'
> drivers/iio/adc/twl6030-gpadc.c:110: warning: Function parameter or member 'channel_to_reg' not described in 'twl6030_gpadc_platform_data'
>
> Cc: Stephen Boyd <[email protected]>
> Cc: Nishant Kamat <[email protected]>
> Cc: Balaji T K <[email protected]>
> Cc: Graeme Gregory <[email protected]>
> Cc: Girish S Ghongdemath <[email protected]>
> Cc: Ambresh K <[email protected]>
> Cc: Oleksandr Kozaruk <[email protected]>
> Cc: Mikko Ylinen <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
Applied.

Thanks,

Jonathan

> ---
> drivers/iio/adc/twl6030-gpadc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/twl6030-gpadc.c b/drivers/iio/adc/twl6030-gpadc.c
> index f24148bd15de4..a19a6ce65e390 100644
> --- a/drivers/iio/adc/twl6030-gpadc.c
> +++ b/drivers/iio/adc/twl6030-gpadc.c
> @@ -94,9 +94,9 @@ struct twl6030_gpadc_data;
> * struct twl6030_gpadc_platform_data - platform specific data
> * @nchannels: number of GPADC channels
> * @iio_channels: iio channels
> - * @twl6030_ideal: pointer to calibration parameters
> + * @ideal: pointer to calibration parameters
> * @start_conversion: pointer to ADC start conversion function
> - * @channel_to_reg pointer to ADC function to convert channel to
> + * @channel_to_reg: pointer to ADC function to convert channel to
> * register address for reading conversion result
> * @calibrate: pointer to calibration function
> */

2020-07-18 15:42:35

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 06/30] iio: dac: ltc2632: Fix formatting in kerneldoc struct header

On Fri, 17 Jul 2020 17:55:14 +0100
Lee Jones <[email protected]> wrote:

> Kerneldoc expects attributes/parameters to be in '@*.: ' format.
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/iio/dac/ltc2632.c:50: warning: Function parameter or member 'powerdown_cache_mask' not described in 'ltc2632_state'
> drivers/iio/dac/ltc2632.c:50: warning: Function parameter or member 'vref_mv' not described in 'ltc2632_state'
> drivers/iio/dac/ltc2632.c:50: warning: Function parameter or member 'vref_reg' not described in 'ltc2632_state'
>
> Cc: Liam Girdwood <[email protected]>
> Cc: Mark Brown <[email protected]>
> Cc: "Uwe Kleine-König" <[email protected]>
> Cc: Silvan Murer <[email protected]>
> Cc: Maxime Roussin-Belanger <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
Applied.

Thanks,

Jonathan

> ---
> drivers/iio/dac/ltc2632.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c
> index f891311f05cfe..733f13d3e5df4 100644
> --- a/drivers/iio/dac/ltc2632.c
> +++ b/drivers/iio/dac/ltc2632.c
> @@ -38,9 +38,9 @@ struct ltc2632_chip_info {
> /**
> * struct ltc2632_state - driver instance specific data
> * @spi_dev: pointer to the spi_device struct
> - * @powerdown_cache_mask used to show current channel powerdown state
> - * @vref_mv used reference voltage (internal or external)
> - * @vref_reg regulator for the reference voltage
> + * @powerdown_cache_mask: used to show current channel powerdown state
> + * @vref_mv: used reference voltage (internal or external)
> + * @vref_reg: regulator for the reference voltage
> */
> struct ltc2632_state {
> struct spi_device *spi_dev;

2020-07-18 15:47:06

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 10/30] iio: light: us5182d: Fix formatting in kerneldoc function block

On Fri, 17 Jul 2020 17:55:18 +0100
Lee Jones <[email protected]> wrote:

> Kerneldoc expects attributes/parameters to be in '@*.: ' format.
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/iio/light/us5182d.c:457: warning: Function parameter or member 'data' not described in 'us5182d_update_dark_th'
> drivers/iio/light/us5182d.c:457: warning: Function parameter or member 'index' not described in 'us5182d_update_dark_th'
> drivers/iio/light/us5182d.c:479: warning: Function parameter or member 'data' not described in 'us5182d_apply_scale'
> drivers/iio/light/us5182d.c:479: warning: Function parameter or member 'index' not described in 'us5182d_apply_scale'
>
> Cc: Adriana Reus <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
Applied.

Thanks,

Jonathan

> ---
> drivers/iio/light/us5182d.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/light/us5182d.c b/drivers/iio/light/us5182d.c
> index b995f21a33479..24843597beba5 100644
> --- a/drivers/iio/light/us5182d.c
> +++ b/drivers/iio/light/us5182d.c
> @@ -446,8 +446,8 @@ static int us5182d_read_raw(struct iio_dev *indio_dev,
>
> /**
> * us5182d_update_dark_th - update Darh_Th registers
> - * @data us5182d_data structure
> - * @index index in us5182d_dark_ths array to use for the updated value
> + * @data: us5182d_data structure
> + * @index: index in us5182d_dark_ths array to use for the updated value
> *
> * Function needs to be called with a lock held because it needs two i2c write
> * byte operations as these registers (0x27 0x28) don't work in word mode
> @@ -469,8 +469,8 @@ static int us5182d_update_dark_th(struct us5182d_data *data, int index)
>
> /**
> * us5182d_apply_scale - update the ALS scale
> - * @data us5182d_data structure
> - * @index index in us5182d_scales array to use for the updated value
> + * @data: us5182d_data structure
> + * @index: index in us5182d_scales array to use for the updated value
> *
> * Function needs to be called with a lock held as we're having more than one
> * i2c operation.

2020-07-18 15:48:33

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 11/30] iio: adc: ad799x: Demote seemingly unintentional kerneldoc header

On Fri, 17 Jul 2020 17:55:19 +0100
Lee Jones <[email protected]> wrote:

> This is the only use of function related kerneldoc in the sourcefile
> and no descriptions are provided.
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/iio/adc/ad799x.c:192: warning: Function parameter or member 'irq' not described in 'ad799x_trigger_handler'
> drivers/iio/adc/ad799x.c:192: warning: Function parameter or member 'p' not described in 'ad799x_trigger_handler'
>
> Cc: Michael Hennerich <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
Applied.

Thanks,

Jonathan

> ---
> drivers/iio/adc/ad799x.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c
> index ef013af1aec07..007ec7ad94752 100644
> --- a/drivers/iio/adc/ad799x.c
> +++ b/drivers/iio/adc/ad799x.c
> @@ -182,7 +182,7 @@ static int ad799x_update_config(struct ad799x_state *st, u16 config)
> return 0;
> }
>
> -/**
> +/*
> * ad799x_trigger_handler() bh of trigger launched polling to ring buffer
> *
> * Currently there is no option in this driver to disable the saving of

2020-07-18 15:52:36

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 16/30] iio: accel: sca3000: Fix 2 misspellings and demote nonconforming kerneldocs

On Fri, 17 Jul 2020 17:55:24 +0100
Lee Jones <[email protected]> wrote:

> Fixes the following W=1 kernel build warning(s):
>
> drivers/iio/accel/sca3000.c:210: warning: Function parameter or member 'mot_det_mult_xz' not described in 'sca3000_chip_info'
> drivers/iio/accel/sca3000.c:210: warning: Function parameter or member 'mot_det_mult_y' not described in 'sca3000_chip_info'
> drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'indio_dev' not described in 'sca3000_read_event_value'
> drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'chan' not described in 'sca3000_read_event_value'
> drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'type' not described in 'sca3000_read_event_value'
> drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'dir' not described in 'sca3000_read_event_value'
> drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'info' not described in 'sca3000_read_event_value'
> drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'val' not described in 'sca3000_read_event_value'
> drivers/iio/accel/sca3000.c:871: warning: Function parameter or member 'val2' not described in 'sca3000_read_event_value'
> drivers/iio/accel/sca3000.c:1110: warning: Function parameter or member 'indio_dev' not described in 'sca3000_read_event_config'
> drivers/iio/accel/sca3000.c:1110: warning: Function parameter or member 'chan' not described in 'sca3000_read_event_config'
> drivers/iio/accel/sca3000.c:1110: warning: Function parameter or member 'type' not described in 'sca3000_read_event_config'
> drivers/iio/accel/sca3000.c:1110: warning: Function parameter or member 'dir' not described in 'sca3000_read_event_config'
>
> Cc: Christophe JAILLET <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
Applied.

Thanks,

Jonathan

> ---
> drivers/iio/accel/sca3000.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
> index 6e429072e44a4..3952187166ffa 100644
> --- a/drivers/iio/accel/sca3000.c
> +++ b/drivers/iio/accel/sca3000.c
> @@ -186,9 +186,9 @@ struct sca3000_state {
> * @option_mode_2_freq: option mode 2 sampling frequency
> * @option_mode_2_3db_freq: 3db cutoff frequency of the low pass filter for
> * the second option mode.
> - * @mod_det_mult_xz: Bit wise multipliers to calculate the threshold
> + * @mot_det_mult_xz: Bit wise multipliers to calculate the threshold
> * for motion detection in the x and z axis.
> - * @mod_det_mult_y: Bit wise multipliers to calculate the threshold
> + * @mot_det_mult_y: Bit wise multipliers to calculate the threshold
> * for motion detection in the y axis.
> *
> * This structure is used to hold information about the functionality of a given
> @@ -859,9 +859,9 @@ static ssize_t sca3000_read_av_freq(struct device *dev,
> */
> static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(sca3000_read_av_freq);
>
> -/**
> +/*
> * sca3000_read_event_value() - query of a threshold or period
> - **/
> + */
> static int sca3000_read_event_value(struct iio_dev *indio_dev,
> const struct iio_chan_spec *chan,
> enum iio_event_type type,
> @@ -1100,9 +1100,9 @@ static irqreturn_t sca3000_event_handler(int irq, void *private)
> return IRQ_HANDLED;
> }
>
> -/**
> +/*
> * sca3000_read_event_config() what events are enabled
> - **/
> + */
> static int sca3000_read_event_config(struct iio_dev *indio_dev,
> const struct iio_chan_spec *chan,
> enum iio_event_type type,

2020-07-18 15:56:38

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 18/30] iio: gyro: fxas21002c: Move 'fxas21002c_reg_fields' to the only file its used

On Fri, 17 Jul 2020 17:55:26 +0100
Lee Jones <[email protected]> wrote:

> 'fxas21002c_reg_fields' is only used in '*core*', meaning that '*i2c*'
> and '*spi*' complain of a defined but not used const variable. Let's
> move it into the source file.
>
> Fixes the following W=1 kernel build warning(s):
>
> In file included from drivers/iio/gyro/fxas21002c_i2c.c:14:
> drivers/iio/gyro/fxas21002c.h:79:31: warning: ‘fxas21002c_reg_fields’ defined but not used [-Wunused-const-variable=]
> 79 | static const struct reg_field fxas21002c_reg_fields[] = {
> | ^~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/iio/gyro/fxas21002c_spi.c:14:
> drivers/iio/gyro/fxas21002c.h:79:31: warning: ‘fxas21002c_reg_fields’ defined but not used [-Wunused-const-variable=]
> 79 | static const struct reg_field fxas21002c_reg_fields[] = {
> | ^~~~~~~~~~~~~~~~~~~~~
>
> Cc: Rui Miguel Silva <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
Sensible solution.

Applied

Thanks,

Jonathan

> ---
> drivers/iio/gyro/fxas21002c.h | 66 ------------------------------
> drivers/iio/gyro/fxas21002c_core.c | 66 ++++++++++++++++++++++++++++++
> 2 files changed, 66 insertions(+), 66 deletions(-)
>
> diff --git a/drivers/iio/gyro/fxas21002c.h b/drivers/iio/gyro/fxas21002c.h
> index 566d92de26763..c81cecee121cb 100644
> --- a/drivers/iio/gyro/fxas21002c.h
> +++ b/drivers/iio/gyro/fxas21002c.h
> @@ -76,72 +76,6 @@ enum fxas21002c_fields {
> F_MAX_FIELDS,
> };
>
> -static const struct reg_field fxas21002c_reg_fields[] = {
> - [F_DR_STATUS] = REG_FIELD(FXAS21002C_REG_STATUS, 0, 7),
> - [F_OUT_X_MSB] = REG_FIELD(FXAS21002C_REG_OUT_X_MSB, 0, 7),
> - [F_OUT_X_LSB] = REG_FIELD(FXAS21002C_REG_OUT_X_LSB, 0, 7),
> - [F_OUT_Y_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_MSB, 0, 7),
> - [F_OUT_Y_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_LSB, 0, 7),
> - [F_OUT_Z_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_MSB, 0, 7),
> - [F_OUT_Z_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_LSB, 0, 7),
> - [F_ZYX_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 7, 7),
> - [F_Z_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 6, 6),
> - [F_Y_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 5, 5),
> - [F_X_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 4, 4),
> - [F_ZYX_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 3, 3),
> - [F_Z_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 2, 2),
> - [F_Y_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 1, 1),
> - [F_X_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 0, 0),
> - [F_OVF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 7, 7),
> - [F_WMKF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 6, 6),
> - [F_CNT] = REG_FIELD(FXAS21002C_REG_F_STATUS, 0, 5),
> - [F_MODE] = REG_FIELD(FXAS21002C_REG_F_SETUP, 6, 7),
> - [F_WMRK] = REG_FIELD(FXAS21002C_REG_F_SETUP, 0, 5),
> - [F_EVENT] = REG_FIELD(FXAS21002C_REG_F_EVENT, 5, 5),
> - [FE_TIME] = REG_FIELD(FXAS21002C_REG_F_EVENT, 0, 4),
> - [F_BOOTEND] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 3, 3),
> - [F_SRC_FIFO] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 2, 2),
> - [F_SRC_RT] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 1, 1),
> - [F_SRC_DRDY] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 0, 0),
> - [F_WHO_AM_I] = REG_FIELD(FXAS21002C_REG_WHO_AM_I, 0, 7),
> - [F_BW] = REG_FIELD(FXAS21002C_REG_CTRL0, 6, 7),
> - [F_SPIW] = REG_FIELD(FXAS21002C_REG_CTRL0, 5, 5),
> - [F_SEL] = REG_FIELD(FXAS21002C_REG_CTRL0, 3, 4),
> - [F_HPF_EN] = REG_FIELD(FXAS21002C_REG_CTRL0, 2, 2),
> - [F_FS] = REG_FIELD(FXAS21002C_REG_CTRL0, 0, 1),
> - [F_ELE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 3, 3),
> - [F_ZTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 2, 2),
> - [F_YTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 1, 1),
> - [F_XTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 0, 0),
> - [F_EA] = REG_FIELD(FXAS21002C_REG_RT_SRC, 6, 6),
> - [F_ZRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 5, 5),
> - [F_ZRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 4, 4),
> - [F_YRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 3, 3),
> - [F_YRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 2, 2),
> - [F_XRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 1, 1),
> - [F_XRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 0),
> - [F_DBCNTM] = REG_FIELD(FXAS21002C_REG_RT_THS, 7, 7),
> - [F_THS] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 6),
> - [F_RT_COUNT] = REG_FIELD(FXAS21002C_REG_RT_COUNT, 0, 7),
> - [F_TEMP] = REG_FIELD(FXAS21002C_REG_TEMP, 0, 7),
> - [F_RST] = REG_FIELD(FXAS21002C_REG_CTRL1, 6, 6),
> - [F_ST] = REG_FIELD(FXAS21002C_REG_CTRL1, 5, 5),
> - [F_DR] = REG_FIELD(FXAS21002C_REG_CTRL1, 2, 4),
> - [F_ACTIVE] = REG_FIELD(FXAS21002C_REG_CTRL1, 1, 1),
> - [F_READY] = REG_FIELD(FXAS21002C_REG_CTRL1, 0, 0),
> - [F_INT_CFG_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 7, 7),
> - [F_INT_EN_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 6, 6),
> - [F_INT_CFG_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 5, 5),
> - [F_INT_EN_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 4, 4),
> - [F_INT_CFG_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 3, 3),
> - [F_INT_EN_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 2, 2),
> - [F_IPOL] = REG_FIELD(FXAS21002C_REG_CTRL2, 1, 1),
> - [F_PP_OD] = REG_FIELD(FXAS21002C_REG_CTRL2, 0, 0),
> - [F_WRAPTOONE] = REG_FIELD(FXAS21002C_REG_CTRL3, 3, 3),
> - [F_EXTCTRLEN] = REG_FIELD(FXAS21002C_REG_CTRL3, 2, 2),
> - [F_FS_DOUBLE] = REG_FIELD(FXAS21002C_REG_CTRL3, 0, 0),
> -};
> -
> extern const struct dev_pm_ops fxas21002c_pm_ops;
>
> int fxas21002c_core_probe(struct device *dev, struct regmap *regmap, int irq,
> diff --git a/drivers/iio/gyro/fxas21002c_core.c b/drivers/iio/gyro/fxas21002c_core.c
> index 89d2bb2282eac..f20033afc714c 100644
> --- a/drivers/iio/gyro/fxas21002c_core.c
> +++ b/drivers/iio/gyro/fxas21002c_core.c
> @@ -42,6 +42,72 @@ enum fxas21002c_mode_state {
>
> #define FXAS21002C_AXIS_TO_REG(axis) (FXAS21002C_REG_OUT_X_MSB + ((axis) * 2))
>
> +static const struct reg_field fxas21002c_reg_fields[] = {
> + [F_DR_STATUS] = REG_FIELD(FXAS21002C_REG_STATUS, 0, 7),
> + [F_OUT_X_MSB] = REG_FIELD(FXAS21002C_REG_OUT_X_MSB, 0, 7),
> + [F_OUT_X_LSB] = REG_FIELD(FXAS21002C_REG_OUT_X_LSB, 0, 7),
> + [F_OUT_Y_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_MSB, 0, 7),
> + [F_OUT_Y_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_LSB, 0, 7),
> + [F_OUT_Z_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_MSB, 0, 7),
> + [F_OUT_Z_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_LSB, 0, 7),
> + [F_ZYX_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 7, 7),
> + [F_Z_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 6, 6),
> + [F_Y_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 5, 5),
> + [F_X_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 4, 4),
> + [F_ZYX_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 3, 3),
> + [F_Z_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 2, 2),
> + [F_Y_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 1, 1),
> + [F_X_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 0, 0),
> + [F_OVF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 7, 7),
> + [F_WMKF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 6, 6),
> + [F_CNT] = REG_FIELD(FXAS21002C_REG_F_STATUS, 0, 5),
> + [F_MODE] = REG_FIELD(FXAS21002C_REG_F_SETUP, 6, 7),
> + [F_WMRK] = REG_FIELD(FXAS21002C_REG_F_SETUP, 0, 5),
> + [F_EVENT] = REG_FIELD(FXAS21002C_REG_F_EVENT, 5, 5),
> + [FE_TIME] = REG_FIELD(FXAS21002C_REG_F_EVENT, 0, 4),
> + [F_BOOTEND] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 3, 3),
> + [F_SRC_FIFO] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 2, 2),
> + [F_SRC_RT] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 1, 1),
> + [F_SRC_DRDY] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 0, 0),
> + [F_WHO_AM_I] = REG_FIELD(FXAS21002C_REG_WHO_AM_I, 0, 7),
> + [F_BW] = REG_FIELD(FXAS21002C_REG_CTRL0, 6, 7),
> + [F_SPIW] = REG_FIELD(FXAS21002C_REG_CTRL0, 5, 5),
> + [F_SEL] = REG_FIELD(FXAS21002C_REG_CTRL0, 3, 4),
> + [F_HPF_EN] = REG_FIELD(FXAS21002C_REG_CTRL0, 2, 2),
> + [F_FS] = REG_FIELD(FXAS21002C_REG_CTRL0, 0, 1),
> + [F_ELE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 3, 3),
> + [F_ZTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 2, 2),
> + [F_YTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 1, 1),
> + [F_XTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 0, 0),
> + [F_EA] = REG_FIELD(FXAS21002C_REG_RT_SRC, 6, 6),
> + [F_ZRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 5, 5),
> + [F_ZRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 4, 4),
> + [F_YRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 3, 3),
> + [F_YRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 2, 2),
> + [F_XRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 1, 1),
> + [F_XRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 0),
> + [F_DBCNTM] = REG_FIELD(FXAS21002C_REG_RT_THS, 7, 7),
> + [F_THS] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 6),
> + [F_RT_COUNT] = REG_FIELD(FXAS21002C_REG_RT_COUNT, 0, 7),
> + [F_TEMP] = REG_FIELD(FXAS21002C_REG_TEMP, 0, 7),
> + [F_RST] = REG_FIELD(FXAS21002C_REG_CTRL1, 6, 6),
> + [F_ST] = REG_FIELD(FXAS21002C_REG_CTRL1, 5, 5),
> + [F_DR] = REG_FIELD(FXAS21002C_REG_CTRL1, 2, 4),
> + [F_ACTIVE] = REG_FIELD(FXAS21002C_REG_CTRL1, 1, 1),
> + [F_READY] = REG_FIELD(FXAS21002C_REG_CTRL1, 0, 0),
> + [F_INT_CFG_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 7, 7),
> + [F_INT_EN_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 6, 6),
> + [F_INT_CFG_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 5, 5),
> + [F_INT_EN_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 4, 4),
> + [F_INT_CFG_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 3, 3),
> + [F_INT_EN_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 2, 2),
> + [F_IPOL] = REG_FIELD(FXAS21002C_REG_CTRL2, 1, 1),
> + [F_PP_OD] = REG_FIELD(FXAS21002C_REG_CTRL2, 0, 0),
> + [F_WRAPTOONE] = REG_FIELD(FXAS21002C_REG_CTRL3, 3, 3),
> + [F_EXTCTRLEN] = REG_FIELD(FXAS21002C_REG_CTRL3, 2, 2),
> + [F_FS_DOUBLE] = REG_FIELD(FXAS21002C_REG_CTRL3, 0, 0),
> +};
> +
> static const int fxas21002c_odr_values[] = {
> 800, 400, 200, 100, 50, 25, 12, 12
> };

2020-07-18 16:02:31

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 23/30] iio: adc: palmas_gpadc: Demote non-conforming kerneldoc header

On Fri, 17 Jul 2020 17:55:31 +0100
Lee Jones <[email protected]> wrote:

> Very few of the struct attributes have been documented here.
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'dev' not described in 'palmas_gpadc'
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'palmas' not described in 'palmas_gpadc'
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'irq' not described in 'palmas_gpadc'
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'irq_auto_0' not described in 'palmas_gpadc'
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'irq_auto_1' not described in 'palmas_gpadc'
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'adc_info' not described in 'palmas_gpadc'
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'conv_completion' not described in 'palmas_gpadc'
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'wakeup1_data' not described in 'palmas_gpadc'
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'wakeup2_data' not described in 'palmas_gpadc'
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'wakeup1_enable' not described in 'palmas_gpadc'
> drivers/iio/adc/palmas_gpadc.c:114: warning: Function parameter or member 'wakeup2_enable' not described in 'palmas_gpadc'
>
> Cc: Pradeep Goudagunta <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
Applied.

Thanks,

Jonathan

> ---
> drivers/iio/adc/palmas_gpadc.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c
> index 46e595eb889fa..81b0a76a767e8 100644
> --- a/drivers/iio/adc/palmas_gpadc.c
> +++ b/drivers/iio/adc/palmas_gpadc.c
> @@ -76,7 +76,7 @@ static struct palmas_gpadc_info palmas_gpadc_info[] = {
> PALMAS_ADC_INFO(IN15, 0, 0, 0, 0, INVALID, INVALID, true),
> };
>
> -/**
> +/*
> * struct palmas_gpadc - the palmas_gpadc structure
> * @ch0_current: channel 0 current source setting
> * 0: 0 uA
> @@ -94,7 +94,6 @@ static struct palmas_gpadc_info palmas_gpadc_info[] = {
> * This is the palmas_gpadc structure to store run-time information
> * and pointers for this driver instance.
> */
> -
> struct palmas_gpadc {
> struct device *dev;
> struct palmas *palmas;

2020-07-22 20:23:14

by Rui Miguel Silva

[permalink] [raw]
Subject: Re: [PATCH 18/30] iio: gyro: fxas21002c: Move 'fxas21002c_reg_fields' to the only file its used

Hi Lee,
Sorry for the late reply, been out of office and catching up with
mails now.
On Fri, Jul 17, 2020 at 05:55:26PM +0100, Lee Jones wrote:
> 'fxas21002c_reg_fields' is only used in '*core*', meaning that '*i2c*'
> and '*spi*' complain of a defined but not used const variable. Let's
> move it into the source file.
>
> Fixes the following W=1 kernel build warning(s):
>
> In file included from drivers/iio/gyro/fxas21002c_i2c.c:14:
> drivers/iio/gyro/fxas21002c.h:79:31: warning: ‘fxas21002c_reg_fields’ defined but not used [-Wunused-const-variable=]
> 79 | static const struct reg_field fxas21002c_reg_fields[] = {
> | ^~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/iio/gyro/fxas21002c_spi.c:14:
> drivers/iio/gyro/fxas21002c.h:79:31: warning: ‘fxas21002c_reg_fields’ defined but not used [-Wunused-const-variable=]
> 79 | static const struct reg_field fxas21002c_reg_fields[] = {
> | ^~~~~~~~~~~~~~~~~~~~~
>
> Cc: Rui Miguel Silva <[email protected]>
>

Thanks for this, not going in time for the official tagging, since
gregkh already picked this up for staging, but fwiw:

Acked-by: Rui Miguel Silva <[email protected]>

------
Cheers,
Rui

> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/iio/gyro/fxas21002c.h | 66 ------------------------------
> drivers/iio/gyro/fxas21002c_core.c | 66 ++++++++++++++++++++++++++++++
> 2 files changed, 66 insertions(+), 66 deletions(-)
>
> diff --git a/drivers/iio/gyro/fxas21002c.h b/drivers/iio/gyro/fxas21002c.h
> index 566d92de26763..c81cecee121cb 100644
> --- a/drivers/iio/gyro/fxas21002c.h
> +++ b/drivers/iio/gyro/fxas21002c.h
> @@ -76,72 +76,6 @@ enum fxas21002c_fields {
> F_MAX_FIELDS,
> };
>
> -static const struct reg_field fxas21002c_reg_fields[] = {
> - [F_DR_STATUS] = REG_FIELD(FXAS21002C_REG_STATUS, 0, 7),
> - [F_OUT_X_MSB] = REG_FIELD(FXAS21002C_REG_OUT_X_MSB, 0, 7),
> - [F_OUT_X_LSB] = REG_FIELD(FXAS21002C_REG_OUT_X_LSB, 0, 7),
> - [F_OUT_Y_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_MSB, 0, 7),
> - [F_OUT_Y_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_LSB, 0, 7),
> - [F_OUT_Z_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_MSB, 0, 7),
> - [F_OUT_Z_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_LSB, 0, 7),
> - [F_ZYX_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 7, 7),
> - [F_Z_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 6, 6),
> - [F_Y_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 5, 5),
> - [F_X_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 4, 4),
> - [F_ZYX_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 3, 3),
> - [F_Z_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 2, 2),
> - [F_Y_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 1, 1),
> - [F_X_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 0, 0),
> - [F_OVF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 7, 7),
> - [F_WMKF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 6, 6),
> - [F_CNT] = REG_FIELD(FXAS21002C_REG_F_STATUS, 0, 5),
> - [F_MODE] = REG_FIELD(FXAS21002C_REG_F_SETUP, 6, 7),
> - [F_WMRK] = REG_FIELD(FXAS21002C_REG_F_SETUP, 0, 5),
> - [F_EVENT] = REG_FIELD(FXAS21002C_REG_F_EVENT, 5, 5),
> - [FE_TIME] = REG_FIELD(FXAS21002C_REG_F_EVENT, 0, 4),
> - [F_BOOTEND] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 3, 3),
> - [F_SRC_FIFO] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 2, 2),
> - [F_SRC_RT] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 1, 1),
> - [F_SRC_DRDY] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 0, 0),
> - [F_WHO_AM_I] = REG_FIELD(FXAS21002C_REG_WHO_AM_I, 0, 7),
> - [F_BW] = REG_FIELD(FXAS21002C_REG_CTRL0, 6, 7),
> - [F_SPIW] = REG_FIELD(FXAS21002C_REG_CTRL0, 5, 5),
> - [F_SEL] = REG_FIELD(FXAS21002C_REG_CTRL0, 3, 4),
> - [F_HPF_EN] = REG_FIELD(FXAS21002C_REG_CTRL0, 2, 2),
> - [F_FS] = REG_FIELD(FXAS21002C_REG_CTRL0, 0, 1),
> - [F_ELE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 3, 3),
> - [F_ZTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 2, 2),
> - [F_YTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 1, 1),
> - [F_XTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 0, 0),
> - [F_EA] = REG_FIELD(FXAS21002C_REG_RT_SRC, 6, 6),
> - [F_ZRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 5, 5),
> - [F_ZRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 4, 4),
> - [F_YRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 3, 3),
> - [F_YRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 2, 2),
> - [F_XRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 1, 1),
> - [F_XRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 0),
> - [F_DBCNTM] = REG_FIELD(FXAS21002C_REG_RT_THS, 7, 7),
> - [F_THS] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 6),
> - [F_RT_COUNT] = REG_FIELD(FXAS21002C_REG_RT_COUNT, 0, 7),
> - [F_TEMP] = REG_FIELD(FXAS21002C_REG_TEMP, 0, 7),
> - [F_RST] = REG_FIELD(FXAS21002C_REG_CTRL1, 6, 6),
> - [F_ST] = REG_FIELD(FXAS21002C_REG_CTRL1, 5, 5),
> - [F_DR] = REG_FIELD(FXAS21002C_REG_CTRL1, 2, 4),
> - [F_ACTIVE] = REG_FIELD(FXAS21002C_REG_CTRL1, 1, 1),
> - [F_READY] = REG_FIELD(FXAS21002C_REG_CTRL1, 0, 0),
> - [F_INT_CFG_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 7, 7),
> - [F_INT_EN_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 6, 6),
> - [F_INT_CFG_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 5, 5),
> - [F_INT_EN_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 4, 4),
> - [F_INT_CFG_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 3, 3),
> - [F_INT_EN_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 2, 2),
> - [F_IPOL] = REG_FIELD(FXAS21002C_REG_CTRL2, 1, 1),
> - [F_PP_OD] = REG_FIELD(FXAS21002C_REG_CTRL2, 0, 0),
> - [F_WRAPTOONE] = REG_FIELD(FXAS21002C_REG_CTRL3, 3, 3),
> - [F_EXTCTRLEN] = REG_FIELD(FXAS21002C_REG_CTRL3, 2, 2),
> - [F_FS_DOUBLE] = REG_FIELD(FXAS21002C_REG_CTRL3, 0, 0),
> -};
> -
> extern const struct dev_pm_ops fxas21002c_pm_ops;
>
> int fxas21002c_core_probe(struct device *dev, struct regmap *regmap, int irq,
> diff --git a/drivers/iio/gyro/fxas21002c_core.c b/drivers/iio/gyro/fxas21002c_core.c
> index 89d2bb2282eac..f20033afc714c 100644
> --- a/drivers/iio/gyro/fxas21002c_core.c
> +++ b/drivers/iio/gyro/fxas21002c_core.c
> @@ -42,6 +42,72 @@ enum fxas21002c_mode_state {
>
> #define FXAS21002C_AXIS_TO_REG(axis) (FXAS21002C_REG_OUT_X_MSB + ((axis) * 2))
>
> +static const struct reg_field fxas21002c_reg_fields[] = {
> + [F_DR_STATUS] = REG_FIELD(FXAS21002C_REG_STATUS, 0, 7),
> + [F_OUT_X_MSB] = REG_FIELD(FXAS21002C_REG_OUT_X_MSB, 0, 7),
> + [F_OUT_X_LSB] = REG_FIELD(FXAS21002C_REG_OUT_X_LSB, 0, 7),
> + [F_OUT_Y_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_MSB, 0, 7),
> + [F_OUT_Y_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Y_LSB, 0, 7),
> + [F_OUT_Z_MSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_MSB, 0, 7),
> + [F_OUT_Z_LSB] = REG_FIELD(FXAS21002C_REG_OUT_Z_LSB, 0, 7),
> + [F_ZYX_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 7, 7),
> + [F_Z_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 6, 6),
> + [F_Y_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 5, 5),
> + [F_X_OW] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 4, 4),
> + [F_ZYX_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 3, 3),
> + [F_Z_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 2, 2),
> + [F_Y_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 1, 1),
> + [F_X_DR] = REG_FIELD(FXAS21002C_REG_DR_STATUS, 0, 0),
> + [F_OVF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 7, 7),
> + [F_WMKF] = REG_FIELD(FXAS21002C_REG_F_STATUS, 6, 6),
> + [F_CNT] = REG_FIELD(FXAS21002C_REG_F_STATUS, 0, 5),
> + [F_MODE] = REG_FIELD(FXAS21002C_REG_F_SETUP, 6, 7),
> + [F_WMRK] = REG_FIELD(FXAS21002C_REG_F_SETUP, 0, 5),
> + [F_EVENT] = REG_FIELD(FXAS21002C_REG_F_EVENT, 5, 5),
> + [FE_TIME] = REG_FIELD(FXAS21002C_REG_F_EVENT, 0, 4),
> + [F_BOOTEND] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 3, 3),
> + [F_SRC_FIFO] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 2, 2),
> + [F_SRC_RT] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 1, 1),
> + [F_SRC_DRDY] = REG_FIELD(FXAS21002C_REG_INT_SRC_FLAG, 0, 0),
> + [F_WHO_AM_I] = REG_FIELD(FXAS21002C_REG_WHO_AM_I, 0, 7),
> + [F_BW] = REG_FIELD(FXAS21002C_REG_CTRL0, 6, 7),
> + [F_SPIW] = REG_FIELD(FXAS21002C_REG_CTRL0, 5, 5),
> + [F_SEL] = REG_FIELD(FXAS21002C_REG_CTRL0, 3, 4),
> + [F_HPF_EN] = REG_FIELD(FXAS21002C_REG_CTRL0, 2, 2),
> + [F_FS] = REG_FIELD(FXAS21002C_REG_CTRL0, 0, 1),
> + [F_ELE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 3, 3),
> + [F_ZTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 2, 2),
> + [F_YTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 1, 1),
> + [F_XTEFE] = REG_FIELD(FXAS21002C_REG_RT_CFG, 0, 0),
> + [F_EA] = REG_FIELD(FXAS21002C_REG_RT_SRC, 6, 6),
> + [F_ZRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 5, 5),
> + [F_ZRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 4, 4),
> + [F_YRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 3, 3),
> + [F_YRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 2, 2),
> + [F_XRT] = REG_FIELD(FXAS21002C_REG_RT_SRC, 1, 1),
> + [F_XRT_POL] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 0),
> + [F_DBCNTM] = REG_FIELD(FXAS21002C_REG_RT_THS, 7, 7),
> + [F_THS] = REG_FIELD(FXAS21002C_REG_RT_SRC, 0, 6),
> + [F_RT_COUNT] = REG_FIELD(FXAS21002C_REG_RT_COUNT, 0, 7),
> + [F_TEMP] = REG_FIELD(FXAS21002C_REG_TEMP, 0, 7),
> + [F_RST] = REG_FIELD(FXAS21002C_REG_CTRL1, 6, 6),
> + [F_ST] = REG_FIELD(FXAS21002C_REG_CTRL1, 5, 5),
> + [F_DR] = REG_FIELD(FXAS21002C_REG_CTRL1, 2, 4),
> + [F_ACTIVE] = REG_FIELD(FXAS21002C_REG_CTRL1, 1, 1),
> + [F_READY] = REG_FIELD(FXAS21002C_REG_CTRL1, 0, 0),
> + [F_INT_CFG_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 7, 7),
> + [F_INT_EN_FIFO] = REG_FIELD(FXAS21002C_REG_CTRL2, 6, 6),
> + [F_INT_CFG_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 5, 5),
> + [F_INT_EN_RT] = REG_FIELD(FXAS21002C_REG_CTRL2, 4, 4),
> + [F_INT_CFG_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 3, 3),
> + [F_INT_EN_DRDY] = REG_FIELD(FXAS21002C_REG_CTRL2, 2, 2),
> + [F_IPOL] = REG_FIELD(FXAS21002C_REG_CTRL2, 1, 1),
> + [F_PP_OD] = REG_FIELD(FXAS21002C_REG_CTRL2, 0, 0),
> + [F_WRAPTOONE] = REG_FIELD(FXAS21002C_REG_CTRL3, 3, 3),
> + [F_EXTCTRLEN] = REG_FIELD(FXAS21002C_REG_CTRL3, 2, 2),
> + [F_FS_DOUBLE] = REG_FIELD(FXAS21002C_REG_CTRL3, 0, 0),
> +};
> +
> static const int fxas21002c_odr_values[] = {
> 800, 400, 200, 100, 50, 25, 12, 12
> };
> --
> 2.25.1
>