lkml.org 
[lkml]   [2022]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] mm: wrap __find_buddy_pfn() with a necessary buddy page validation.
On Fri, Apr 1, 2022 at 6:58 AM Zi Yan <zi.yan@sent.com> wrote:
>
> +extern bool find_buddy_page_pfn(struct page *page, unsigned int order,
> + struct page **buddy, unsigned long *buddy_pfn);

Wouldn't it make more sense to just return the 'struct page *buddy'
here, instead of the 'bool'?

So a NULL buddy means the obvious "no buddy found".

I dislike those "pass return value by reference" in general, and the
above has _two_ of them.

We can get rid of at least one very obviously.

Linus

\
 
 \ /
  Last update: 2022-04-01 18:48    [W:0.143 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site