lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADEbmW1R64YsLxjZV3FPZDR597OmJQ6J5FaMP0=QHsoEwFCaWA@mail.gmail.com>
Date: Wed, 6 Dec 2023 15:20:36 +0100
From: Michal Schmidt <mschmidt@...hat.com>
To: Shinas Rasheed <srasheed@...vell.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, 
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Haseeb Gani <hgani@...vell.com>, 
	Vimlesh Kumar <vimleshk@...vell.com>, "egallen@...hat.com" <egallen@...hat.com>, 
	"pabeni@...hat.com" <pabeni@...hat.com>, "horms@...nel.org" <horms@...nel.org>, 
	"kuba@...nel.org" <kuba@...nel.org>, "davem@...emloft.net" <davem@...emloft.net>, 
	"wizhao@...hat.com" <wizhao@...hat.com>, "konguyen@...hat.com" <konguyen@...hat.com>, 
	Veerasenareddy Burru <vburru@...vell.com>, Sathesh B Edara <sedara@...vell.com>, 
	Eric Dumazet <edumazet@...gle.com>, Abhijit Ayarekar <aayarekar@...vell.com>, 
	Satananda Burla <sburla@...vell.com>
Subject: Re: [EXT] Re: [PATCH net v1] octeon_ep: explicitly test for firmware
 ready value

On Wed, Dec 6, 2023 at 3:12 PM Shinas Rasheed <srasheed@...vell.com> wrote:
>
> Hi Michal
>
> > -----Original Message-----
> > From: Michal Schmidt <mschmidt@...hat.com>
> > Sent: Wednesday, December 6, 2023 7:28 PM
> > To: Shinas Rasheed <srasheed@...vell.com>
> > >                 pci_read_config_byte(pdev, (pos + 8), &status);
> > >                 dev_info(&pdev->dev, "Firmware ready status = %u\n", status);
> > > -               return status;
> > > +#define FW_STATUS_READY 1ULL
> > > +               return (status == FW_STATUS_READY) ? true : false;
> >
> > "status == FW_STATUS_READY" is already the bool value you want. You
> > don't need to use the ternary operator here.
> >
>
> In some abnormal cases, the driver can read the firmware ready status as 2. Hence this need for explicitly checking if status
> is indeed 1 or not. If it is 2, the function should understand it as the firmware is not ready. (It has to be strictly 1 for the driver
> to understand it as ready)

I'm not disputing that. I'm saying that this:
  return (status == FW_STATUS_READY) ? true : false;
is equivalent to:
  return status == FW_STATUS_READY;

Michal


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ