[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKbEznvriPOTZHFyNVoNkAce5q2vy+itN5yJ20kCQw3Akn_PEQ@mail.gmail.com>
Date: Sun, 1 Sep 2024 22:40:52 +0900
From: gyeyoung <gye976@...il.com>
To: Markus Elfring <Markus.Elfring@....de>
Cc: linux-iio@...r.kernel.org, Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] iio: imu: inv_mpu6050: Remove duplicate code between labels
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@....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
Powered by blists - more mailing lists