drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
'flush_fifo' label performs same task as 'endsession' label
immediately after calling 'env_reset_fifo' function.
so i remove that duplication.
Signed-off-by: Gyeyoung Baek <gye976@gmail.com>
---
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
index 45c37525c2f1..40107b4457d4 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
@@ -192,15 +192,12 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
iio_push_to_buffers_with_timestamp(indio_dev, st->data, timestamp);
}
-end_session:
- mutex_unlock(&st->lock);
- iio_trigger_notify_done(indio_dev->trig);
-
- return IRQ_HANDLED;
flush_fifo:
/* Flush HW and SW FIFOs. */
inv_reset_fifo(indio_dev);
+
+end_session:
mutex_unlock(&st->lock);
iio_trigger_notify_done(indio_dev->trig);
--
2.34.1
> 'flush_fifo' label performs same task as 'endsession' label
end_session?
The number of actions differ between involved jump targets.
> immediately after calling 'env_reset_fifo' function.
> so i remove that duplication.
* You would like to specify a corresponding goto chain at the moment,
don't you?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.11-rc5#n526
* How do you think about to increase the application of scope-based resource management?
Regards,
Markus
Hello, I apologize for the insufficient explanation.
---
Before the change:
"end_session:
mutex_unlock(&st->lock);
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED;
flush_fifo:
/* Flush HW and SW FIFOs. */
inv_reset_fifo(indio_dev);
mutex_unlock(&st->lock);
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED;
"
---
After the change:
"flush_fifo:
/* Flush HW and SW FIFOs. */
inv_reset_fifo(indio_dev);
end_session:
mutex_unlock(&st->lock);
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED;"
---
Here, 'flush_fifo' and 'end_session' are not the same. However, the
work of 'flush_fifo' is a superset of 'end_session'.
On Sun, Sep 1, 2024 at 9:08 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> > 'flush_fifo' label performs same task as 'endsession' label
>
> end_session?
>
> The number of actions differ between involved jump targets.
>
>
> > immediately after calling 'env_reset_fifo' function.
> > so i remove that duplication.
>
> * You would like to specify a corresponding goto chain at the moment,
> don't you?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.11-rc5#n526
>
> * How do you think about to increase the application of scope-based resource management?
firstly I understood that you might be referring to RAII. but I think
this issue is not related to RAII.
thanks for response.
>
>
> Regards,
> Markus
© 2016 - 2026 Red Hat, Inc.