Re: [PATCH v6 1/4] mm: hugetlb_vmemmap: introduce STRUCT_PAGE_SIZE_IS_POWER_OF_2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 31 Mar 2022 10:52:58 +0800 Muchun Song <songmuchun@xxxxxxxxxxxxx> 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 ;)



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux