On Thu, Sep 20, 2018 at 07:31:19PM +0200, Peter Rosin wrote: > On 2018-09-20 18:14, Wolfram Sang wrote: > > 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@xxxxxxxxxxxxxxxxxxxx> > > 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.
Attachment:
signature.asc
Description: PGP signature