lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200624115635.852cb4563ad52844685e5c61@linux-foundation.org>
Date:   Wed, 24 Jun 2020 11:56:35 -0700
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Joel Savitz <jsavitz@...hat.com>, linux-kernel@...r.kernel.org,
        Vlastimil Babka <vbabka@...e.cz>,
        John Hubbard <jhubbard@...dia.com>,
        Rafael Aquini <aquini@...hat.com>,
        "Fabrizio D'Angelo" <fdangelo@...hat.com>, linux-mm@...ck.org
Subject: Re: [PATCH v2] mm/page_alloc: fix documentation error and remove
 magic numbers

On Wed, 24 Jun 2020 18:01:31 +0100 Matthew Wilcox <willy@...radead.org> wrote:

> On Wed, Jun 24, 2020 at 12:49:43PM -0400, Joel Savitz wrote:
> > When I increased the upper bound of the min_free_kbytes value in
> > ee8eb9a5fe863, I forgot to tweak the above comment to reflect
> > the new value. This patch fixes that mistake.
> > 
> > In addition, this patch replaces the magic number bounds with symbolic
> > constants to clarify the logic.
> > 
> > changes from v1:
> > - declare constants via enum instead of separate integers
> > 
> > Suggested-by: John Hubbard <jhubbard@...dia.com>
> > Suggested-by: Vlastimil Babka <vbabka@...e.cz>
> > Signed-off-by: Joel Savitz <jsavitz@...hat.com>
> 
> NAK.  Just fix the documentation.  It's bad form to combine two completely
> different things in one patch anyway.

I don't think the enums add value anyway - if these numbers are only
used in a single place, it's clearer to just open-code them.

One advantage of using a #define/enum for single-use constants is that
the #define/enum site provides a neat location for documenting
(commenting) the reasoning behind the particular values which were
chosen.  But this patch didn't do that.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ