Messages in this thread | | | Date | Mon, 27 Apr 2020 10:24:08 -0700 | From | "Luck, Tony" <> | Subject | Re: [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
| |