* [PATCH] fixup! pci: set upper word for 64bit base addresses
@ 2023-05-23 5:50 Ahmad Fatoum
2023-05-23 6:08 ` Ahmad Fatoum
0 siblings, 1 reply; 3+ messages in thread
From: Ahmad Fatoum @ 2023-05-23 5:50 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
pci: fix warning building for 32-bit
On systems with sizeof(resource_size_t) == 4, shifting by 32 will result
in a warning. Use the upper_32_bits macro to fix this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
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 046711cd145b..ff2ffacffb6b 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -223,7 +223,8 @@ static void setup_device(struct pci_dev *dev, int max_bar)
*last_addr = ALIGN(*last_addr, size);
pci_write_config_dword(dev, pci_base_address_0, *last_addr);
if (mask & PCI_BASE_ADDRESS_MEM_TYPE_64)
- pci_write_config_dword(dev, pci_base_address_1, *last_addr >> 32);
+ pci_write_config_dword(dev, pci_base_address_1,
+ upper_32_bits(*last_addr));
start = *last_addr;
*last_addr += size;
} else {
--
2.39.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fixup! pci: set upper word for 64bit base addresses
2023-05-23 5:50 [PATCH] fixup! pci: set upper word for 64bit base addresses Ahmad Fatoum
@ 2023-05-23 6:08 ` Ahmad Fatoum
2023-05-23 7:11 ` Sascha Hauer
0 siblings, 1 reply; 3+ messages in thread
From: Ahmad Fatoum @ 2023-05-23 6:08 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 23.05.23 07:50, Ahmad Fatoum wrote:
> pci: fix warning building for 32-bit
>
> On systems with sizeof(resource_size_t) == 4, shifting by 32 will result
> in a warning. Use the upper_32_bits macro to fix this.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> 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 046711cd145b..ff2ffacffb6b 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -223,7 +223,8 @@ static void setup_device(struct pci_dev *dev, int max_bar)
> *last_addr = ALIGN(*last_addr, size);
> pci_write_config_dword(dev, pci_base_address_0, *last_addr);
Sascha, could you change this into lower_32_bits(*last_addr) when you apply?
Cheers,
Ahmad
> if (mask & PCI_BASE_ADDRESS_MEM_TYPE_64)
> - pci_write_config_dword(dev, pci_base_address_1, *last_addr >> 32);
> + pci_write_config_dword(dev, pci_base_address_1,
> + upper_32_bits(*last_addr));
> start = *last_addr;
> *last_addr += size;
> } else {
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fixup! pci: set upper word for 64bit base addresses
2023-05-23 6:08 ` Ahmad Fatoum
@ 2023-05-23 7:11 ` Sascha Hauer
0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2023-05-23 7:11 UTC (permalink / raw)
To: Ahmad Fatoum; +Cc: barebox
On Tue, May 23, 2023 at 08:08:51AM +0200, Ahmad Fatoum wrote:
> On 23.05.23 07:50, Ahmad Fatoum wrote:
> > pci: fix warning building for 32-bit
> >
> > On systems with sizeof(resource_size_t) == 4, shifting by 32 will result
> > in a warning. Use the upper_32_bits macro to fix this.
> >
> > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> > ---
> > 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 046711cd145b..ff2ffacffb6b 100644
> > --- a/drivers/pci/pci.c
> > +++ b/drivers/pci/pci.c
> > @@ -223,7 +223,8 @@ static void setup_device(struct pci_dev *dev, int max_bar)
> > *last_addr = ALIGN(*last_addr, size);
> > pci_write_config_dword(dev, pci_base_address_0, *last_addr);
>
> Sascha, could you change this into lower_32_bits(*last_addr) when you apply?
Did that, thanks
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-23 7:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-23 5:50 [PATCH] fixup! pci: set upper word for 64bit base addresses Ahmad Fatoum
2023-05-23 6:08 ` Ahmad Fatoum
2023-05-23 7:11 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox