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: <20210728221636.GA858116@bjorn-Precision-5520>
Date:   Wed, 28 Jul 2021 17:16:36 -0500
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Shanker R Donthineni <sdonthineni@...dia.com>
Cc:     Amey Narkhede <ameynarkhede03@...il.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        alex.williamson@...hat.com,
        Raphael Norwitz <raphael.norwitz@...anix.com>,
        linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
        kw@...ux.com, Sinan Kaya <okaya@...nel.org>,
        Len Brown <lenb@...nel.org>,
        "Rafael J . Wysocki" <rjw@...ysocki.net>
Subject: Re: [PATCH v10 1/8] PCI: Add pcie_reset_flr to follow calling
 convention of other reset methods

On Wed, Jul 28, 2021 at 04:58:14PM -0500, Shanker R Donthineni wrote:
> On 7/28/21 3:23 PM, Bjorn Helgaas wrote:
> > On Wed, Jul 28, 2021 at 01:54:16PM -0500, Shanker R Donthineni wrote:
> >> On 7/27/21 5:12 PM, Bjorn Helgaas wrote:
> >>> On Fri, Jul 09, 2021 at 06:08:06PM +0530, Amey Narkhede wrote:
> >>>> Add has_pcie_flr bitfield in struct pci_dev to indicate support for PCIe
> >>>> FLR to avoid reading PCI_EXP_DEVCAP multiple times.

> >> -       pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &cap);
> >> -       return cap & PCI_EXP_DEVCAP_FLR;
> >> +       return !!FIELD_GET(PCI_EXP_DEVCAP_FLR, dev->devcap);
> >
> > Nice, thanks for reminding me of FIELD_GET().  I like how that works
> > without having to #define *_SHIFT values.  I personally don't care for
> > "!!" and would probably write something like:
> >
> >   return FIELD_GET(PCI_EXP_DEVCAP_FLR, dev->devcap) == 1;
> 
> Both are same since FLR is a single bit value.

Right; this is a style preference, not a correctness question.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ