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: <0fd12beb-1e53-4596-a261-9870452a6c19@synopsys.com>
Date:   Wed, 2 Jan 2019 18:31:43 +0000
From:   Gustavo Pimentel <gustavo.pimentel@...opsys.com>
To:     Andrey Smirnov <andrew.smirnov@...il.com>,
        Gustavo Pimentel <gustavo.pimentel@...opsys.com>
CC:     "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        "Fabio Estevam" <fabio.estevam@....com>,
        Chris Healy <cphealy@...il.com>,
        "Lucas Stach" <l.stach@...gutronix.de>,
        Leonard Crestez <leonard.crestez@....com>,
        "A.s. Dong" <aisheng.dong@....com>,
        Richard Zhu <hongxing.zhu@....com>,
        "linux-imx@....com" <linux-imx@....com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 11/21] PCI: designware: Make use of BIT() in constant
 definitions

Hi,

On 02/01/2019 18:28, Andrey Smirnov wrote:
> On Wed, Dec 26, 2018 at 7:19 AM Gustavo Pimentel
> <gustavo.pimentel@...opsys.com> wrote:
>>
>> Hi,
>>
>> On 21/12/2018 07:27, Andrey Smirnov wrote:
>>> Avoid using explicit left shifts and convert various definitions to
>>> use BIT() instead. No functional change intended.
>>>
>>> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
>>> Cc: Bjorn Helgaas <bhelgaas@...gle.com>
>>> Cc: Fabio Estevam <fabio.estevam@....com>
>>> Cc: Chris Healy <cphealy@...il.com>
>>> Cc: Lucas Stach <l.stach@...gutronix.de>
>>> Cc: Leonard Crestez <leonard.crestez@....com>
>>> Cc: "A.s. Dong" <aisheng.dong@....com>
>>> Cc: Richard Zhu <hongxing.zhu@....com>
>>> Cc: linux-imx@....com
>>> Cc: linux-arm-kernel@...ts.infradead.org
>>> Cc: linux-kernel@...r.kernel.org
>>> Cc: linux-pci@...r.kernel.org
>>> Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.com>
>>> ---
>>>  drivers/pci/controller/dwc/pcie-designware.c |  2 +-
>>>  drivers/pci/controller/dwc/pcie-designware.h | 18 +++++++++---------
>>>  2 files changed, 10 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
>>> index d123ac290b9e..086e87a40316 100644
>>> --- a/drivers/pci/controller/dwc/pcie-designware.c
>>> +++ b/drivers/pci/controller/dwc/pcie-designware.c
>>> @@ -300,7 +300,7 @@ void dw_pcie_disable_atu(struct dw_pcie *pci, int index,
>>>       }
>>>
>>>       dw_pcie_writel_dbi(pci, PCIE_ATU_VIEWPORT, region | index);
>>> -     dw_pcie_writel_dbi(pci, PCIE_ATU_CR2, ~PCIE_ATU_ENABLE);
>>> +     dw_pcie_writel_dbi(pci, PCIE_ATU_CR2, (u32)~PCIE_ATU_ENABLE);
>>
>> This is unrelated with the patch description purpose.
>>
> 
> This is a direct result of converting PCIE_ATU_ENABLE to BIT(31).
> BIT(31) expands to (1UL << 31) so, without that cast I get
> 
> drivers/pci/controller/dwc/pcie-designware.c: In function
> ‘dw_pcie_disable_atu’:
> drivers/pci/controller/dwc/pcie-designware.c:303:40: warning: large
> integer implicitly truncated to unsigned type [-Woverflow]
>   dw_pcie_writel_dbi(pci, PCIE_ATU_CR2, ~PCIE_ATU_ENABLE);
> 
> on AArch64. I am guessing that original definition of (1 << 31) avoids
> this problem by being an "int" instead of "unsigned long".

Ok, understood.

Acked-by: Gustavo Pimentel <gustavo.pimentel@...opsys.com>

> 
> Thanks,
> Andrey Smirnov
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ