* [PATCH v2] drivers: pci: pcie_dw_common: fix Werror compilation error
@ 2021-05-19 11:16 Green Wan
2021-05-24 7:06 ` Leo Liang
2021-05-31 8:49 ` Neil Armstrong
0 siblings, 2 replies; 3+ messages in thread
From: Green Wan @ 2021-05-19 11:16 UTC (permalink / raw)
To: u-boot
Fix compilation error when Werror is turned on. The warning could
possible break some CI builds.
Signed-off-by: Green Wan <green.wan@sifive.com>
---
drivers/pci/pcie_dw_common.c | 54 +++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 25 deletions(-)
diff --git a/drivers/pci/pcie_dw_common.c b/drivers/pci/pcie_dw_common.c
index 785fd3aad0..e66fb1490a 100644
--- a/drivers/pci/pcie_dw_common.c
+++ b/drivers/pci/pcie_dw_common.c
@@ -213,7 +213,7 @@ int pcie_dw_read_config(const struct udevice *bus, pci_dev_t bdf,
va_address = set_cfg_address(pcie, bdf, offset);
- value = readl(va_address);
+ value = readl((void __iomem *)va_address);
debug("(addr,val)=(0x%04x, 0x%08lx)\n", offset, value);
*valuep = pci_conv_32_to_size(value, offset, size);
@@ -257,9 +257,9 @@ int pcie_dw_write_config(struct udevice *bus, pci_dev_t bdf,
va_address = set_cfg_address(pcie, bdf, offset);
- old = readl(va_address);
+ old = readl((void __iomem *)va_address);
value = pci_conv_size_to_32(old, value, offset, size);
- writel(value, va_address);
+ writel(value, (void __iomem *)va_address);
return pcie_dw_prog_outbound_atu_unroll(pcie, PCIE_ATU_REGION_INDEX1,
PCIE_ATU_TYPE_IO, pcie->io.phys_start,
@@ -333,33 +333,37 @@ void pcie_dw_setup_host(struct pcie_dw *pci)
}
}
- dev_dbg(pci->dev, "Config space: [0x%p - 0x%p, size 0x%llx]\n",
- pci->cfg_base, pci->cfg_base + pci->cfg_size,
- pci->cfg_size);
+ dev_dbg(pci->dev, "Config space: [0x%llx - 0x%llx, size 0x%llx]\n",
+ (u64)pci->cfg_base, (u64)pci->cfg_base + pci->cfg_size,
+ (u64)pci->cfg_size);
- dev_dbg(pci->dev, "IO space: [0x%llx - 0x%llx, size 0x%lx]\n",
- pci->io.phys_start, pci->io.phys_start + pci->io.size,
- pci->io.size);
+ dev_dbg(pci->dev, "IO space: [0x%llx - 0x%llx, size 0x%llx]\n",
+ (u64)pci->io.phys_start, (u64)pci->io.phys_start + pci->io.size,
+ (u64)pci->io.size);
- dev_dbg(pci->dev, "IO bus: [0x%lx - 0x%lx, size 0x%lx]\n",
- pci->io.bus_start, pci->io.bus_start + pci->io.size,
- pci->io.size);
+ dev_dbg(pci->dev, "IO bus: [0x%llx - 0x%llx, size 0x%llx]\n",
+ (u64)pci->io.bus_start, (u64)pci->io.bus_start + pci->io.size,
+ (u64)pci->io.size);
- dev_dbg(pci->dev, "MEM space: [0x%llx - 0x%llx, size 0x%lx]\n",
- pci->mem.phys_start, pci->mem.phys_start + pci->mem.size,
- pci->mem.size);
+ dev_dbg(pci->dev, "MEM space: [0x%llx - 0x%llx, size 0x%llx]\n",
+ (u64)pci->mem.phys_start,
+ (u64)pci->mem.phys_start + pci->mem.size,
+ (u64)pci->mem.size);
- dev_dbg(pci->dev, "MEM bus: [0x%lx - 0x%lx, size 0x%lx]\n",
- pci->mem.bus_start, pci->mem.bus_start + pci->mem.size,
- pci->mem.size);
+ dev_dbg(pci->dev, "MEM bus: [0x%llx - 0x%llx, size 0x%llx]\n",
+ (u64)pci->mem.bus_start,
+ (u64)pci->mem.bus_start + pci->mem.size,
+ (u64)pci->mem.size);
if (pci->prefetch.size) {
- dev_dbg(pci->dev, "PREFETCH space: [0x%llx - 0x%llx, size 0x%lx]\n",
- pci->prefetch.phys_start, pci->prefetch.phys_start + pci->prefetch.size,
- pci->prefetch.size);
-
- dev_dbg(pci->dev, "PREFETCH bus: [0x%lx - 0x%lx, size 0x%lx]\n",
- pci->prefetch.bus_start, pci->prefetch.bus_start + pci->prefetch.size,
- pci->prefetch.size);
+ dev_dbg(pci->dev, "PREFETCH space: [0x%llx - 0x%llx, size 0x%llx]\n",
+ (u64)pci->prefetch.phys_start,
+ (u64)pci->prefetch.phys_start + pci->prefetch.size,
+ (u64)pci->prefetch.size);
+
+ dev_dbg(pci->dev, "PREFETCH bus: [0x%llx - 0x%llx, size 0x%llx]\n",
+ (u64)pci->prefetch.bus_start,
+ (u64)pci->prefetch.bus_start + pci->prefetch.size,
+ (u64)pci->prefetch.size);
}
}
--
2.31.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] drivers: pci: pcie_dw_common: fix Werror compilation error
2021-05-19 11:16 [PATCH v2] drivers: pci: pcie_dw_common: fix Werror compilation error Green Wan
@ 2021-05-24 7:06 ` Leo Liang
2021-05-31 8:49 ` Neil Armstrong
1 sibling, 0 replies; 3+ messages in thread
From: Leo Liang @ 2021-05-24 7:06 UTC (permalink / raw)
To: Green Wan; +Cc: u-boot
On Wed, May 19, 2021 at 07:16:15PM +0800, Green Wan wrote:
> Fix compilation error when Werror is turned on. The warning could
> possible break some CI builds.
>
> Signed-off-by: Green Wan <green.wan@sifive.com>
> ---
> drivers/pci/pcie_dw_common.c | 54 +++++++++++++++++++-----------------
> 1 file changed, 29 insertions(+), 25 deletions(-)
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] drivers: pci: pcie_dw_common: fix Werror compilation error
2021-05-19 11:16 [PATCH v2] drivers: pci: pcie_dw_common: fix Werror compilation error Green Wan
2021-05-24 7:06 ` Leo Liang
@ 2021-05-31 8:49 ` Neil Armstrong
1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2021-05-31 8:49 UTC (permalink / raw)
To: Green Wan; +Cc: bmeng.cn, ycliang, open list
On 19/05/2021 13:16, Green Wan wrote:
> Fix compilation error when Werror is turned on. The warning could
> possible break some CI builds.
>
> Signed-off-by: Green Wan <green.wan@sifive.com>
> ---
> drivers/pci/pcie_dw_common.c | 54 +++++++++++++++++++-----------------
> 1 file changed, 29 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/pci/pcie_dw_common.c b/drivers/pci/pcie_dw_common.c
> index 785fd3aad0..e66fb1490a 100644
> --- a/drivers/pci/pcie_dw_common.c
> +++ b/drivers/pci/pcie_dw_common.c
> @@ -213,7 +213,7 @@ int pcie_dw_read_config(const struct udevice *bus, pci_dev_t bdf,
>
> va_address = set_cfg_address(pcie, bdf, offset);
>
> - value = readl(va_address);
> + value = readl((void __iomem *)va_address);
>
> debug("(addr,val)=(0x%04x, 0x%08lx)\n", offset, value);
> *valuep = pci_conv_32_to_size(value, offset, size);
> @@ -257,9 +257,9 @@ int pcie_dw_write_config(struct udevice *bus, pci_dev_t bdf,
>
> va_address = set_cfg_address(pcie, bdf, offset);
>
> - old = readl(va_address);
> + old = readl((void __iomem *)va_address);
> value = pci_conv_size_to_32(old, value, offset, size);
> - writel(value, va_address);
> + writel(value, (void __iomem *)va_address);
>
> return pcie_dw_prog_outbound_atu_unroll(pcie, PCIE_ATU_REGION_INDEX1,
> PCIE_ATU_TYPE_IO, pcie->io.phys_start,
> @@ -333,33 +333,37 @@ void pcie_dw_setup_host(struct pcie_dw *pci)
> }
> }
>
> - dev_dbg(pci->dev, "Config space: [0x%p - 0x%p, size 0x%llx]\n",
> - pci->cfg_base, pci->cfg_base + pci->cfg_size,
> - pci->cfg_size);
> + dev_dbg(pci->dev, "Config space: [0x%llx - 0x%llx, size 0x%llx]\n",
> + (u64)pci->cfg_base, (u64)pci->cfg_base + pci->cfg_size,
> + (u64)pci->cfg_size);
>
> - dev_dbg(pci->dev, "IO space: [0x%llx - 0x%llx, size 0x%lx]\n",
> - pci->io.phys_start, pci->io.phys_start + pci->io.size,
> - pci->io.size);
> + dev_dbg(pci->dev, "IO space: [0x%llx - 0x%llx, size 0x%llx]\n",
> + (u64)pci->io.phys_start, (u64)pci->io.phys_start + pci->io.size,
> + (u64)pci->io.size);
>
> - dev_dbg(pci->dev, "IO bus: [0x%lx - 0x%lx, size 0x%lx]\n",
> - pci->io.bus_start, pci->io.bus_start + pci->io.size,
> - pci->io.size);
> + dev_dbg(pci->dev, "IO bus: [0x%llx - 0x%llx, size 0x%llx]\n",
> + (u64)pci->io.bus_start, (u64)pci->io.bus_start + pci->io.size,
> + (u64)pci->io.size);
>
> - dev_dbg(pci->dev, "MEM space: [0x%llx - 0x%llx, size 0x%lx]\n",
> - pci->mem.phys_start, pci->mem.phys_start + pci->mem.size,
> - pci->mem.size);
> + dev_dbg(pci->dev, "MEM space: [0x%llx - 0x%llx, size 0x%llx]\n",
> + (u64)pci->mem.phys_start,
> + (u64)pci->mem.phys_start + pci->mem.size,
> + (u64)pci->mem.size);
>
> - dev_dbg(pci->dev, "MEM bus: [0x%lx - 0x%lx, size 0x%lx]\n",
> - pci->mem.bus_start, pci->mem.bus_start + pci->mem.size,
> - pci->mem.size);
> + dev_dbg(pci->dev, "MEM bus: [0x%llx - 0x%llx, size 0x%llx]\n",
> + (u64)pci->mem.bus_start,
> + (u64)pci->mem.bus_start + pci->mem.size,
> + (u64)pci->mem.size);
>
> if (pci->prefetch.size) {
> - dev_dbg(pci->dev, "PREFETCH space: [0x%llx - 0x%llx, size 0x%lx]\n",
> - pci->prefetch.phys_start, pci->prefetch.phys_start + pci->prefetch.size,
> - pci->prefetch.size);
> -
> - dev_dbg(pci->dev, "PREFETCH bus: [0x%lx - 0x%lx, size 0x%lx]\n",
> - pci->prefetch.bus_start, pci->prefetch.bus_start + pci->prefetch.size,
> - pci->prefetch.size);
> + dev_dbg(pci->dev, "PREFETCH space: [0x%llx - 0x%llx, size 0x%llx]\n",
> + (u64)pci->prefetch.phys_start,
> + (u64)pci->prefetch.phys_start + pci->prefetch.size,
> + (u64)pci->prefetch.size);
> +
> + dev_dbg(pci->dev, "PREFETCH bus: [0x%llx - 0x%llx, size 0x%llx]\n",
> + (u64)pci->prefetch.bus_start,
> + (u64)pci->prefetch.bus_start + pci->prefetch.size,
> + (u64)pci->prefetch.size);
> }
> }
>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-31 8:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 11:16 [PATCH v2] drivers: pci: pcie_dw_common: fix Werror compilation error Green Wan
2021-05-24 7:06 ` Leo Liang
2021-05-31 8:49 ` Neil Armstrong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.