Re: [cocci] question about kernel cocci and cleanup.h

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

 



> Hi Julia and team, I had a question about whether it’s possible to use coccinelle/spatch to start to identify functions which are able to use inline destructors (__free or DEFINE_FREE()) from include/linux/cleanup.h

Some information can be determined for the discussed macro.
https://elixir.bootlin.com/linux/v6.8-rc7/source/include/linux/cleanup.h#L8
https://elixir.bootlin.com/linux/v6.8-rc7/A/ident/DEFINE_FREE

19 calls are performed for this macro so far in header and/or source files of
the software “Linux next-20240308”.

I suggest to take another look also at algorithmic properties.
There are different development views involved for the implementation detail
if the specification of repeated pointer checks would be needed for the third
macro parameter.

How do you think about to compare design decisions accordingly?

Examples:
* device property: Move fwnode_handle_put() into property.h
  Jonathan Cameron
  2024-02-17
  https://lore.kernel.org/r/20240217164249.921878-2-jic23@xxxxxxxxxx

* locking: Introduce __cleanup() based infrastructure
  Peter Zijlstra
  2023-05-26
  https://lkml.kernel.org/r/20230612093537.614161713%40infradead.org

* platform/x86/intel/pmc: Cleanup SSRAM discovery
  David E. Box
  2023-11-29
  https://lore.kernel.org/r/20231129222132.2331261-14-david.e.box@xxxxxxxxxxxxxxx

* pstore: inode: Use __free(pstore_iput) for inode allocations
  Kees Cook
  2023-12-05
  https://lore.kernel.org/r/20231205182622.1329923-3-keescook@xxxxxxxxxxxx


Will any further change possibilities become clearer?

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