[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjvh_LUpa=864joG2JJXs3+viO-kLzLidR2JLyMr4MNwA@mail.gmail.com>
Date: Thu, 3 Apr 2025 11:15:44 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org, vbabka@...e.cz,
peterz@...radead.org, andriy.shevchenko@...ux.intel.com,
intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org
Subject: Re: [RFC] slab: introduce auto_kfree macro
On Tue, 1 Apr 2025 at 06:50, Przemek Kitszel
<przemyslaw.kitszel@...el.com> wrote:
>
> With new auto_kfree, we simply will start with
> struct my_dev_foo *foo auto_kfree;
> and be safe against future extensions.
Honestly, I'd much rather just see any auto-freeing *always* assigning
the value.
We used to have a rule that declarations had to be at the top of a
block, which made that not an option, but that rule went out the
window exactly because you can't do that with the cleanup macros.
So just make the rule be that __free() without an assignment is simply a bug.
Linus
Powered by blists - more mailing lists