Re: [PATCH] iio: imu: inv_mpu6050: Remove duplicate code between labels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx> 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





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux