You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ra...@apache.org on 2024/10/10 13:31:20 UTC

(nuttx) 06/16: pci.c: fix pci 32bit warning

This is an automated email from the ASF dual-hosted git repository.

raiden00 pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 7f4f7f293ddaecec30b4337eaf84a0668749daac
Author: wangyongrong <wa...@xiaomi.com>
AuthorDate: Tue Apr 23 19:32:42 2024 +0800

    pci.c: fix pci 32bit warning
    
    pci/pci.c:863:66: warning: right shift count >= width of type [-Wshift-count-overflow]
      863 |       pci_write_config_dword(dev, msi + PCI_MSI_ADDRESS_HI, (mar >> 32));
    
    Signed-off-by: wangyongrong <wa...@xiaomi.com>
---
 drivers/pci/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index cd6eef64fa..1e9aa63d3d 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1146,7 +1146,8 @@ static int pci_enable_msi(FAR struct pci_device_s *dev, FAR int *irq,
 
   if ((flags & PCI_MSI_FLAGS_64BIT) != 0)
     {
-      pci_write_config_dword(dev, msi + PCI_MSI_ADDRESS_HI, (mar >> 32));
+      pci_write_config_dword(dev, msi + PCI_MSI_ADDRESS_HI,
+                             ((uint64_t)mar >> 32));
       pci_write_config_dword(dev, msi + PCI_MSI_DATA_64, mdr);
     }
   else