lkml.org 
[lkml]   [2022]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 1/4] mm: hugetlb_vmemmap: introduce STRUCT_PAGE_SIZE_IS_POWER_OF_2
On Thu, 31 Mar 2022 10:52:58 +0800 Muchun Song <songmuchun@bytedance.com> wrote:

> > > +int main(void)
> > > +{
> > > + if (is_power_of_2(sizeof(struct page)))
> > > + DEFINE(STRUCT_PAGE_SIZE_IS_POWER_OF_2, is_power_of_2(sizeof(struct page)));
> >
> > Why not
> >
> > DEFINE(STRUCT_PAGE_SIZE_IS_POWER_OF_2, 1);
> >
>
> Yep, this is more simple. But the 2nd parameter of DEFINE() will
> go into the comments. I want to make it more clear when someone
> reads the code of this macro. The two different sentences will
> generate the following two different comments. Which one do
> you think is better?
>
> #define STRUCT_PAGE_SIZE_IS_POWER_OF_2 1 /*
> is_power_of_2(sizeof(struct page)) */
> #define STRUCT_PAGE_SIZE_IS_POWER_OF_2 1 /* 1 */

The former ;)

\
 
 \ /
  Last update: 2022-03-31 06:18    [W:0.036 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site