Re: [patch RFC] mm/slab: introduce KZALLOC_FREE() cleanup-ed allocation macro

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

 



Fri, Mar 15, 2024 at 10:39:02PM CET, rientjes@xxxxxxxxxx wrote:
>On Fri, 15 Mar 2024, Jiri Pirko wrote:
>
>> From: Jiri Pirko <jiri@xxxxxxxxxx>
>> 
>> With introduction of __free() macro using cleanup infrastructure, it
>> will very likely become quite common to see following pattern:
>> 	type *var __free(kfree) = kzalloc(sizeof(*var), GFP_KERNEL);
>> 
>> To follow the CLASS() flow from cleanup.h, introduce a simple macro
>> KZALLOC_FREE() to wrap this over and allow the same flow.
>> 
>> Show an example usage in gpio-sim driver.
>> 
>
>Seems highly specialized especially for kzalloc specifically, so not sure 
>this warrants its own macro.

Yeah, but having like 2-3 macro variants would probably cover vast
majority of usecases now. The rest could still do things manually.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux