Thread (21 messages) flat view 21 messages, 7 authors, 2019-02-09
STALE2771d

[RFC PATCH 3/4] i2c: core: use I2C locking behaviour also for SMBUS

From: Wolfram Sang <hidden>
Date: 2018-09-20 22:48:18
Also in: linux-i2c, linux-omap, linux-renesas-soc

On Thu, Sep 20, 2018 at 07:31:19PM +0200, Peter Rosin wrote:
On 2018-09-20 18:14, Wolfram Sang wrote:
quoted
If I2C transfers are executed in atomic contexts, trylock is used
instead of lock. This behaviour was missing for SMBUS, although a lot of
transfers are of SMBUS type, either emulated or direct. So, factor out
the locking routine into a helper and use it for I2C and SMBUS.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Is it ok with static analyzers to "hide" the locking in helpers like
this? Will it not be harder for them to "see" what's going on? But I
don't think we have any annotations anyway, so...
Yes, you are right. Yet, I prefer this to open coding the same twice and
have the problem to keep them in sync.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180921/d7ab1c6e/attachment.sig>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help