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: <f89b5c62-56d5-3437-f8e7-24c5d74a7afa@nvidia.com>
Date:   Wed, 28 Jul 2021 13:31:19 -0500
From:   Shanker R Donthineni <sdonthineni@...dia.com>
To:     Bjorn Helgaas <helgaas@...nel.org>,
        Amey Narkhede <ameynarkhede03@...il.com>
CC:     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 2/8] PCI: Add new array for keeping track of ordering
 of reset methods

Hi Bjorn,

On 7/27/21 5:59 PM, Bjorn Helgaas wrote:
>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>> index fefa6d7b3..42440cb10 100644
>> --- a/drivers/pci/pci.c
>> +++ b/drivers/pci/pci.c
>> @@ -72,6 +72,14 @@ static void pci_dev_d3_sleep(struct pci_dev *dev)
>>               msleep(delay);
>>  }
>>
>> +int pci_reset_supported(struct pci_dev *dev)
>> +{
>> +     u8 null_reset_methods[PCI_NUM_RESET_METHODS] = { 0 };
>> +
>> +     return memcmp(null_reset_methods,
>> +                   dev->reset_methods, sizeof(null_reset_methods));
> I think "return dev->reset_methods[0] != 0;" is sufficient, isn't it?
>

Agree with you, it simplifies code logic and can be moved to "include/linux/pci.h"
with inline definition. Can we change return type to 'bool' instead of 'int' ?

static inline bool pci_reset_supported(struct pci_dev *dev)
{  
    return !!dev->reset_methods[0];
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ