[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200427172408.GA13177@agluck-desk2.amr.corp.intel.com>
Date: Mon, 27 Apr 2020 10:24:08 -0700
From: "Luck, Tony" <tony.luck@...el.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Robert Richter <rrichter@...vell.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
James Morse <james.morse@....com>,
Aristeu Rozanski <aris@...hat.com>,
Matthias Brugger <mbrugger@...e.com>,
linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
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
Powered by blists - more mailing lists