Re: [PATCH] mm/page_alloc: fix documentation error and remove magic numbers

2020-06-24 Thread Matthew Wilcox
On Wed, Jun 24, 2020 at 10:26:26AM -0400, Rafael Aquini wrote: > Joel's approach, however, makes sense if you consider it's generally a > good practice to get rid of the unnamed magic numbers anti-pattern. But I don't. I care about how easy it is to understand the code, not conforming to some bu

Re: [PATCH] mm/page_alloc: fix documentation error and remove magic numbers

2020-06-24 Thread Rafael Aquini
On Wed, Jun 24, 2020 at 03:09:58PM +0100, Matthew Wilcox wrote: > On Wed, Jun 24, 2020 at 10:07:27AM -0400, Rafael Aquini wrote: > > On Wed, Jun 24, 2020 at 12:12:55PM +0100, Matthew Wilcox wrote: > > > On Tue, Jun 23, 2020 at 11:27:12PM -0400, Joel Savitz wrote: > > > > In addition, this patch rep

Re: [PATCH] mm/page_alloc: fix documentation error and remove magic numbers

2020-06-24 Thread Matthew Wilcox
On Wed, Jun 24, 2020 at 10:07:27AM -0400, Rafael Aquini wrote: > On Wed, Jun 24, 2020 at 12:12:55PM +0100, Matthew Wilcox wrote: > > On Tue, Jun 23, 2020 at 11:27:12PM -0400, Joel Savitz wrote: > > > In addition, this patch replaces the magic number bounds with symbolic > > > constants to clarify t

Re: [PATCH] mm/page_alloc: fix documentation error and remove magic numbers

2020-06-24 Thread Rafael Aquini
On Wed, Jun 24, 2020 at 12:12:55PM +0100, Matthew Wilcox wrote: > On Tue, Jun 23, 2020 at 11:27:12PM -0400, Joel Savitz wrote: > > In addition, this patch replaces the magic number bounds with symbolic > > constants to clarify the logic. > > Why do people think this kind of thing makes the code ea

Re: [PATCH] mm/page_alloc: fix documentation error and remove magic numbers

2020-06-24 Thread Matthew Wilcox
On Tue, Jun 23, 2020 at 11:27:12PM -0400, Joel Savitz wrote: > In addition, this patch replaces the magic number bounds with symbolic > constants to clarify the logic. Why do people think this kind of thing makes the code easier to read? It actually makes it harder. Unless the constants are used