mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iio: imu: inv_mpu6050: fix kernel-doc warnings
@ 2026-10-11  4:57 Arnav Kapoor
  2026-10-11 17:33 ` Joshua Crofts
  0 siblings, 1 reply; 2+ messages in thread
From: Arnav Kapoor @ 2026-10-11  4:57 UTC (permalink / raw)
  To: Jean-Baptiste Maneyrol, Jonathan Cameron
  Cc: David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel, Arnav Kapoor

scripts/kernel-doc -Wall reports several warnings for the inv_mpu6050
driver:

- inv_mpu_magn_get_scale() only describes @st, not @chan, @val and @val2.
- Eight functions use "Returns ..." in the body instead of a "Return:"
  section, and inv_mpu6050_set_enable() and
  inv_mpu_data_rdy_trigger_set_state() do not describe their return
  value at all, e.g.:

    Warning: .../inv_mpu_aux.c:87 No description found for return value
    of 'inv_mpu_aux_init'

- int_pin_cfg in struct inv_mpu6050_reg_map is documented with a ';'
  instead of a ':' after the name, so kernel-doc does not see it, and
  user_ctrl in struct inv_mpu6050_chip_config and startup_time in
  struct inv_mpu6050_hw are not documented.

Describe the missing parameters, members and return values, and convert
the return value descriptions to "Return:" sections. Where the return
value was described before the long description, move it after it, so
the description is not parsed as part of the return value section.

With this change, scripts/kernel-doc -Wall reports no warnings for
drivers/iio/imu/inv_mpu6050/. Comment-only change.

Assisted-by: LLM
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
---
Comment-only change, checked with scripts/kernel-doc -Wall.

 drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c     |  6 +++---
 drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c     |  2 +-
 drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h     |  4 +++-
 drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c    | 14 +++++++-------
 drivers/iio/imu/inv_mpu6050/inv_mpu_magn.h    |  5 ++++-
 drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c |  4 ++++
 6 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c
index 970cf5c47f68..d40d53eef8ed 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c
@@ -82,7 +82,7 @@ static int inv_mpu_i2c_master_xfer(const struct inv_mpu6050_state *st)
  * inv_mpu_aux_init() - init i2c auxiliary bus
  * @st: driver internal state
  *
- * Returns 0 on success, a negative error code otherwise.
+ * Return: 0 on success, a negative error code otherwise.
  */
 int inv_mpu_aux_init(const struct inv_mpu6050_state *st)
 {
@@ -130,7 +130,7 @@ int inv_mpu_aux_init(const struct inv_mpu6050_state *st)
  * @val: buffer for storing read bytes
  * @size: number of bytes to read
  *
- *  Returns 0 on success, a negative error code otherwise.
+ * Return: 0 on success, a negative error code otherwise.
  */
 int inv_mpu_aux_read(const struct inv_mpu6050_state *st, uint8_t addr,
 		     uint8_t reg, uint8_t *val, size_t size)
@@ -170,7 +170,7 @@ int inv_mpu_aux_read(const struct inv_mpu6050_state *st, uint8_t addr,
  * @reg: chip register address
  * @val: 1 byte value to write
  *
- *  Returns 0 on success, a negative error code otherwise.
+ * Return: 0 on success, a negative error code otherwise.
  */
 int inv_mpu_aux_write(const struct inv_mpu6050_state *st, uint8_t addr,
 		      uint8_t reg, uint8_t val)
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
index 9ef6ab74af8b..c796841c0501 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
@@ -93,7 +93,7 @@ static int inv_mpu_i2c_aux_setup(struct iio_dev *indio_dev)
  *  inv_mpu_probe() - probe function.
  *  @client:          i2c client.
  *
- *  Returns 0 on success, a negative error code otherwise.
+ *  Return: 0 on success, a negative error code otherwise.
  */
 static int inv_mpu_probe(struct i2c_client *client)
 {
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
index 6239b1a803f7..db609d8c98b8 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
@@ -39,7 +39,7 @@
  *  @int_status:	Interrupt status register.
  *  @pwr_mgmt_1:	Controls chip's power state and clock source.
  *  @pwr_mgmt_2:	Controls power state of individual sensors.
- *  @int_pin_cfg;	Controls interrupt pin configuration.
+ *  @int_pin_cfg:	Controls interrupt pin configuration.
  *  @accl_offset:	Controls the accelerometer calibration offset.
  *  @gyro_offset:	Controls the gyroscope calibration offset.
  *  @i2c_if:		Controls the i2c interface
@@ -114,6 +114,7 @@ enum inv_devices {
  *  @temp_fifo_enable:	enable temp data output
  *  @magn_fifo_enable:	enable magn data output
  *  @divider:		chip sample rate divider (sample rate divider - 1)
+ *  @user_ctrl:		cached value of the USER_CTRL register
  *  @roc_threshold:	save ROC threshold (WoM) set value
  */
 struct inv_mpu6050_chip_config {
@@ -150,6 +151,7 @@ struct inv_mpu6050_chip_config {
  *  @config:    configuration of the chip.
  *  @fifo_size:	size of the FIFO in bytes.
  *  @temp:	offset and scale to apply to raw temperature.
+ *  @startup_time: accel and gyro startup times in milliseconds.
  */
 struct inv_mpu6050_hw {
 	u8 whoami;
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c
index 6b858fdfd1c6..7c95bad60081 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c
@@ -144,10 +144,10 @@ static int inv_magn_init(struct inv_mpu6050_state *st)
  * inv_mpu_magn_probe() - probe and setup magnetometer chip
  * @st: driver internal state
  *
- * Returns 0 on success, a negative error code otherwise
- *
  * It is probing the chip and setting up all needed i2c transfers.
  * Noop if there is no magnetometer in the chip.
+ *
+ * Return: 0 on success, a negative error code otherwise.
  */
 int inv_mpu_magn_probe(struct inv_mpu6050_state *st)
 {
@@ -225,11 +225,11 @@ int inv_mpu_magn_probe(struct inv_mpu6050_state *st)
  * @st: driver internal state
  * @fifo_rate: mpu set fifo rate
  *
- * Returns 0 on success, a negative error code otherwise
- *
  * Limit sampling frequency to the maximum value supported by the
  * magnetometer chip. Resulting in duplicated data for higher frequencies.
  * Noop if there is no magnetometer in the chip.
+ *
+ * Return: 0 on success, a negative error code otherwise.
  */
 int inv_mpu_magn_set_rate(const struct inv_mpu6050_state *st, int fifo_rate)
 {
@@ -255,9 +255,9 @@ int inv_mpu_magn_set_rate(const struct inv_mpu6050_state *st, int fifo_rate)
  * inv_mpu_magn_set_orient() - fill magnetometer mounting matrix
  * @st: driver internal state
  *
- * Returns 0 on success, a negative error code otherwise
- *
  * Fill magnetometer mounting matrix using the provided chip matrix.
+ *
+ * Return: 0 on success, a negative error code otherwise.
  */
 int inv_mpu_magn_set_orient(struct inv_mpu6050_state *st)
 {
@@ -317,7 +317,7 @@ int inv_mpu_magn_set_orient(struct inv_mpu6050_state *st)
  * @axis: IIO modifier axis value
  * @val: store corresponding axis value
  *
- * Returns 0 on success, a negative error code otherwise
+ * Return: 0 on success, a negative error code otherwise.
  */
 int inv_mpu_magn_read(struct inv_mpu6050_state *st, int axis, int *val)
 {
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.h
index 185c000c697c..ec2fc80adf72 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.h
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_magn.h
@@ -18,8 +18,11 @@ int inv_mpu_magn_probe(struct inv_mpu6050_state *st);
 /**
  * inv_mpu_magn_get_scale() - get magnetometer scale value
  * @st: driver internal state
+ * @chan: magnetometer channel to get the scale for
+ * @val: integer part of the scale, always 0
+ * @val2: micro part of the scale, the raw to Gauss conversion coefficient
  *
- * Returns IIO data format.
+ * Return: IIO_VAL_INT_PLUS_MICRO, the IIO format of @val and @val2.
  */
 static inline int inv_mpu_magn_get_scale(const struct inv_mpu6050_state *st,
 					 const struct iio_chan_spec *chan,
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
index 22c1ce66f99e..5b76c3a7fbd8 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
@@ -159,6 +159,8 @@ int inv_mpu6050_prepare_fifo(struct inv_mpu6050_state *st, bool enable)
  *  inv_mpu6050_set_enable() - enable chip functions.
  *  @indio_dev:	Device driver instance.
  *  @enable: enable/disable
+ *
+ *  Return: 0 on success, a negative error code otherwise.
  */
 static int inv_mpu6050_set_enable(struct iio_dev *indio_dev, bool enable)
 {
@@ -208,6 +210,8 @@ static int inv_mpu6050_set_enable(struct iio_dev *indio_dev, bool enable)
  * inv_mpu_data_rdy_trigger_set_state() - set data ready interrupt state
  * @trig: Trigger instance
  * @state: Desired trigger state
+ *
+ * Return: 0 on success, a negative error code otherwise.
  */
 static int inv_mpu_data_rdy_trigger_set_state(struct iio_trigger *trig,
 					      bool state)
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: imu: inv_mpu6050: fix kernel-doc warnings
  2026-10-11  4:57 [PATCH] iio: imu: inv_mpu6050: fix kernel-doc warnings Arnav Kapoor
@ 2026-10-11 17:33 ` Joshua Crofts
  0 siblings, 0 replies; 2+ messages in thread
From: Joshua Crofts @ 2026-10-11 17:33 UTC (permalink / raw)
  To: Arnav Kapoor
  Cc: Jean-Baptiste Maneyrol, Jonathan Cameron, David Lechner,
	Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel

On Sun, 11 Oct 2026 10:27:49 +0530
Arnav Kapoor <kapoorarnav43@gmail.com> wrote:

> scripts/kernel-doc -Wall reports several warnings for the inv_mpu6050
> driver:
> 
> - inv_mpu_magn_get_scale() only describes @st, not @chan, @val and @val2.
> - Eight functions use "Returns ..." in the body instead of a "Return:"
>   section, and inv_mpu6050_set_enable() and
>   inv_mpu_data_rdy_trigger_set_state() do not describe their return
>   value at all, e.g.:
> 
>     Warning: .../inv_mpu_aux.c:87 No description found for return value
>     of 'inv_mpu_aux_init'
> 
> - int_pin_cfg in struct inv_mpu6050_reg_map is documented with a ';'
>   instead of a ':' after the name, so kernel-doc does not see it, and
>   user_ctrl in struct inv_mpu6050_chip_config and startup_time in
>   struct inv_mpu6050_hw are not documented.
> 
> Describe the missing parameters, members and return values, and convert
> the return value descriptions to "Return:" sections. Where the return
> value was described before the long description, move it after it, so
> the description is not parsed as part of the return value section.
> 
> With this change, scripts/kernel-doc -Wall reports no warnings for
> drivers/iio/imu/inv_mpu6050/. Comment-only change.
> 
> Assisted-by: LLM
> Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
> ---

Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>

-- 
Kind regards,
Joshua Crofts

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-11 17:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11  4:57 [PATCH] iio: imu: inv_mpu6050: fix kernel-doc warnings Arnav Kapoor
2026-10-11 17:33 ` Joshua Crofts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®