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: <20220907154946.GA114629@bhelgaas>
Date:   Wed, 7 Sep 2022 10:49:46 -0500
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Sathyanarayanan Kuppuswamy 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc:     Kai-Heng Feng <kai.heng.feng@...onical.com>,
        Rajvi Jingar <rajvi.jingar@...ux.intel.com>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Koba Ko <koba.ko@...onical.com>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        "David E . Box" <david.e.box@...ux.intel.com>,
        linux-pci@...r.kernel.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH v3 02/10] PCI/PTM: Cache PTM Capability offset

On Tue, Sep 06, 2022 at 04:18:23PM -0700, Sathyanarayanan Kuppuswamy wrote:
> On 9/6/22 3:23 PM, Bjorn Helgaas wrote:

> >  void pci_disable_ptm(struct pci_dev *dev)
> >  {
> > -	int ptm;
> > +	int ptm = dev->ptm_cap;
> 
> I think you don't need to store it. Directly use dev->ptm?

True, no need, but the value is used three times in this function, so
I think the variable reduces clutter overall.

> >  void pci_restore_ptm_state(struct pci_dev *dev)
> >  {
> > +	int ptm = dev->ptm_cap;
> 
> It can be u16?

Done, thanks!  I see that in ee8b1c478a9f ("PCI: Return u16 from
pci_find_ext_capability() and similar"), I forgot to change the inline
stub from int to u16.  I'll add a patch to do that.  Probably not a
prerequisite, since the stub is for !CONFIG_PCI and this code won't
be compiled at all in that case.

> >  void pci_ptm_init(struct pci_dev *dev)
> >  {
> > -	int pos;
> > +	int ptm;
> 
> Why rename? Also ptm can be u16

"ptm" conveys more information than "pos" and I think it's worth using
the same name for all the functions.

Thank you!

Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ