[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aDlK8VH3GRSJCKCk@pengutronix.de>
Date: Fri, 30 May 2025 08:06:41 +0200
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Troy Mitchell <troymitchell988@...il.com>
Cc: Pengutronix Kernel Team <kernel@...gutronix.de>,
Andi Shyti <andi.shyti@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Fabio Estevam <festevam@...il.com>, linux-i2c@...r.kernel.org,
imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, Yongchao Jia <jyc0019@...il.com>,
Frank Li <Frank.Li@....com>
Subject: Re: [PATCH v3 1/2] i2c: imx: use guard to take spinlock
On Tue, May 13, 2025 at 02:36:13PM +0800, Troy Mitchell wrote:
> Use guard to automatically release the lock after going out of scope
> instead of calling it manually.
>
> i2c_imx_slave_handle() can safely be entered with the lock held.
>
> Refactored the i2c_imx_isr function so that i2c_imx_master_isr
> does not participate in the guard scope
>
> So Using scoped_guard simplifies the control flow
> by ensuring consistent and automatic unlock,
> which improves readability without affecting correctness.
>
> Co-developed-by: Yongchao Jia <jyc0019@...il.com>
> Signed-off-by: Yongchao Jia <jyc0019@...il.com>
> Reviewed-by: Frank Li <Frank.Li@....com>
> Signed-off-by: Troy Mitchell <troymitchell988@...il.com>
Acked-by: Oleksij Rempel <o.rempel@...gutronix.de>
Thank you!
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Powered by blists - more mailing lists