lkml.org 
[lkml]   [2021]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2021-07-29 00:17    [W:0.050 / U:2.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site