Increasing usage of mutex guards (with SmPL)?

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

 



Hello,

I constructed another small script variant for the semantic patch language.


@replacement disable decl_init@
expression action, e, value;
expression list el;
identifier rc;
@@
-int rc;
 ... when != rc = value
     when any
-mutex_lock
+guard(mutex)
           (&e);
-rc = action(el);
-mutex_unlock(&e);
 return
-       rc
+       action(el)
 ;


I tried this SmPL script example out on source code from the software
“Linux next-20240523”.
425 source files were found where some function implementations could be adjusted
also according to the application of mutual exclusion.


Will it become helpful to offer further SmPL script variants which can be used
together with the tool “coccicheck”?

Regards,
Markus





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux