lkml.org 
[lkml]   [2020]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 06/10] EDAC/ghes: Remove local variable rdr_mask in ghes_edac_dmidecode()
On Mon, Apr 27, 2020 at 09:08:02AM +0200, Borislav Petkov wrote:
> > if (entry->type_detail & BIT(6))
> > dimm->mtype = MEM_RMBS;
> > - else if ((entry->type_detail & rdr_mask) == rdr_mask)
> > + else if ((entry->type_detail & BIT(7)) &&
> > + (entry->type_detail & BIT(13)))
>
> Well, "checks some bits" doesn't make it more telling than checking a
> descriptive name like "rdr_mask" but ok, since we're assigning MEM_RDR
> here, it is still clear what the check does.
>
> Btw, please write it like this:
>
> else if (entry->type_detail & (BIT(7) | BIT(13)))

That isn't the same. The previous version checked that BOTH bits
7 and 13 were set. Your version checks for either bit.

Looks like the original with the local variable was checking for both
bits set.

-Tony

\
 
 \ /
  Last update: 2020-04-27 19:25    [W:0.119 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site