lkml.org 
[lkml]   [2022]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] mm/hugetlb: add folio support to hugetlb specific flag macros
On Mon, Aug 29, 2022 at 04:00:08PM -0700, Sidhartha Kumar wrote:
> #define TESTHPAGEFLAG(uname, flname) \
> +static __always_inline \
> +int folio_test_hugetlb_##flname(struct folio *folio) \

One change I made was to have folio_test_foo() return bool instead of
int. It helps the compiler really understand what's going on. Maybe
some humans too ;-)

> + { void **private = &folio->private; \
> + return test_bit(HPG_##flname, (void *)((unsigned long)private)); \

I've made this tricky for you by making folio->private a void * instead
of the unsigned long in page. Would this look better as ...

{ \
void *private = &folio->private; \
return test_bit(HPG_##flname, private); \

perhaps?

\
 
 \ /
  Last update: 2022-08-30 05:34    [W:0.116 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site