[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160713103137.GB30921@twins.programming.kicks-ass.net>
Date: Wed, 13 Jul 2016 12:31:37 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Chris Wilson <chris@...is-wilson.co.uk>
Cc: linux-kernel@...r.kernel.org,
Sumit Semwal <sumit.semwal@...aro.org>,
Shuah Khan <shuahkh@....samsung.com>,
Tejun Heo <tj@...nel.org>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...nel.org>,
Kees Cook <keescook@...omium.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Dan Williams <dan.j.williams@...el.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Davidlohr Bueso <dave@...olabs.net>,
Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
"David S. Miller" <davem@...emloft.net>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Alexander Potapenko <glider@...gle.com>,
linux-media@...r.kernel.org, dri-devel@...ts.freedesktop.org,
linaro-mm-sig@...ts.linaro.org
Subject: Re: [PATCH 3/9] async: Extend kfence to allow struct embedding
On Fri, Jun 24, 2016 at 10:08:47AM +0100, Chris Wilson wrote:
> @@ -151,7 +161,11 @@ static void kfence_free(struct kref *kref)
>
> WARN_ON(atomic_read(&fence->pending) > 0);
>
> - kfree(fence);
> + if (fence->flags) {
> + kfence_notify_t fn = (kfence_notify_t)fence->flags;
Maybe provide an inline helper for that conversion and also mask out the
low bits, just to be careful. You're assuming they're not set here,
which seems like a dangerous thing.
> + fn(fence);
> + } else
> + kfree(fence);
Also Codingstyle wants braces on both branches if its on one.
Powered by blists - more mailing lists