[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b40726f9c70671bbd1a4c25dad723329f38a1ee2.camel@gmail.com>
Date: Fri, 28 Jan 2022 12:05:33 +0100
From: Karolina Drobnik <karolinadrobnik@...il.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-mm@...ck.org, akpm@...ux-foundation.org,
mike.rapoport@...il.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/16] tools/include: Add _RET_IP_ and math definitions
to kernel.h
On Thu, 2022-01-27 at 13:54 +0000, Matthew Wilcox wrote:
> On Thu, Jan 27, 2022 at 02:21:21PM +0100, Karolina Drobnik wrote:
> > Add max_t, min_t and clamp functions, together with _RET_IP_
> > definition, so they can be used in testing.
>
> Rather than adding our own definitions of min/max/clamp, have
> you considered using #include "../../../include/linux/minmax.h"?
I tried doing it in the very beginning and couldn't get it to compile.
Now, I see it's because in minmax.h we use __UNIQUE_ID, which is
undefined because of "#ifdef __KERNEL__" in include/linux/compiler.h.
> In my experience reusing this kind of "leaf" header works out
> better than duplicating it.
I like this approach as well, and I tried to use it in other memblock
headers. Still, as it's not that straightforward here, and I went for
duplication.
Powered by blists - more mailing lists