Patchwork x86: Fix build warning on 32-bit

login
register
mail settings
Submitter Matthew Garrett
Date Sept. 6, 2012, 5:36 p.m.
Message ID <1346952976-18554-1-git-send-email-mjg@redhat.com>
Download mbox | patch
Permalink /patch/182251/
State Not Applicable
Headers show

Comments

Matthew Garrett - Sept. 6, 2012, 5:36 p.m.
Fix up the cast so it doesn't cause issues on 32-bit systems.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
 arch/x86/pci/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Bjorn Helgaas - Sept. 6, 2012, 8:02 p.m.
On Thu, Sep 6, 2012 at 10:36 AM, Matthew Garrett <mjg@redhat.com> wrote:
> Fix up the cast so it doesn't cause issues on 32-bit systems.

Thanks!  I folded this into the original patch and pushed the updated
pci/mjg-pci-roms-from-efi branch.

> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> ---
>  arch/x86/pci/common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
> index 3d2752f..1e2deac 100644
> --- a/arch/x86/pci/common.c
> +++ b/arch/x86/pci/common.c
> @@ -631,7 +631,7 @@ int pcibios_add_device(struct pci_dev *dev)
>                             (PCI_FUNC(dev->devfn) == rom->function) &&
>                             (dev->vendor == rom->vendor) &&
>                             (dev->device == rom->devid)) {
> -                               dev->rom = (void *)(pa_data +
> +                               dev->rom = (void *)(unsigned long)(pa_data +
>                                       offsetof(struct pci_setup_rom, romdata));
>                                 dev->romlen = rom->pcilen;
>                         }
> --
> 1.7.11.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 3d2752f..1e2deac 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -631,7 +631,7 @@  int pcibios_add_device(struct pci_dev *dev)
 			    (PCI_FUNC(dev->devfn) == rom->function) &&
 			    (dev->vendor == rom->vendor) &&
 			    (dev->device == rom->devid)) {
-				dev->rom = (void *)(pa_data +
+				dev->rom = (void *)(unsigned long)(pa_data +
 				      offsetof(struct pci_setup_rom, romdata));
 				dev->romlen = rom->pcilen;
 			}