From: Lukas Wunner <lukas@wunner.de>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Yicong Yang <yangyicong@hisilicon.com>,
linux-pci@vger.kernel.org,
sathyanarayanan.kuppuswamy@linux.intel.com, kbusch@kernel.org,
sean.v.kelley@intel.com, qiuxu.zhuo@intel.com,
prime.zeng@huawei.com, linuxarm@openeuler.org
Subject: Re: [PATCH] PCI/DPC: Disable ERR_COR explicitly for native dpc service
Date: Sat, 10 Apr 2021 21:17:49 +0200 [thread overview]
Message-ID: <20210410191749.GA16240@wunner.de> (raw)
In-Reply-To: <20210410152103.GA2043340@bjorn-Precision-5520>
On Sat, Apr 10, 2021 at 10:21:03AM -0500, Bjorn Helgaas wrote:
> Anybody want to chime in and review this? Sometimes I feel like a
> one-man band :)
Can't say anything about the object of the patch, but style-wise
this looks cryptic:
> > --- a/drivers/pci/pcie/dpc.c
> > +++ b/drivers/pci/pcie/dpc.c
> > @@ -302,7 +302,7 @@ static int dpc_probe(struct pcie_device *dev)
> > pci_read_config_word(pdev, pdev->dpc_cap + PCI_EXP_DPC_CTL, &ctl);
> >
> > - ctl = (ctl & 0xfff4) | PCI_EXP_DPC_CTL_EN_FATAL | PCI_EXP_DPC_CTL_INT_EN;
> > + ctl = (ctl & 0xffe4) | PCI_EXP_DPC_CTL_EN_FATAL | PCI_EXP_DPC_CTL_INT_EN;
> > pci_write_config_word(pdev, pdev->dpc_cap + PCI_EXP_DPC_CTL, ctl);
Instead of writing "ctl & 0xfff4", I'd prefer defining macros for the
register bits of interest, then use "ctl &= ~(u16)(bits to clear)"
and in a separate line use "ctl |= (bits to set)".
Obviously, clearing bits that are unconditionally set afterwards is
unnecessary (as is done here).
> > pci_info(pdev, "enabled with IRQ %d\n", dev->irq);
This looks superfluous since the IRQ can be found out in /proc/interrupts.
Thanks,
Lukas
next prev parent reply other threads:[~2021-04-10 19:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 12:53 [PATCH v2] PCI/DPC: Check host->native_dpc before enable dpc service Yicong Yang
2021-02-03 12:53 ` [PATCH] PCI/DPC: Disable ERR_COR explicitly for native " Yicong Yang
2021-02-18 17:20 ` Bjorn Helgaas
2021-02-24 8:56 ` Yicong Yang
2021-04-10 15:21 ` Bjorn Helgaas
2021-04-10 19:17 ` Lukas Wunner [this message]
2021-04-12 9:32 ` Yicong Yang
2021-04-12 3:32 ` Kuppuswamy, Sathyanarayanan
2021-04-12 9:46 ` Yicong Yang
2021-02-24 9:47 ` [PATCH v2] PCI/DPC: Check host->native_dpc before enable " Yicong Yang
2021-07-26 22:05 ` Bjorn Helgaas
2021-07-28 9:22 ` Yicong Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210410191749.GA16240@wunner.de \
--to=lukas@wunner.de \
--cc=helgaas@kernel.org \
--cc=kbusch@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxarm@openeuler.org \
--cc=prime.zeng@huawei.com \
--cc=qiuxu.zhuo@intel.com \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=sean.v.kelley@intel.com \
--cc=yangyicong@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox