From 328929d76c5dc58db9fa1fdc28221cf074068eaf Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 19 Mar 2008 21:28:16 +0000 Subject: [PATCH] Use resource_size_t for physical memory addresses PCI resource addresses are 64-bit on i386 with PAE, so they won't fit unsigned long. Provide compatibility for older kernels. Reported by Diego Dujovne. git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3399 0192ed92-7a03-0410-a25b-9323aeb14dbd --- ath/if_ath_pci.c | 7 ++++--- include/compat.h | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ath/if_ath_pci.c b/ath/if_ath_pci.c index e90c14c..62ce422 100644 --- a/ath/if_ath_pci.c +++ b/ath/if_ath_pci.c @@ -124,7 +124,7 @@ static u16 ath_devidmap[][2] = { static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { - unsigned long phymem; + resource_size_t phymem; void __iomem *mem; struct ath_pci_softc *sc; struct net_device *dev; @@ -248,8 +248,9 @@ ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto bad4; athname = ath_hal_probe(id->vendor, vdevice); - printk(KERN_INFO "%s: %s: %s: mem=0x%lx, irq=%d\n", - dev_info, dev->name, athname ? athname : "Atheros ???", phymem, dev->irq); + printk(KERN_INFO "%s: %s: %s: mem=0x%llx, irq=%d\n", + dev_info, dev->name, athname ? athname : "Atheros ???", + (unsigned long long)phymem, dev->irq); /* ready to process interrupts */ sc->aps_sc.sc_invalid = 0; diff --git a/include/compat.h b/include/compat.h index 37af1df..f50b3ca 100644 --- a/include/compat.h +++ b/include/compat.h @@ -158,6 +158,10 @@ static inline int timeval_compare(struct timeval *lhs, struct timeval *rhs) } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) +typedef unsigned long resource_size_t; +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) #define IRQF_SHARED SA_SHIRQ #endif