[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZSmd1y+kaZkz1sXq@x1-carbon>
Date: Fri, 13 Oct 2023 19:43:21 +0000
From: Niklas Cassel <Niklas.Cassel@....com>
To: Keith Busch <kbusch@...nel.org>
CC: Daniel Wagner <dwagner@...e.de>,
"linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Christoph Hellwig <hch@....de>,
Kenji Tomonaga <tkenbo@...il.com>
Subject: Re: [PATCH v2] nvme: update firmware version after commit
On Fri, Oct 13, 2023 at 10:43:48AM -0600, Keith Busch wrote:
> On Fri, Oct 13, 2023 at 06:34:20PM +0200, Daniel Wagner wrote:
> > if (nvme_get_log(ctrl, NVME_NSID_ALL, NVME_LOG_FW_SLOT, 0, NVME_CSI_NVM,
> > - log, sizeof(*log), 0))
> > + log, sizeof(*log), 0)) {
> > dev_warn(ctrl->device, "Get FW SLOT INFO log error\n");
> > + goto out_free_log;
> > + }
> > +
> > + afi = le64_to_cpu(log->afi);
> > + if (afi & 0x30) {
>
> That should be 'afi & 0x70'.
Personally, I like GENMASK().
In this specific case it would be GENMASK_ULL(6, 4);
I find that more readable than 0x70.
Although for some reason GENMASK()/GENMASK_ULL() does not
seem to be used in drivers/nvme/
Kind regards,
Niklas
Powered by blists - more mailing lists