lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1450741676-5865-2-git-send-email-viro@ZenIV.linux.org.uk>
Date:	Mon, 21 Dec 2015 23:46:35 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	linux-kernel@...r.kernel.org
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [POC][PATCH 02/83] switch free_pages() from unsigned long to const void *

From: Al Viro <viro@...iv.linux.org.uk>

Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
 arch/alpha/include/asm/agp.h                       |  2 +-
 arch/alpha/kernel/pci-noop.c                       |  2 +-
 arch/alpha/kernel/pci_iommu.c                      |  4 ++--
 arch/arc/include/asm/pgalloc.h                     |  6 +++---
 arch/arm/include/asm/tlb.h                         |  2 +-
 arch/arm/kvm/mmu.c                                 |  4 ++--
 arch/arm/mm/pgd.c                                  |  2 +-
 arch/blackfin/include/asm/mmu_context.h            |  2 +-
 arch/cris/arch-v32/drivers/pci/dma.c               |  2 +-
 arch/frv/mm/dma-alloc.c                            |  2 +-
 arch/h8300/kernel/dma.c                            |  2 +-
 arch/ia64/hp/common/sba_iommu.c                    |  2 +-
 arch/ia64/include/asm/agp.h                        |  2 +-
 arch/ia64/include/asm/thread_info.h                |  2 +-
 arch/ia64/include/asm/tlb.h                        |  2 +-
 arch/ia64/kernel/uncached.c                        |  2 +-
 arch/ia64/sn/pci/pci_dma.c                         |  4 ++--
 arch/ia64/sn/pci/tioca_provider.c                  |  2 +-
 arch/m68k/kernel/dma.c                             |  2 +-
 arch/m68k/sun3/sun3dvma.c                          |  4 ++--
 arch/microblaze/kernel/dma.c                       |  2 +-
 arch/microblaze/mm/consistent.c                    |  4 ++--
 arch/mips/include/asm/mach-generic/floppy.h        |  2 +-
 arch/mips/include/asm/mach-jazz/floppy.h           |  2 +-
 arch/mips/include/asm/pgalloc.h                    |  6 +++---
 arch/mips/mm/dma-default.c                         |  2 +-
 arch/mn10300/mm/dma-alloc.c                        |  2 +-
 arch/nios2/include/asm/pgalloc.h                   |  4 ++--
 arch/nios2/mm/dma-mapping.c                        |  2 +-
 arch/parisc/include/asm/agp.h                      |  2 +-
 arch/parisc/include/asm/floppy.h                   |  2 +-
 arch/parisc/include/asm/pgalloc.h                  |  4 ++--
 arch/parisc/kernel/pci-dma.c                       |  4 ++--
 arch/powerpc/include/asm/agp.h                     |  2 +-
 arch/powerpc/kernel/dma.c                          |  2 +-
 arch/powerpc/kernel/iommu.c                        |  6 +++---
 arch/powerpc/kvm/book3s_64_mmu_hv.c                |  4 ++--
 arch/powerpc/kvm/booke.c                           |  2 +-
 arch/powerpc/mm/init_64.c                          |  3 +--
 arch/powerpc/mm/pgtable_32.c                       |  2 +-
 arch/powerpc/platforms/cell/spufs/inode.c          |  2 +-
 arch/powerpc/platforms/powernv/pci-ioda.c          |  2 +-
 arch/powerpc/platforms/ps3/system-bus.c            |  4 ++--
 arch/s390/hypfs/hypfs_diag.c                       |  2 +-
 arch/s390/include/asm/idals.h                      |  5 ++---
 arch/s390/kernel/smp.c                             |  8 ++++----
 arch/s390/kernel/suspend.c                         |  2 +-
 arch/s390/kernel/vdso.c                            |  4 ++--
 arch/s390/mm/pgtable.c                             |  4 ++--
 arch/s390/pci/pci_clp.c                            |  2 +-
 arch/s390/pci/pci_dma.c                            |  4 ++--
 arch/score/include/asm/pgalloc.h                   |  4 ++--
 arch/sh/mm/consistent.c                            |  2 +-
 arch/sparc/include/asm/agp.h                       |  2 +-
 arch/sparc/kernel/iommu.c                          |  4 ++--
 arch/sparc/kernel/ioport.c                         |  6 +++---
 arch/sparc/kernel/ldc.c                            |  6 +++---
 arch/sparc/kernel/pci_fire.c                       |  2 +-
 arch/sparc/kernel/pci_sun4v.c                      |  8 ++++----
 arch/um/drivers/net_kern.c                         |  2 +-
 arch/um/kernel/process.c                           |  2 +-
 arch/unicore32/mm/pgd.c                            |  4 ++--
 arch/x86/include/asm/agp.h                         |  2 +-
 arch/x86/include/asm/floppy.h                      |  2 +-
 arch/x86/include/asm/xen/page-coherent.h           |  2 +-
 arch/x86/kernel/pci-calgary_64.c                   |  6 +++---
 arch/x86/kernel/pci-dma.c                          |  2 +-
 arch/x86/kvm/vmx.c                                 |  2 +-
 arch/x86/mm/init_64.c                              |  2 +-
 arch/x86/platform/efi/efi.c                        |  4 ++--
 arch/x86/um/ldt.c                                  |  2 +-
 arch/x86/xen/pmu.c                                 |  4 ++--
 arch/xtensa/kernel/pci-dma.c                       |  2 +-
 crypto/xor.c                                       |  2 +-
 drivers/base/devres.c                              |  4 ++--
 drivers/block/floppy.c                             |  2 +-
 drivers/block/ps3vram.c                            |  4 ++--
 drivers/block/xen-blkfront.c                       |  4 ++--
 drivers/block/zram/zcomp.c                         |  2 +-
 drivers/char/agp/hp-agp.c                          |  2 +-
 drivers/char/agp/uninorth-agp.c                    |  4 ++--
 drivers/char/mbcs.c                                |  4 ++--
 drivers/crypto/omap-aes.c                          |  4 ++--
 drivers/crypto/omap-des.c                          |  4 ++--
 drivers/dma/ste_dma40.c                            |  6 +++---
 drivers/firmware/dell_rbu.c                        |  9 ++++-----
 drivers/gpu/drm/amd/amdkfd/kfd_events.c            |  2 +-
 drivers/hv/channel.c                               |  4 ++--
 drivers/hv/connection.c                            |  6 +++---
 drivers/infiniband/hw/qib/qib_dma.c                |  2 +-
 drivers/iommu/amd_iommu_init.c                     | 21 ++++++++-------------
 drivers/iommu/exynos-iommu.c                       |  6 +++---
 drivers/iommu/fsl_pamu.c                           |  2 +-
 drivers/iommu/intel-svm.c                          |  8 ++++----
 drivers/iommu/intel_irq_remapping.c                |  2 +-
 drivers/iommu/msm_iommu.c                          |  2 +-
 drivers/md/bcache/bset.c                           | 10 ++++------
 drivers/md/bcache/btree.c                          |  2 +-
 drivers/md/bcache/journal.c                        |  4 ++--
 drivers/md/bcache/super.c                          |  4 ++--
 drivers/md/dm-bufio.c                              |  2 +-
 drivers/media/pci/solo6x10/solo6x10-p2m.c          |  6 +++---
 drivers/media/platform/davinci/dm644x_ccdc.c       |  4 ++--
 drivers/media/platform/omap/omap_voutlib.c         |  2 +-
 drivers/misc/cxl/native.c                          |  2 +-
 drivers/misc/mic/card/mic_virtio.c                 |  2 +-
 drivers/misc/mic/host/mic_virtio.c                 | 11 ++++-------
 drivers/misc/mic/scif/scif_rma.h                   |  2 +-
 drivers/misc/sgi-gru/grufile.c                     |  4 ++--
 drivers/misc/sgi-xp/xpc_uv.c                       |  4 ++--
 drivers/mmc/host/tmio_mmc_dma.c                    |  2 +-
 drivers/net/appletalk/ltpc.c                       |  4 ++--
 drivers/net/ethernet/amd/mvme147.c                 |  4 ++--
 drivers/net/ethernet/cavium/liquidio/octeon_main.h |  4 ++--
 drivers/net/ethernet/cirrus/cs89x0.c               |  2 +-
 drivers/net/ethernet/sgi/ioc3-eth.c                |  2 +-
 drivers/net/ethernet/sun/niu.c                     |  2 +-
 drivers/net/ethernet/tile/tilegx.c                 |  6 ++----
 drivers/net/irda/au1k_ir.c                         |  2 +-
 drivers/net/rionet.c                               |  2 +-
 drivers/net/wireless/b43/debugfs.c                 |  4 ++--
 drivers/net/wireless/b43legacy/debugfs.c           |  4 ++--
 drivers/net/wireless/iwlegacy/common.h             |  2 +-
 drivers/net/wireless/iwlwifi/iwl-trans.h           |  2 +-
 drivers/net/wireless/ti/wlcore/main.c              |  4 ++--
 drivers/parisc/ccio-dma.c                          |  2 +-
 drivers/parisc/ccio-rm-dma.c                       |  2 +-
 drivers/parisc/sba_iommu.c                         | 14 +++++++-------
 drivers/pci/host/pci-tegra.c                       |  2 +-
 drivers/pci/host/pcie-xilinx.c                     |  2 +-
 drivers/s390/block/dasd.c                          |  4 ++--
 drivers/s390/char/hmcdrv_cache.c                   |  2 +-
 drivers/s390/char/hmcdrv_ftp.c                     |  2 +-
 drivers/s390/char/tty3270.c                        |  4 ++--
 drivers/s390/char/vmcp.c                           |  5 ++---
 drivers/s390/cio/cmf.c                             |  4 ++--
 drivers/scsi/cxlflash/main.c                       |  2 +-
 drivers/scsi/libiscsi.c                            |  2 +-
 drivers/scsi/lpfc/lpfc_init.c                      |  4 ++--
 drivers/scsi/megaraid/megaraid_sas_base.c          |  4 ++--
 drivers/scsi/megaraid/megaraid_sas_fusion.c        |  4 ++--
 drivers/scsi/mpt3sas/mpt3sas_base.c                |  4 ++--
 drivers/scsi/ncr53c8xx.c                           |  2 +-
 drivers/scsi/sym53c8xx_2/sym_hipd.h                |  2 +-
 drivers/scsi/vmw_pvscsi.c                          |  5 ++---
 drivers/sh/maple/maple.c                           |  2 +-
 drivers/staging/rdma/ehca/ehca_mrmw.c              |  4 ++--
 drivers/staging/rdma/hfi1/dma.c                    |  2 +-
 drivers/staging/rdma/ipath/ipath_dma.c             |  2 +-
 drivers/usb/core/devices.c                         |  4 ++--
 drivers/video/fbdev/vermilion/vermilion.c          |  2 +-
 drivers/xen/swiotlb-xen.c                          |  4 ++--
 fs/ceph/mds_client.c                               |  2 +-
 fs/ecryptfs/crypto.c                               |  2 +-
 fs/hfs/mdb.c                                       |  2 +-
 fs/jbd2/journal.c                                  |  4 ++--
 fs/nilfs2/ioctl.c                                  |  2 +-
 fs/proc/vmcore.c                                   |  2 +-
 include/linux/gfp.h                                |  4 ++--
 kernel/trace/ftrace.c                              |  4 ++--
 kernel/trace/trace_events.c                        |  8 ++++----
 lib/percpu_ida.c                                   |  2 +-
 lib/raid6/algos.c                                  |  2 +-
 lib/swiotlb.c                                      | 21 +++++++++------------
 mm/memory.c                                        |  2 +-
 mm/page_alloc.c                                    |  8 ++++----
 mm/slob.c                                          |  2 +-
 mm/slub.c                                          |  3 +--
 mm/sparse.c                                        |  2 +-
 net/core/neighbour.c                               |  2 +-
 net/dccp/proto.c                                   |  8 ++++----
 net/ipv4/fib_semantics.c                           |  2 +-
 net/netfilter/nf_conntrack_core.c                  |  3 +--
 net/netlink/af_netlink.c                           |  2 +-
 net/packet/af_packet.c                             |  3 +--
 net/sched/sch_api.c                                |  2 +-
 net/sctp/protocol.c                                |  8 ++++----
 net/sctp/ssnmap.c                                  |  4 ++--
 net/xfrm/xfrm_hash.c                               |  2 +-
 security/integrity/ima/ima_crypto.c                |  2 +-
 sound/core/memalloc.c                              |  2 +-
 sound/oss/dmabuf.c                                 |  2 +-
 sound/usb/usx2y/usb_stream.c                       |  4 ++--
 183 files changed, 310 insertions(+), 333 deletions(-)

diff --git a/arch/alpha/include/asm/agp.h b/arch/alpha/include/asm/agp.h
index a94d48b..2fe5800 100644
--- a/arch/alpha/include/asm/agp.h
+++ b/arch/alpha/include/asm/agp.h
@@ -13,6 +13,6 @@
 #define alloc_gatt_pages(order)		\
 	((char *)__get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
-	free_pages((unsigned long)(table), (order))
+	free_pages((table), (order))
 
 #endif
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c
index 2b1f4a1..d3bcb88 100644
--- a/arch/alpha/kernel/pci-noop.c
+++ b/arch/alpha/kernel/pci-noop.c
@@ -127,7 +127,7 @@ static void alpha_noop_free_coherent(struct device *dev, size_t size,
 				     void *cpu_addr, dma_addr_t dma_addr,
 				     struct dma_attrs *attrs)
 {
-	free_pages((unsigned long)cpu_addr, get_order(size));
+	free_pages(cpu_addr, get_order(size));
 }
 
 static dma_addr_t alpha_noop_map_page(struct device *dev, struct page *page,
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c
index 8969bf2..fb0b20ee 100644
--- a/arch/alpha/kernel/pci_iommu.c
+++ b/arch/alpha/kernel/pci_iommu.c
@@ -455,7 +455,7 @@ try_again:
 
 	*dma_addrp = pci_map_single_1(pdev, cpu_addr, size, 0);
 	if (*dma_addrp == 0) {
-		free_pages((unsigned long)cpu_addr, order);
+		free_pages(cpu_addr, order);
 		if (alpha_mv.mv_pci_tbi || (gfp & GFP_DMA))
 			return NULL;
 		/* The address doesn't fit required mask and we
@@ -482,7 +482,7 @@ static void alpha_pci_free_coherent(struct device *dev, size_t size,
 {
 	struct pci_dev *pdev = alpha_gendev_to_pci(dev);
 	pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL);
-	free_pages((unsigned long)cpu_addr, get_order(size));
+	free_pages(cpu_addr, get_order(size));
 
 	DBGA2("pci_free_consistent: [%llx,%zx] from %pf\n",
 	      dma_addr, size, __builtin_return_address(0));
diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h
index 86ed671..1200117 100644
--- a/arch/arc/include/asm/pgalloc.h
+++ b/arch/arc/include/asm/pgalloc.h
@@ -73,7 +73,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
-	free_pages((unsigned long)pgd, __get_order_pgd());
+	free_pages(pgd, __get_order_pgd());
 }
 
 
@@ -122,13 +122,13 @@ pte_alloc_one(struct mm_struct *mm, unsigned long address)
 
 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 {
-	free_pages((unsigned long)pte, __get_order_pte()); /* takes phy addr */
+	free_pages(pte, __get_order_pte()); /* takes phy addr */
 }
 
 static inline void pte_free(struct mm_struct *mm, pgtable_t ptep)
 {
 	pgtable_page_dtor(virt_to_page(ptep));
-	free_pages((unsigned long)ptep, __get_order_pte());
+	free_pages(ptep, __get_order_pte());
 }
 
 #define __pte_free_tlb(tlb, pte, addr)  pte_free((tlb)->mm, pte)
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index 3cadb72..c8611f2 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -174,7 +174,7 @@ tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
 	check_pgt_cache();
 
 	if (tlb->pages != tlb->local)
-		free_pages((unsigned long)tlb->pages, 0);
+		free_pages(tlb->pages, 0);
 }
 
 /*
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 5de6c6b..190e9fb 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -402,7 +402,7 @@ void free_boot_hyp_pgd(void)
 	if (boot_hyp_pgd) {
 		unmap_range(NULL, boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE);
 		unmap_range(NULL, boot_hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE);
-		free_pages((unsigned long)boot_hyp_pgd, hyp_pgd_order);
+		free_pages(boot_hyp_pgd, hyp_pgd_order);
 		boot_hyp_pgd = NULL;
 	}
 
@@ -436,7 +436,7 @@ void free_hyp_pgds(void)
 		for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE)
 			unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
 
-		free_pages((unsigned long)hyp_pgd, hyp_pgd_order);
+		free_pages(hyp_pgd, hyp_pgd_order);
 		hyp_pgd = NULL;
 	}
 	if (merged_hyp_pgd) {
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c
index e683db1..b8799fa 100644
--- a/arch/arm/mm/pgd.c
+++ b/arch/arm/mm/pgd.c
@@ -24,7 +24,7 @@
 #define __pgd_free(pgd)	kfree(pgd)
 #else
 #define __pgd_alloc()	(pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_REPEAT, 2)
-#define __pgd_free(pgd)	free_pages((unsigned long)pgd, 2)
+#define __pgd_free(pgd)	free_pages(pgd, 2)
 #endif
 
 /*
diff --git a/arch/blackfin/include/asm/mmu_context.h b/arch/blackfin/include/asm/mmu_context.h
index 15b16d3..198cb70 100644
--- a/arch/blackfin/include/asm/mmu_context.h
+++ b/arch/blackfin/include/asm/mmu_context.h
@@ -203,7 +203,7 @@ static inline void destroy_context(struct mm_struct *mm)
 #ifdef CONFIG_MPU
 	if (current_rwx_mask[cpu] == mm->context.page_rwx_mask)
 		current_rwx_mask[cpu] = NULL;
-	free_pages((unsigned long)mm->context.page_rwx_mask, page_mask_order);
+	free_pages(mm->context.page_rwx_mask, page_mask_order);
 #endif
 }
 
diff --git a/arch/cris/arch-v32/drivers/pci/dma.c b/arch/cris/arch-v32/drivers/pci/dma.c
index ee55578..9b43cec 100644
--- a/arch/cris/arch-v32/drivers/pci/dma.c
+++ b/arch/cris/arch-v32/drivers/pci/dma.c
@@ -45,6 +45,6 @@ void dma_free_coherent(struct device *dev, size_t size,
 	int order = get_order(size);
 
 	if (!dma_release_from_coherent(dev, order, vaddr))
-		free_pages((unsigned long)vaddr, order);
+		free_pages(vaddr, order);
 }
 
diff --git a/arch/frv/mm/dma-alloc.c b/arch/frv/mm/dma-alloc.c
index 7a73aae..c4c19ff 100644
--- a/arch/frv/mm/dma-alloc.c
+++ b/arch/frv/mm/dma-alloc.c
@@ -101,7 +101,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
 	/* allocate some common virtual space to map the new pages */
 	area = get_vm_area(size, VM_ALLOC);
 	if (area == 0) {
-		free_pages(page, order);
+		free_pages((void *)page, order);
 		return NULL;
 	}
 	va = VMALLOC_VMADDR(area->addr);
diff --git a/arch/h8300/kernel/dma.c b/arch/h8300/kernel/dma.c
index eeb13d3..063a0f5 100644
--- a/arch/h8300/kernel/dma.c
+++ b/arch/h8300/kernel/dma.c
@@ -35,7 +35,7 @@ static void dma_free(struct device *dev, size_t size,
 		     struct dma_attrs *attrs)
 
 {
-	free_pages((unsigned long)vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 }
 
 static dma_addr_t map_page(struct device *dev, struct page *page,
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index a6d6190..2988500 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -1194,7 +1194,7 @@ static void sba_free_coherent(struct device *dev, size_t size, void *vaddr,
 			      dma_addr_t dma_handle, struct dma_attrs *attrs)
 {
 	sba_unmap_single_attrs(dev, dma_handle, size, 0, NULL);
-	free_pages((unsigned long) vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 }
 
 
diff --git a/arch/ia64/include/asm/agp.h b/arch/ia64/include/asm/agp.h
index 01d09c40..80c30d4 100644
--- a/arch/ia64/include/asm/agp.h
+++ b/arch/ia64/include/asm/agp.h
@@ -21,6 +21,6 @@
 #define alloc_gatt_pages(order)		\
 	((char *)__get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
-	free_pages((unsigned long)(table), (order))
+	free_pages((table), (order))
 
 #endif /* _ASM_IA64_AGP_H */
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
index aa995b6..53c52e9 100644
--- a/arch/ia64/include/asm/thread_info.h
+++ b/arch/ia64/include/asm/thread_info.h
@@ -81,7 +81,7 @@ struct thread_info {
 										\
 	ret;									\
 })
-#define free_task_struct(tsk)	free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER)
+#define free_task_struct(tsk)	free_pages((tsk), KERNEL_STACK_SIZE_ORDER)
 
 #endif /* !__ASSEMBLY */
 
diff --git a/arch/ia64/include/asm/tlb.h b/arch/ia64/include/asm/tlb.h
index 39d64e0d..52ab3a9 100644
--- a/arch/ia64/include/asm/tlb.h
+++ b/arch/ia64/include/asm/tlb.h
@@ -197,7 +197,7 @@ tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
 	check_pgt_cache();
 
 	if (tlb->pages != tlb->local)
-		free_pages((unsigned long)tlb->pages, 0);
+		free_pages(tlb->pages, 0);
 }
 
 /*
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c
index f3976da..9b90526 100644
--- a/arch/ia64/kernel/uncached.c
+++ b/arch/ia64/kernel/uncached.c
@@ -166,7 +166,7 @@ failed:
 	for (i = 0; i < (IA64_GRANULE_SIZE / PAGE_SIZE); i++)
 		ClearPageUncached(&page[i]);
 
-	free_pages(c_addr, IA64_GRANULE_SHIFT-PAGE_SHIFT);
+	free_pages((void *)c_addr, IA64_GRANULE_SHIFT-PAGE_SHIFT);
 	mutex_unlock(&uc_pool->add_chunk_mutex);
 	return -1;
 }
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index 8f59907..f25c898 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -120,7 +120,7 @@ static void *sn_dma_alloc_coherent(struct device *dev, size_t size,
 						   SN_DMA_ADDR_PHYS);
 	if (!*dma_handle) {
 		printk(KERN_ERR "%s: out of ATEs\n", __func__);
-		free_pages((unsigned long)cpuaddr, get_order(size));
+		free_pages(cpuaddr, get_order(size));
 		return NULL;
 	}
 
@@ -146,7 +146,7 @@ static void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr
 	BUG_ON(!dev_is_pci(dev));
 
 	provider->dma_unmap(pdev, dma_handle, 0);
-	free_pages((unsigned long)cpu_addr, get_order(size));
+	free_pages(cpu_addr, get_order(size));
 }
 
 /**
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index a70b11f..76bf4f0 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -154,7 +154,7 @@ tioca_gart_init(struct tioca_kernel *tioca_kern)
 	tioca_kern->ca_pcigart_pagemap =
 	    kzalloc(tioca_kern->ca_pcigart_entries / 8, GFP_KERNEL);
 	if (!tioca_kern->ca_pcigart_pagemap) {
-		free_pages((unsigned long)tioca_kern->ca_gart,
+		free_pages(tioca_kern->ca_gart,
 			   get_order(tioca_kern->ca_gart_size));
 		return -1;
 	}
diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c
index 564665f..2bdf7bf 100644
--- a/arch/m68k/kernel/dma.c
+++ b/arch/m68k/kernel/dma.c
@@ -93,7 +93,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
 void dma_free_coherent(struct device *dev, size_t size,
 			 void *vaddr, dma_addr_t dma_handle)
 {
-	free_pages((unsigned long)vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 }
 
 #endif /* CONFIG_MMU && !CONFIG_COLDFIRE */
diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c
index b37521a..fdc4900 100644
--- a/arch/m68k/sun3/sun3dvma.c
+++ b/arch/m68k/sun3/sun3dvma.c
@@ -352,7 +352,7 @@ void *dvma_malloc_align(unsigned long len, unsigned long align)
 		return NULL;
 
 	if((baddr = (unsigned long)dvma_map_align(kaddr, len, align)) == 0) {
-		free_pages(kaddr, get_order(len));
+		free_pages((void *)kaddr, get_order(len));
 		return NULL;
 	}
 
@@ -360,7 +360,7 @@ void *dvma_malloc_align(unsigned long len, unsigned long align)
 
 	if(dvma_map_cpu(kaddr, vaddr, len) < 0) {
 		dvma_unmap((void *)baddr);
-		free_pages(kaddr, get_order(len));
+		free_pages((void *)kaddr, get_order(len));
 		return NULL;
 	}
 
diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c
index bf4dec2..641cbcb 100644
--- a/arch/microblaze/kernel/dma.c
+++ b/arch/microblaze/kernel/dma.c
@@ -47,7 +47,7 @@ static void dma_direct_free_coherent(struct device *dev, size_t size,
 #ifdef NOT_COHERENT_CACHE
 	consistent_free(size, vaddr);
 #else
-	free_pages((unsigned long)vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 #endif
 }
 
diff --git a/arch/microblaze/mm/consistent.c b/arch/microblaze/mm/consistent.c
index b06c3a7..a4b587a 100644
--- a/arch/microblaze/mm/consistent.c
+++ b/arch/microblaze/mm/consistent.c
@@ -110,7 +110,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
 	/* Allocate some common virtual space to map the new pages. */
 	area = get_vm_area(size, VM_ALLOC);
 	if (!area) {
-		free_pages(vaddr, order);
+		free_pages((void *)vaddr, order);
 		return NULL;
 	}
 	va = (unsigned long) area->addr;
@@ -148,7 +148,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
 	}
 
 	if (err) {
-		free_pages(vaddr, order);
+		free_pages((void *)vaddr, order);
 		return NULL;
 	}
 
diff --git a/arch/mips/include/asm/mach-generic/floppy.h b/arch/mips/include/asm/mach-generic/floppy.h
index e2561d9..7b0b508 100644
--- a/arch/mips/include/asm/mach-generic/floppy.h
+++ b/arch/mips/include/asm/mach-generic/floppy.h
@@ -124,7 +124,7 @@ static inline unsigned long fd_dma_mem_alloc(unsigned long size)
 
 static inline void fd_dma_mem_free(unsigned long addr, unsigned long size)
 {
-	free_pages(addr, get_order(size));
+	free_pages((void *)addr, get_order(size));
 }
 
 static inline unsigned long fd_drive_type(unsigned long n)
diff --git a/arch/mips/include/asm/mach-jazz/floppy.h b/arch/mips/include/asm/mach-jazz/floppy.h
index 4b86c88a..4aaf35b 100644
--- a/arch/mips/include/asm/mach-jazz/floppy.h
+++ b/arch/mips/include/asm/mach-jazz/floppy.h
@@ -117,7 +117,7 @@ static inline unsigned long fd_dma_mem_alloc(unsigned long size)
 static inline void fd_dma_mem_free(unsigned long addr, unsigned long size)
 {
 	vdma_free(vdma_phys2log(CPHYSADDR(addr)));
-	free_pages(addr, get_order(size));
+	free_pages((void *)addr, get_order(size));
 }
 
 static inline unsigned long fd_drive_type(unsigned long n)
diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h
index b336037..e29cc40 100644
--- a/arch/mips/include/asm/pgalloc.h
+++ b/arch/mips/include/asm/pgalloc.h
@@ -61,7 +61,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
-	free_pages((unsigned long)pgd, PGD_ORDER);
+	free_pages(pgd, PGD_ORDER);
 }
 
 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
@@ -92,7 +92,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
 
 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 {
-	free_pages((unsigned long)pte, PTE_ORDER);
+	free_pages(pte, PTE_ORDER);
 }
 
 static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
@@ -121,7 +121,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 
 static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 {
-	free_pages((unsigned long)pmd, PMD_ORDER);
+	free_pages(pmd, PMD_ORDER);
 }
 
 #define __pmd_free_tlb(tlb, x, addr)	pmd_free((tlb)->mm, x)
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 730d394..d3c1cec 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -171,7 +171,7 @@ static void mips_dma_free_noncoherent(struct device *dev, size_t size,
 		void *vaddr, dma_addr_t dma_handle)
 {
 	plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL);
-	free_pages((unsigned long) vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 }
 
 static void mips_dma_free_coherent(struct device *dev, size_t size, void *vaddr,
diff --git a/arch/mn10300/mm/dma-alloc.c b/arch/mn10300/mm/dma-alloc.c
index e244ebe..5f3132a4 100644
--- a/arch/mn10300/mm/dma-alloc.c
+++ b/arch/mn10300/mm/dma-alloc.c
@@ -71,6 +71,6 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
 	if (addr >= 0x9c000000)
 		return;
 
-	free_pages(addr, get_order(size));
+	free_pages((void *)addr, get_order(size));
 }
 EXPORT_SYMBOL(dma_free_coherent);
diff --git a/arch/nios2/include/asm/pgalloc.h b/arch/nios2/include/asm/pgalloc.h
index 6e2985e..91cd323 100644
--- a/arch/nios2/include/asm/pgalloc.h
+++ b/arch/nios2/include/asm/pgalloc.h
@@ -34,7 +34,7 @@ extern pgd_t *pgd_alloc(struct mm_struct *mm);
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
-	free_pages((unsigned long)pgd, PGD_ORDER);
+	free_pages(pgd, PGD_ORDER);
 }
 
 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
@@ -66,7 +66,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
 
 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 {
-	free_pages((unsigned long)pte, PTE_ORDER);
+	free_pages(pte, PTE_ORDER);
 }
 
 static inline void pte_free(struct mm_struct *mm, struct page *pte)
diff --git a/arch/nios2/mm/dma-mapping.c b/arch/nios2/mm/dma-mapping.c
index ac5da75..fa242ab 100644
--- a/arch/nios2/mm/dma-mapping.c
+++ b/arch/nios2/mm/dma-mapping.c
@@ -52,7 +52,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
 {
 	unsigned long addr = (unsigned long) CAC_ADDR((unsigned long) vaddr);
 
-	free_pages(addr, get_order(size));
+	free_pages((void *)addr, get_order(size));
 }
 EXPORT_SYMBOL(dma_free_coherent);
 
diff --git a/arch/parisc/include/asm/agp.h b/arch/parisc/include/asm/agp.h
index d226ffa..31f67a5 100644
--- a/arch/parisc/include/asm/agp.h
+++ b/arch/parisc/include/asm/agp.h
@@ -15,6 +15,6 @@
 #define alloc_gatt_pages(order)		\
 	((char *)__get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
-	free_pages((unsigned long)(table), (order))
+	free_pages((table), (order))
 
 #endif /* _ASM_PARISC_AGP_H */
diff --git a/arch/parisc/include/asm/floppy.h b/arch/parisc/include/asm/floppy.h
index f84ff12..ce08762 100644
--- a/arch/parisc/include/asm/floppy.h
+++ b/arch/parisc/include/asm/floppy.h
@@ -182,7 +182,7 @@ static void _fd_dma_mem_free(unsigned long addr, unsigned long size)
 	if((unsigned int) addr >= (unsigned int) high_memory)
 		return vfree((void *)addr);
 	else
-		free_pages(addr, get_order(size));		
+		free_pages((void *)addr, get_order(size));		
 }
 
 #define fd_dma_mem_free(addr, size)  _fd_dma_mem_free(addr, size) 
diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h
index daca63d..51cb827 100644
--- a/arch/parisc/include/asm/pgalloc.h
+++ b/arch/parisc/include/asm/pgalloc.h
@@ -48,7 +48,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 #if CONFIG_PGTABLE_LEVELS == 3
 	pgd -= PTRS_PER_PGD;
 #endif
-	free_pages((unsigned long)pgd, PGD_ALLOC_ORDER);
+	free_pages(pgd, PGD_ALLOC_ORDER);
 }
 
 #if CONFIG_PGTABLE_LEVELS == 3
@@ -82,7 +82,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 		mm_inc_nr_pmds(mm);
 		return;
 	}
-	free_pages((unsigned long)pmd, PMD_ORDER);
+	free_pages(pmd, PMD_ORDER);
 }
 
 #else
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index b9402c9..3c4ebba 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -447,7 +447,7 @@ static void pa11_dma_free_consistent (struct device *dev, size_t size, void *vad
 	size = 1 << (order + PAGE_SHIFT);
 	unmap_uncached_pages((unsigned long)vaddr, size);
 	pcxl_free_range((unsigned long)vaddr, size);
-	free_pages((unsigned long)__va(dma_handle), order);
+	free_pages(__va(dma_handle), order);
 }
 
 static dma_addr_t pa11_dma_map_single(struct device *dev, void *addr, size_t size, enum dma_data_direction direction)
@@ -581,7 +581,7 @@ static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
 static void pa11_dma_free_noncoherent(struct device *dev, size_t size,
 					void *vaddr, dma_addr_t iova)
 {
-	free_pages((unsigned long)vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 	return;
 }
 
diff --git a/arch/powerpc/include/asm/agp.h b/arch/powerpc/include/asm/agp.h
index 416e12c..06df165 100644
--- a/arch/powerpc/include/asm/agp.h
+++ b/arch/powerpc/include/asm/agp.h
@@ -12,7 +12,7 @@
 #define alloc_gatt_pages(order)		\
 	((char *)__get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
-	free_pages((unsigned long)(table), (order))
+	free_pages((table), (order))
 
 #endif /* __KERNEL__ */
 #endif	/* _ASM_POWERPC_AGP_H */
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index 3f1472a..600fffc 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -126,7 +126,7 @@ void __dma_direct_free_coherent(struct device *dev, size_t size,
 #ifdef CONFIG_NOT_COHERENT_CACHE
 	__dma_free_coherent(size, vaddr);
 #else
-	free_pages((unsigned long)vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 #endif
 }
 
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index a8e3490..9fde7c9 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -739,7 +739,7 @@ void iommu_free_table(struct iommu_table *tbl, const char *node_name)
 
 	/* free bitmap */
 	order = get_order(bitmap_sz);
-	free_pages((unsigned long) tbl->it_map, order);
+	free_pages(tbl->it_map, order);
 
 	/* free table */
 	kfree(tbl);
@@ -847,7 +847,7 @@ void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl,
 	mapping = iommu_alloc(dev, tbl, ret, nio_pages, DMA_BIDIRECTIONAL,
 			      mask >> tbl->it_page_shift, io_order, NULL);
 	if (mapping == DMA_ERROR_CODE) {
-		free_pages((unsigned long)ret, order);
+		free_pages(ret, order);
 		return NULL;
 	}
 	*dma_handle = mapping;
@@ -864,7 +864,7 @@ void iommu_free_coherent(struct iommu_table *tbl, size_t size,
 		nio_pages = size >> tbl->it_page_shift;
 		iommu_free(tbl, dma_handle, nio_pages);
 		size = PAGE_ALIGN(size);
-		free_pages((unsigned long)vaddr, get_order(size));
+		free_pages(vaddr, get_order(size));
 	}
 }
 
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index fb37290..e398fdc 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -108,7 +108,7 @@ long kvmppc_alloc_hpt(struct kvm *kvm, u32 *htab_orderp)
 	if (kvm->arch.hpt_cma_alloc)
 		kvm_release_hpt(page, 1 << (order - PAGE_SHIFT));
 	else
-		free_pages(hpt, order - PAGE_SHIFT);
+		free_pages((void *)hpt, order - PAGE_SHIFT);
 	return -ENOMEM;
 }
 
@@ -156,7 +156,7 @@ void kvmppc_free_hpt(struct kvm *kvm)
 		kvm_release_hpt(virt_to_page(kvm->arch.hpt_virt),
 				1 << (kvm->arch.hpt_order - PAGE_SHIFT));
 	else
-		free_pages(kvm->arch.hpt_virt,
+		free_pages((void *)kvm->arch.hpt_virt,
 			   kvm->arch.hpt_order - PAGE_SHIFT);
 }
 
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index fd587517..949a078 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -2158,6 +2158,6 @@ int __init kvmppc_booke_init(void)
 
 void __exit kvmppc_booke_exit(void)
 {
-	free_pages(kvmppc_booke_handlers, VCPU_SIZE_ORDER);
+	free_pages((void *)kvmppc_booke_handlers, VCPU_SIZE_ORDER);
 	kvm_exit();
 }
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index d747dd7..c709351 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -397,8 +397,7 @@ void __ref vmemmap_free(unsigned long start, unsigned long end)
 						free_reserved_page(page++);
 				}
 			} else
-				free_pages((unsigned long)(__va(addr)),
-							get_order(page_size));
+				free_pages(__va(addr), get_order(page_size));
 
 			vmemmap_remove_mapping(start, page_size);
 		}
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 7692d1b..89bfc17 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -100,7 +100,7 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 #ifndef CONFIG_PPC_4K_PAGES
 	kmem_cache_free(pgtable_cache, (void *)pgd);
 #else
-	free_pages((unsigned long)pgd, PGDIR_ORDER - PAGE_SHIFT);
+	free_pages(pgd, PGDIR_ORDER - PAGE_SHIFT);
 #endif
 }
 
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 11634fa..14a47f9 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -648,7 +648,7 @@ spufs_parse_options(struct super_block *sb, char *options, struct inode *root)
 
 static void spufs_exit_isolated_loader(void)
 {
-	free_pages((unsigned long) isolated_loader,
+	free_pages(isolated_loader,
 			get_order(isolated_loader_size));
 }
 
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 414fd1a..0b6f831 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -2323,7 +2323,7 @@ static void pnv_pci_ioda2_table_do_free_pages(__be64 *addr,
 		}
 	}
 
-	free_pages(addr_ul, get_order(size << 3));
+	free_pages((void *)addr_ul, get_order(size << 3));
 }
 
 static void pnv_pci_ioda2_table_free_pages(struct iommu_table *tbl)
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index 5606fe3..001b93c 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -546,7 +546,7 @@ static void * ps3_alloc_coherent(struct device *_dev, size_t size,
 	return (void*)virt_addr;
 
 clean_alloc:
-	free_pages(virt_addr, get_order(size));
+	free_pages((void *)virt_addr, get_order(size));
 clean_none:
 	dma_handle = NULL;
 	return NULL;
@@ -558,7 +558,7 @@ static void ps3_free_coherent(struct device *_dev, size_t size, void *vaddr,
 	struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
 
 	ps3_dma_unmap(dev->d_region, dma_handle, size);
-	free_pages((unsigned long)vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 }
 
 /* Creates TCEs for a user provided buffer.  The user buffer must be
diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c
index 0450357..08f71f8 100644
--- a/arch/s390/hypfs/hypfs_diag.c
+++ b/arch/s390/hypfs/hypfs_diag.c
@@ -373,7 +373,7 @@ static void diag204_free_buffer(void)
 		vfree(diag204_buf_vmalloc);
 		diag204_buf_vmalloc = NULL;
 	} else {
-		free_pages((unsigned long) diag204_buf, 0);
+		free_pages(diag204_buf, 0);
 	}
 	diag204_buf = NULL;
 }
diff --git a/arch/s390/include/asm/idals.h b/arch/s390/include/asm/idals.h
index a7b2d75..56b1baf 100644
--- a/arch/s390/include/asm/idals.h
+++ b/arch/s390/include/asm/idals.h
@@ -139,8 +139,7 @@ idal_buffer_alloc(size_t size, int page_order)
 		// Not enough memory
 		while (i >= nr_chunks) {
 			i -= nr_chunks;
-			free_pages((unsigned long) ib->data[i],
-				   ib->page_order);
+			free_pages(ib->data[i], ib->page_order);
 		}
 		kfree(ib);
 		return ERR_PTR(-ENOMEM);
@@ -159,7 +158,7 @@ idal_buffer_free(struct idal_buffer *ib)
 	nr_ptrs = (ib->size + IDA_BLOCK_SIZE - 1) >> IDA_SIZE_LOG;
 	nr_chunks = (4096 << ib->page_order) >> IDA_SIZE_LOG;
 	for (i = 0; i < nr_ptrs; i += nr_chunks)
-		free_pages((unsigned long) ib->data[i], ib->page_order);
+		free_pages(ib->data[i], ib->page_order);
 	kfree(ib);
 }
 
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 216c8f5..63c1c8c 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -211,8 +211,8 @@ static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu)
 out:
 	if (pcpu != &pcpu_devices[0]) {
 		free_page((void *)panic_stack);
-		free_pages(async_stack, ASYNC_ORDER);
-		free_pages((unsigned long) pcpu->lowcore, LC_ORDER);
+		free_pages((void *)async_stack, ASYNC_ORDER);
+		free_pages(pcpu->lowcore, LC_ORDER);
 	}
 	return -ENOMEM;
 }
@@ -227,8 +227,8 @@ static void pcpu_free_lowcore(struct pcpu *pcpu)
 	if (pcpu == &pcpu_devices[0])
 		return;
 	free_page((void *)(pcpu->lowcore->panic_stack-PANIC_FRAME_OFFSET));
-	free_pages(pcpu->lowcore->async_stack-ASYNC_FRAME_OFFSET, ASYNC_ORDER);
-	free_pages((unsigned long) pcpu->lowcore, LC_ORDER);
+	free_pages((void *)pcpu->lowcore->async_stack-ASYNC_FRAME_OFFSET, ASYNC_ORDER);
+	free_pages(pcpu->lowcore, LC_ORDER);
 }
 
 #endif /* CONFIG_HOTPLUG_CPU */
diff --git a/arch/s390/kernel/suspend.c b/arch/s390/kernel/suspend.c
index 8c23212..c40bdca 100644
--- a/arch/s390/kernel/suspend.c
+++ b/arch/s390/kernel/suspend.c
@@ -169,7 +169,7 @@ static int suspend_pm_cb(struct notifier_block *nb, unsigned long action,
 		break;
 	case PM_POST_SUSPEND:
 	case PM_POST_HIBERNATION:
-		free_pages(suspend_zero_pages, LC_ORDER);
+		free_pages((void *)suspend_zero_pages, LC_ORDER);
 		break;
 	default:
 		return NOTIFY_DONE;
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index 2391d83..2518d55 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -134,7 +134,7 @@ int vdso_alloc_per_cpu(struct _lowcore *lowcore)
 out:
 	free_page((void *)page_frame);
 	free_page((void *)page_table);
-	free_pages(segment_table, SEGMENT_ORDER);
+	free_pages((void *)segment_table, SEGMENT_ORDER);
 	return -ENOMEM;
 }
 
@@ -154,7 +154,7 @@ void vdso_free_per_cpu(struct _lowcore *lowcore)
 
 	free_page((void *)page_frame);
 	free_page((void *)page_table);
-	free_pages(segment_table, SEGMENT_ORDER);
+	free_pages((void *)segment_table, SEGMENT_ORDER);
 }
 
 static void vdso_init_cr5(void)
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 676989b..df429c6 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -35,7 +35,7 @@ unsigned long *crst_table_alloc(struct mm_struct *mm)
 
 void crst_table_free(struct mm_struct *mm, unsigned long *table)
 {
-	free_pages((unsigned long) table, 2);
+	free_pages(table, 2);
 }
 
 static void __crst_table_upgrade(void *arg)
@@ -1051,7 +1051,7 @@ static void __tlb_remove_table(void *_table)
 
 	switch (mask) {
 	case 0:		/* pmd or pud */
-		free_pages((unsigned long) table, 2);
+		free_pages(table, 2);
 		break;
 	case 1:		/* lower 2K of a 4K page table */
 	case 2:		/* higher 2K of a 4K page table */
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c
index d6e411e..5914a16 100644
--- a/arch/s390/pci/pci_clp.c
+++ b/arch/s390/pci/pci_clp.c
@@ -53,7 +53,7 @@ static void *clp_alloc_block(gfp_t gfp_mask)
 
 static void clp_free_block(void *ptr)
 {
-	free_pages((unsigned long) ptr, get_order(CLP_BLK_SIZE));
+	free_pages(ptr, get_order(CLP_BLK_SIZE));
 }
 
 static void clp_store_query_pci_fngrp(struct zpci_dev *zdev,
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c
index d348f2c..5a15471 100644
--- a/arch/s390/pci/pci_dma.c
+++ b/arch/s390/pci/pci_dma.c
@@ -369,7 +369,7 @@ static void *s390_dma_alloc(struct device *dev, size_t size,
 	map = s390_dma_map_pages(dev, page, pa % PAGE_SIZE,
 				 size, DMA_BIDIRECTIONAL, NULL);
 	if (dma_mapping_error(dev, map)) {
-		free_pages(pa, get_order(size));
+		free_pages((void *)pa, get_order(size));
 		return NULL;
 	}
 
@@ -388,7 +388,7 @@ static void s390_dma_free(struct device *dev, size_t size,
 	size = PAGE_ALIGN(size);
 	atomic64_sub(size / PAGE_SIZE, &zdev->allocated_pages);
 	s390_dma_unmap_pages(dev, dma_handle, size, DMA_BIDIRECTIONAL, NULL);
-	free_pages((unsigned long) pa, get_order(size));
+	free_pages(pa, get_order(size));
 }
 
 static int s390_dma_map_sg(struct device *dev, struct scatterlist *sg,
diff --git a/arch/score/include/asm/pgalloc.h b/arch/score/include/asm/pgalloc.h
index 2e06765..55fb080 100644
--- a/arch/score/include/asm/pgalloc.h
+++ b/arch/score/include/asm/pgalloc.h
@@ -34,7 +34,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
-	free_pages((unsigned long)pgd, PGD_ORDER);
+	free_pages(pgd, PGD_ORDER);
 }
 
 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
@@ -66,7 +66,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
 
 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 {
-	free_pages((unsigned long)pte, PTE_ORDER);
+	free_pages(pte, PTE_ORDER);
 }
 
 static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index b81d9db..4721e24 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -53,7 +53,7 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
 
 	ret_nocache = (void __force *)ioremap_nocache(virt_to_phys(ret), size);
 	if (!ret_nocache) {
-		free_pages((unsigned long)ret, order);
+		free_pages(ret, order);
 		return NULL;
 	}
 
diff --git a/arch/sparc/include/asm/agp.h b/arch/sparc/include/asm/agp.h
index 70f52c1..363d3e6 100644
--- a/arch/sparc/include/asm/agp.h
+++ b/arch/sparc/include/asm/agp.h
@@ -11,6 +11,6 @@
 #define alloc_gatt_pages(order)		\
 	((char *)__get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
-	free_pages((unsigned long)(table), (order))
+	free_pages((table), (order))
 
 #endif
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index 7db91e1..eae7b6b 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -223,7 +223,7 @@ static void *dma_4u_alloc_coherent(struct device *dev, size_t size,
 	iopte = alloc_npages(dev, iommu, size >> IO_PAGE_SHIFT);
 
 	if (unlikely(iopte == NULL)) {
-		free_pages(first_page, order);
+		free_pages((void *)first_page, order);
 		return NULL;
 	}
 
@@ -257,7 +257,7 @@ static void dma_4u_free_coherent(struct device *dev, size_t size,
 
 	order = get_order(size);
 	if (order < 10)
-		free_pages((unsigned long)cpu, order);
+		free_pages(cpu, order);
 }
 
 static dma_addr_t dma_4u_map_page(struct device *dev, struct page *page,
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 28fed53..39b406a 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -309,7 +309,7 @@ err_noiommu:
 err_nova:
 	kfree(res);
 err_nomem:
-	free_pages(va, order);
+	free_pages((void *)va, order);
 err_nopages:
 	return NULL;
 }
@@ -468,7 +468,7 @@ static void *pci32_alloc_coherent(struct device *dev, size_t len,
 err_nova:
 	kfree(res);
 err_nomem:
-	free_pages((unsigned long)va, order);
+	free_pages(va, order);
 err_nopages:
 	return NULL;
 }
@@ -509,7 +509,7 @@ static void pci32_free_coherent(struct device *dev, size_t n, void *p,
 
 	release_resource(res);
 	kfree(res);
-	free_pages((unsigned long)phys_to_virt(ba), get_order(n));
+	free_pages(phys_to_virt(ba), get_order(n));
 }
 
 /*
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c
index 59d5038..1cba9b7 100644
--- a/arch/sparc/kernel/ldc.c
+++ b/arch/sparc/kernel/ldc.c
@@ -1000,7 +1000,7 @@ static void free_queue(unsigned long num_entries, struct ldc_packet *q)
 	size = num_entries * LDC_PACKET_SIZE;
 	order = get_order(size);
 
-	free_pages((unsigned long)q, order);
+	free_pages(q, order);
 }
 
 static unsigned long ldc_cookie_to_index(u64 cookie, void *arg)
@@ -1081,7 +1081,7 @@ static int ldc_iommu_init(const char *name, struct ldc_channel *lp)
 	return 0;
 
 out_free_table:
-	free_pages((unsigned long) table, order);
+	free_pages(table, order);
 	ldc_iommu->page_table = NULL;
 
 out_free_map:
@@ -1103,7 +1103,7 @@ static void ldc_iommu_release(struct ldc_channel *lp)
 	tsbsize = num_tsb_entries * sizeof(struct ldc_mtable_entry);
 	order = get_order(tsbsize);
 
-	free_pages((unsigned long) ldc_iommu->page_table, order);
+	free_pages(ldc_iommu->page_table, order);
 	ldc_iommu->page_table = NULL;
 
 	kfree(iommu->map);
diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c
index 11a1f0d..b8ac1bb 100644
--- a/arch/sparc/kernel/pci_fire.c
+++ b/arch/sparc/kernel/pci_fire.c
@@ -265,7 +265,7 @@ static void pci_fire_msiq_free(struct pci_pbm_info *pbm)
 	order = get_order(512 * 1024);
 	pages = (unsigned long) pbm->msi_queues;
 
-	free_pages(pages, order);
+	free_pages((void *)pages, order);
 
 	pbm->msi_queues = NULL;
 }
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index 836e8ce..1a678fc 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -190,7 +190,7 @@ iommu_map_fail:
 	iommu_tbl_range_free(&iommu->tbl, *dma_addrp, npages, IOMMU_ERROR_CODE);
 
 range_alloc_fail:
-	free_pages(first_page, order);
+	free_pages((void *)first_page, order);
 	return NULL;
 }
 
@@ -229,7 +229,7 @@ static void dma_4v_free_coherent(struct device *dev, size_t size, void *cpu,
 	iommu_tbl_range_free(&iommu->tbl, dvma, npages, IOMMU_ERROR_CODE);
 	order = get_order(size);
 	if (order < 10)
-		free_pages((unsigned long)cpu, order);
+		free_pages(cpu, order);
 }
 
 static dma_addr_t dma_4v_map_page(struct device *dev, struct page *page,
@@ -795,7 +795,7 @@ static int pci_sun4v_msiq_alloc(struct pci_pbm_info *pbm)
 	return 0;
 
 h_error:
-	free_pages(pages, order);
+	free_pages((void *)pages, order);
 	return -EINVAL;
 }
 
@@ -816,7 +816,7 @@ static void pci_sun4v_msiq_free(struct pci_pbm_info *pbm)
 
 	pages = (unsigned long) pbm->msi_queues;
 
-	free_pages(pages, order);
+	free_pages((void *)pages, order);
 
 	pbm->msi_queues = NULL;
 }
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 9ef669d..504f60b 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -888,7 +888,7 @@ void *get_output_buffer(int *len_out)
 
 void free_output_buffer(void *buffer)
 {
-	free_pages((unsigned long) buffer, 0);
+	free_pages(buffer, 0);
 }
 
 int tap_setup_common(char *str, char *type, char **dev_name, char **mac_out,
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index 48af59a..b77685b 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -57,7 +57,7 @@ int pid_to_processor_id(int pid)
 
 void free_stack(unsigned long stack, int order)
 {
-	free_pages(stack, order);
+	free_pages((void *)stack, order);
 }
 
 unsigned long alloc_stack(int order, int atomic)
diff --git a/arch/unicore32/mm/pgd.c b/arch/unicore32/mm/pgd.c
index 2ade20d..9485183 100644
--- a/arch/unicore32/mm/pgd.c
+++ b/arch/unicore32/mm/pgd.c
@@ -71,7 +71,7 @@ no_pte:
 	pmd_free(mm, new_pmd);
 	mm_dec_nr_pmds(mm);
 no_pmd:
-	free_pages((unsigned long)new_pgd, 0);
+	free_pages(new_pgd, 0);
 no_pgd:
 	return NULL;
 }
@@ -101,5 +101,5 @@ void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd)
 	pmd_free(mm, pmd);
 	mm_dec_nr_pmds(mm);
 free:
-	free_pages((unsigned long) pgd, 0);
+	free_pages(pgd, 0);
 }
diff --git a/arch/x86/include/asm/agp.h b/arch/x86/include/asm/agp.h
index eec2a70..4f98370 100644
--- a/arch/x86/include/asm/agp.h
+++ b/arch/x86/include/asm/agp.h
@@ -26,6 +26,6 @@
 #define alloc_gatt_pages(order)		\
 	((char *)__get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
-	free_pages((unsigned long)(table), (order))
+	free_pages((table), (order))
 
 #endif /* _ASM_X86_AGP_H */
diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
index 1c7eefe..8203e1d 100644
--- a/arch/x86/include/asm/floppy.h
+++ b/arch/x86/include/asm/floppy.h
@@ -170,7 +170,7 @@ static void _fd_dma_mem_free(unsigned long addr, unsigned long size)
 	if ((unsigned long)addr >= (unsigned long)high_memory)
 		vfree((void *)addr);
 	else
-		free_pages(addr, get_order(size));
+		free_pages((void *)addr, get_order(size));
 }
 
 #define fd_dma_mem_free(addr, size)  _fd_dma_mem_free(addr, size)
diff --git a/arch/x86/include/asm/xen/page-coherent.h b/arch/x86/include/asm/xen/page-coherent.h
index acd844c..8a55a89 100644
--- a/arch/x86/include/asm/xen/page-coherent.h
+++ b/arch/x86/include/asm/xen/page-coherent.h
@@ -18,7 +18,7 @@ static inline void xen_free_coherent_pages(struct device *hwdev, size_t size,
 		void *cpu_addr, dma_addr_t dma_handle,
 		struct dma_attrs *attrs)
 {
-	free_pages((unsigned long) cpu_addr, get_order(size));
+	free_pages(cpu_addr, get_order(size));
 }
 
 static inline void xen_dma_map_page(struct device *hwdev, struct page *page,
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 0497f71..97e092d 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -458,7 +458,7 @@ static void* calgary_alloc_coherent(struct device *dev, size_t size,
 	*dma_handle = mapping;
 	return ret;
 free:
-	free_pages((unsigned long)ret, get_order(size));
+	free_pages(ret, get_order(size));
 	ret = NULL;
 error:
 	return ret;
@@ -475,7 +475,7 @@ static void calgary_free_coherent(struct device *dev, size_t size,
 	npages = size >> PAGE_SHIFT;
 
 	iommu_free(tbl, dma_handle, npages);
-	free_pages((unsigned long)vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 }
 
 static struct dma_map_ops calgary_dma_ops = {
@@ -815,7 +815,7 @@ static void __init calgary_free_bus(struct pci_dev *dev)
 	readq(target); /* flush */
 
 	bitmapsz = tbl->it_size / BITS_PER_BYTE;
-	free_pages((unsigned long)tbl->it_map, get_order(bitmapsz));
+	free_pages(tbl->it_map, get_order(bitmapsz));
 	tbl->it_map = NULL;
 
 	kfree(tbl);
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 6ba014c..2418156 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -126,7 +126,7 @@ void dma_generic_free_coherent(struct device *dev, size_t size, void *vaddr,
 	struct page *page = virt_to_page(vaddr);
 
 	if (!dma_release_from_contiguous(dev, page, count))
-		free_pages((unsigned long)vaddr, get_order(size));
+		free_pages(vaddr, get_order(size));
 }
 
 bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f70ed2f..7206fee 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3300,7 +3300,7 @@ static struct vmcs *alloc_vmcs(void)
 
 static void free_vmcs(struct vmcs *vmcs)
 {
-	free_pages((unsigned long)vmcs, vmcs_config.order);
+	free_pages(vmcs, vmcs_config.order);
 }
 
 /*
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index ec081fe..53c86b6 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -727,7 +727,7 @@ static void __meminit free_pagetable(struct page *page, int order)
 			while (nr_pages--)
 				free_reserved_page(page++);
 	} else
-		free_pages((unsigned long)page_address(page), order);
+		free_pages(page_address(page), order);
 }
 
 static void __meminit free_pte_table(pte_t *pte_start, pmd_t *pmd)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index ad28540..ed873dd 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -700,7 +700,7 @@ static void *realloc_pages(void *old_memmap, int old_shift)
 	memcpy(ret, old_memmap, PAGE_SIZE << old_shift);
 
 out:
-	free_pages((unsigned long)old_memmap, old_shift);
+	free_pages(old_memmap, old_shift);
 	return ret;
 }
 
@@ -979,7 +979,7 @@ static void __init __efi_enter_virtual_mode(void)
 	 *
 	 * efi_cleanup_page_tables(__pa(new_memmap), 1 << pg_shift);
 	 */
-	free_pages((unsigned long)new_memmap, pg_shift);
+	free_pages(new_memmap, pg_shift);
 
 	/* clean DUMMY object */
 	efi_delete_dummy_variable();
diff --git a/arch/x86/um/ldt.c b/arch/x86/um/ldt.c
index 42522ff..52e173d 100644
--- a/arch/x86/um/ldt.c
+++ b/arch/x86/um/ldt.c
@@ -291,7 +291,7 @@ static void ldt_get_host_info(void)
 	host_ldt_entries[k] = -1;
 
 out_free:
-	free_pages((unsigned long)ldt, order);
+	free_pages(ldt, order);
 }
 
 long init_new_ldt(struct mm_context *new_mm, struct mm_context *from_mm)
diff --git a/arch/x86/xen/pmu.c b/arch/x86/xen/pmu.c
index 724a087..77d8e3d 100644
--- a/arch/x86/xen/pmu.c
+++ b/arch/x86/xen/pmu.c
@@ -549,7 +549,7 @@ void xen_pmu_init(int cpu)
 fail:
 	pr_warn_once("Could not initialize VPMU for cpu %d, error %d\n",
 		cpu, err);
-	free_pages((unsigned long)xenpmu_data, 0);
+	free_pages(xenpmu_data, 0);
 }
 
 void xen_pmu_finish(int cpu)
@@ -565,6 +565,6 @@ void xen_pmu_finish(int cpu)
 
 	(void)HYPERVISOR_xenpmu_op(XENPMU_finish, &xp);
 
-	free_pages((unsigned long)per_cpu(xenpmu_shared, cpu).xenpmu_data, 0);
+	free_pages(per_cpu(xenpmu_shared, cpu).xenpmu_data, 0);
 	per_cpu(xenpmu_shared, cpu).xenpmu_data = NULL;
 }
diff --git a/arch/xtensa/kernel/pci-dma.c b/arch/xtensa/kernel/pci-dma.c
index cd66698..0b8ef59 100644
--- a/arch/xtensa/kernel/pci-dma.c
+++ b/arch/xtensa/kernel/pci-dma.c
@@ -179,7 +179,7 @@ static void xtensa_dma_free(struct device *hwdev, size_t size, void *vaddr,
 	BUG_ON(addr < XCHAL_KSEG_CACHED_VADDR ||
 	       addr > XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_SIZE - 1);
 
-	free_pages(addr, get_order(size));
+	free_pages((void *)addr, get_order(size));
 }
 
 static dma_addr_t xtensa_map_page(struct device *dev, struct page *page,
diff --git a/crypto/xor.c b/crypto/xor.c
index 35d6b3a..20060f8 100644
--- a/crypto/xor.c
+++ b/crypto/xor.c
@@ -154,7 +154,7 @@ calibrate_xor_blocks(void)
 #undef xor_speed
 
  out:
-	free_pages((unsigned long)b1, 2);
+	free_pages(b1, 2);
 
 	active_template = fastest;
 	return 0;
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index 8fc654f..854f7ae 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -927,7 +927,7 @@ static void devm_pages_release(struct device *dev, void *res)
 {
 	struct pages_devres *devres = res;
 
-	free_pages(devres->addr, devres->order);
+	free_pages((void *)devres->addr, devres->order);
 }
 
 /**
@@ -957,7 +957,7 @@ unsigned long devm_get_free_pages(struct device *dev,
 	devres = devres_alloc(devm_pages_release,
 			      sizeof(struct pages_devres), GFP_KERNEL);
 	if (unlikely(!devres)) {
-		free_pages(addr, order);
+		free_pages((void *)addr, order);
 		return 0;
 	}
 
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 331363e..e2738be 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -267,7 +267,7 @@ static int set_next_request(void);
 /* Dma Memory related stuff */
 
 #ifndef fd_dma_mem_free
-#define fd_dma_mem_free(addr, size) free_pages(addr, get_order(size))
+#define fd_dma_mem_free(addr, size) free_pages((void *)addr, get_order(size))
 #endif
 
 #ifndef fd_dma_mem_alloc
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 56847fc..db7ece5 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -802,7 +802,7 @@ out_free_memory:
 out_close_gpu:
 	ps3_close_hv_device(dev);
 out_free_xdr_buf:
-	free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE));
+	free_pages(priv->xdr_buf, get_order(XDR_BUF_SIZE));
 fail_free_priv:
 	kfree(priv);
 	ps3_system_bus_set_drvdata(dev, NULL);
@@ -827,7 +827,7 @@ static int ps3vram_remove(struct ps3_system_bus_device *dev)
 	lv1_gpu_context_free(priv->context_handle);
 	lv1_gpu_memory_free(priv->memory_handle);
 	ps3_close_hv_device(dev);
-	free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE));
+	free_pages(priv->xdr_buf, get_order(XDR_BUF_SIZE));
 	kfree(priv);
 	ps3_system_bus_set_drvdata(dev, NULL);
 	return 0;
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 2fee2ee..19b8697 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1174,7 +1174,7 @@ free_shadow:
 			info->ring_ref[i] = GRANT_INVALID_REF;
 		}
 	}
-	free_pages((unsigned long)info->ring.sring, get_order(info->nr_ring_pages * PAGE_SIZE));
+	free_pages(info->ring.sring, get_order(info->nr_ring_pages * PAGE_SIZE));
 	info->ring.sring = NULL;
 
 	if (info->irq)
@@ -1429,7 +1429,7 @@ static int setup_blkring(struct xenbus_device *dev,
 
 	err = xenbus_grant_ring(dev, info->ring.sring, info->nr_ring_pages, gref);
 	if (err < 0) {
-		free_pages((unsigned long)sring, get_order(ring_size));
+		free_pages(sring, get_order(ring_size));
 		info->ring.sring = NULL;
 		goto fail;
 	}
diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
index 5cb13ca..efaa135 100644
--- a/drivers/block/zram/zcomp.c
+++ b/drivers/block/zram/zcomp.c
@@ -66,7 +66,7 @@ static void zcomp_strm_free(struct zcomp *comp, struct zcomp_strm *zstrm)
 {
 	if (zstrm->private)
 		comp->backend->destroy(zstrm->private);
-	free_pages((unsigned long)zstrm->buffer, 1);
+	free_pages(zstrm->buffer, 1);
 	kfree(zstrm);
 }
 
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c
index 3695773..9f83f13 100644
--- a/drivers/char/agp/hp-agp.c
+++ b/drivers/char/agp/hp-agp.c
@@ -321,7 +321,7 @@ hp_zx1_free_gatt_table (struct agp_bridge_data *bridge)
 	struct _hp_private *hp = &hp_private;
 
 	if (hp->io_pdir_owner)
-		free_pages((unsigned long) hp->io_pdir,
+		free_pages(hp->io_pdir,
 			    get_order(hp->io_pdir_size));
 	else
 		hp->gatt[0] = HP_ZX1_SBA_IOMMU_COOKIE;
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 0575544..bcbe6a5 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -439,7 +439,7 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge)
 enomem:
 	kfree(uninorth_priv.pages_arr);
 	if (table)
-		free_pages((unsigned long)table, page_order);
+		free_pages(table, page_order);
 	return -ENOMEM;
 }
 
@@ -466,7 +466,7 @@ static int uninorth_free_gatt_table(struct agp_bridge_data *bridge)
 	for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
 		ClearPageReserved(page);
 
-	free_pages((unsigned long) bridge->gatt_table_real, page_order);
+	free_pages(bridge->gatt_table_real, page_order);
 
 	return 0;
 }
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c
index e5d3e3f..b9d9619 100644
--- a/drivers/char/mbcs.c
+++ b/drivers/char/mbcs.c
@@ -419,7 +419,7 @@ static ssize_t mbcs_sram_read(struct file * fp, char __user *buf, size_t len, lo
 		rv = -EFAULT;
 
       exit:
-	free_pages(hostAddr, get_order(len));
+	free_pages((void *)hostAddr, get_order(len));
 
 	return rv;
 }
@@ -444,7 +444,7 @@ mbcs_sram_write(struct file * fp, const char __user *buf, size_t len, loff_t * o
 	rv = do_mbcs_sram_dmaread(soft, hostAddr, len, off);
 
       exit:
-	free_pages(hostAddr, get_order(len));
+	free_pages((void *)hostAddr, get_order(len));
 
 	return rv;
 }
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index eba2314..cd41ce7 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -701,8 +701,8 @@ static void omap_aes_done_task(unsigned long data)
 
 		len = ALIGN(dd->total_save, AES_BLOCK_SIZE);
 		pages = get_order(len);
-		free_pages((unsigned long)buf_in, pages);
-		free_pages((unsigned long)buf_out, pages);
+		free_pages(buf_in, pages);
+		free_pages(buf_out, pages);
 	}
 
 	omap_aes_finish_req(dd, 0);
diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index 0a70e46..462f2bc 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -680,8 +680,8 @@ static void omap_des_done_task(unsigned long data)
 		sg_copy_buf(buf_out, dd->orig_out, 0, dd->total_save, 1);
 
 		pages = get_order(dd->total_save);
-		free_pages((unsigned long)buf_in, pages);
-		free_pages((unsigned long)buf_out, pages);
+		free_pages(buf_in, pages);
+		free_pages(buf_out, pages);
 	}
 
 	omap_des_finish_req(dd, 0);
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index dd3e7ba..2971d47 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3434,7 +3434,7 @@ static int __init d40_lcla_allocate(struct d40_base *base)
 			ret = -ENOMEM;
 
 			for (j = 0; j < i; j++)
-				free_pages(page_list[j], base->lcla_pool.pages);
+				free_pages((void *)page_list[j], base->lcla_pool.pages);
 			goto failure;
 		}
 
@@ -3444,7 +3444,7 @@ static int __init d40_lcla_allocate(struct d40_base *base)
 	}
 
 	for (j = 0; j < i; j++)
-		free_pages(page_list[j], base->lcla_pool.pages);
+		free_pages((void *)page_list[j], base->lcla_pool.pages);
 
 	if (i < MAX_LCLA_ALLOC_ATTEMPTS) {
 		base->lcla_pool.base = (void *)page_list[i];
@@ -3710,7 +3710,7 @@ failure:
 					 DMA_TO_DEVICE);
 
 		if (!base->lcla_pool.base_unaligned && base->lcla_pool.base)
-			free_pages((unsigned long)base->lcla_pool.base,
+			free_pages(base->lcla_pool.base,
 				   base->lcla_pool.pages);
 
 		kfree(base->lcla_pool.base_unaligned);
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index 2f452f1f..7d1afaa 100644
--- a/drivers/firmware/dell_rbu.c
+++ b/drivers/firmware/dell_rbu.c
@@ -207,7 +207,7 @@ out_alloc_packet_array:
 		pr_debug("freeing unused packet below floor 0x%lx.\n",
 			(unsigned long)virt_to_phys(
 				invalid_addr_packet_array[idx-1]));
-		free_pages((unsigned long)invalid_addr_packet_array[idx-1],
+		free_pages(invalid_addr_packet_array[idx-1],
 			ordernum);
 	}
 	kfree(invalid_addr_packet_array);
@@ -349,8 +349,7 @@ static void packet_empty_list(void)
 		 * to make sure there are no stale RBU packets left in memory
 		 */
 		memset(newpacket->data, 0, rbu_data.packetsize);
-		free_pages((unsigned long) newpacket->data,
-			newpacket->ordernum);
+		free_pages(newpacket->data, newpacket->ordernum);
 		kfree(newpacket);
 	}
 	rbu_data.packet_read_count = 0;
@@ -376,7 +375,7 @@ static void img_update_free(void)
 		dma_free_coherent(NULL, rbu_data.bios_image_size,
 			rbu_data.image_update_buffer, dell_rbu_dmaaddr);
 	else
-		free_pages((unsigned long) rbu_data.image_update_buffer,
+		free_pages(rbu_data.image_update_buffer,
 			rbu_data.image_update_ordernum);
 
 	/*
@@ -442,7 +441,7 @@ static int img_update_realloc(unsigned long size)
 		(unsigned long) virt_to_phys(image_update_buffer);
 
 	if (img_buf_phys_addr > BIOS_SCAN_LIMIT) {
-		free_pages((unsigned long) image_update_buffer, ordernum);
+		free_pages(image_update_buffer, ordernum);
 		ordernum = -1;
 		image_update_buffer = dma_alloc_coherent(NULL, size,
 			&dell_rbu_dmaaddr, GFP_KERNEL);
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
index b6e28dc..8bb3671 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
@@ -381,7 +381,7 @@ static void shutdown_signal_pages(struct kfd_process *p)
 
 	list_for_each_entry_safe(page, tmp, &p->signal_event_pages,
 					event_pages) {
-		free_pages((unsigned long)page->kernel_address,
+		free_pages(page->kernel_address,
 				get_order(KFD_SIGNAL_EVENT_LIMIT * 8));
 		kfree(page);
 	}
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index c4dcab0..0b65dc5 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -210,7 +210,7 @@ error_gpadl:
 	vmbus_teardown_gpadl(newchannel, newchannel->ringbuffer_gpadlhandle);
 
 error0:
-	free_pages((unsigned long)out,
+	free_pages(out,
 		get_order(send_ringbuffer_size + recv_ringbuffer_size));
 	kfree(open_info);
 	newchannel->state = CHANNEL_OPEN_STATE;
@@ -546,7 +546,7 @@ static int vmbus_close_internal(struct vmbus_channel *channel)
 	hv_ringbuffer_cleanup(&channel->outbound);
 	hv_ringbuffer_cleanup(&channel->inbound);
 
-	free_pages((unsigned long)channel->ringbuffer_pages,
+	free_pages(channel->ringbuffer_pages,
 		get_order(channel->ringbuffer_pagecount * PAGE_SIZE));
 
 	/*
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 4fc2e88..99cf9e9 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -241,12 +241,12 @@ void vmbus_disconnect(void)
 	}
 
 	if (vmbus_connection.int_page) {
-		free_pages((unsigned long)vmbus_connection.int_page, 0);
+		free_pages(vmbus_connection.int_page, 0);
 		vmbus_connection.int_page = NULL;
 	}
 
-	free_pages((unsigned long)vmbus_connection.monitor_pages[0], 0);
-	free_pages((unsigned long)vmbus_connection.monitor_pages[1], 0);
+	free_pages(vmbus_connection.monitor_pages[0], 0);
+	free_pages(vmbus_connection.monitor_pages[1], 0);
 	vmbus_connection.monitor_pages[0] = NULL;
 	vmbus_connection.monitor_pages[1] = NULL;
 }
diff --git a/drivers/infiniband/hw/qib/qib_dma.c b/drivers/infiniband/hw/qib/qib_dma.c
index 59fe092..9544208 100644
--- a/drivers/infiniband/hw/qib/qib_dma.c
+++ b/drivers/infiniband/hw/qib/qib_dma.c
@@ -151,7 +151,7 @@ static void *qib_dma_alloc_coherent(struct ib_device *dev, size_t size,
 static void qib_dma_free_coherent(struct ib_device *dev, size_t size,
 				  void *cpu_addr, u64 dma_handle)
 {
-	free_pages((unsigned long) cpu_addr, get_order(size));
+	free_pages(cpu_addr, get_order(size));
 }
 
 struct ib_dma_mapping_ops qib_dma_mapping_ops = {
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 013bdff..ace59ca 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -541,7 +541,7 @@ static void iommu_enable_command_buffer(struct amd_iommu *iommu)
 
 static void __init free_command_buffer(struct amd_iommu *iommu)
 {
-	free_pages((unsigned long)iommu->cmd_buf, get_order(CMD_BUFFER_SIZE));
+	free_pages(iommu->cmd_buf, get_order(CMD_BUFFER_SIZE));
 }
 
 /* allocates the memory where the IOMMU will log its events to */
@@ -573,7 +573,7 @@ static void iommu_enable_event_buffer(struct amd_iommu *iommu)
 
 static void __init free_event_buffer(struct amd_iommu *iommu)
 {
-	free_pages((unsigned long)iommu->evt_buf, get_order(EVT_BUFFER_SIZE));
+	free_pages(iommu->evt_buf, get_order(EVT_BUFFER_SIZE));
 }
 
 /* allocates the memory where the IOMMU will log its events to */
@@ -610,7 +610,7 @@ static void __init free_ppr_log(struct amd_iommu *iommu)
 	if (iommu->ppr_log == NULL)
 		return;
 
-	free_pages((unsigned long)iommu->ppr_log, get_order(PPR_LOG_SIZE));
+	free_pages(iommu->ppr_log, get_order(PPR_LOG_SIZE));
 }
 
 static void iommu_enable_gt(struct amd_iommu *iommu)
@@ -1692,20 +1692,16 @@ static struct syscore_ops amd_iommu_syscore_ops = {
 
 static void __init free_on_init_error(void)
 {
-	free_pages((unsigned long)irq_lookup_table,
-		   get_order(rlookup_table_size));
+	free_pages(irq_lookup_table, get_order(rlookup_table_size));
 
 	kmem_cache_destroy(amd_iommu_irq_cache);
 	amd_iommu_irq_cache = NULL;
 
-	free_pages((unsigned long)amd_iommu_rlookup_table,
-		   get_order(rlookup_table_size));
+	free_pages(amd_iommu_rlookup_table, get_order(rlookup_table_size));
 
-	free_pages((unsigned long)amd_iommu_alias_table,
-		   get_order(alias_table_size));
+	free_pages(amd_iommu_alias_table, get_order(alias_table_size));
 
-	free_pages((unsigned long)amd_iommu_dev_table,
-		   get_order(dev_table_size));
+	free_pages(amd_iommu_dev_table, get_order(dev_table_size));
 
 	free_iommu_all();
 
@@ -1773,8 +1769,7 @@ static bool __init check_ioapic_information(void)
 
 static void __init free_dma_resources(void)
 {
-	free_pages((unsigned long)amd_iommu_pd_alloc_bitmap,
-		   get_order(MAX_DOMAIN_ID/8));
+	free_pages(amd_iommu_pd_alloc_bitmap, get_order(MAX_DOMAIN_ID/8));
 
 	free_unity_maps();
 }
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 97c41b8..828a316 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -702,7 +702,7 @@ static struct iommu_domain *exynos_iommu_domain_alloc(unsigned type)
 	return &domain->domain;
 
 err_counter:
-	free_pages((unsigned long)domain->pgtable, 2);
+	free_pages(domain->pgtable, 2);
 err_pgtable:
 	kfree(domain);
 	return NULL;
@@ -732,8 +732,8 @@ static void exynos_iommu_domain_free(struct iommu_domain *iommu_domain)
 			kmem_cache_free(lv2table_kmem_cache,
 				phys_to_virt(lv2table_base(domain->pgtable + i)));
 
-	free_pages((unsigned long)domain->pgtable, 2);
-	free_pages((unsigned long)domain->lv2entcnt, 1);
+	free_pages(domain->pgtable, 2);
+	free_pages(domain->lv2entcnt, 1);
 	kfree(domain);
 }
 
diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index a34355f..3772d00 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -1193,7 +1193,7 @@ error:
 		iounmap(guts_regs);
 
 	if (ppaact)
-		free_pages((unsigned long)ppaact, order);
+		free_pages(ppaact, order);
 
 	ppaact = NULL;
 
diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c
index c69e3f9..a911b6c 100644
--- a/drivers/iommu/intel-svm.c
+++ b/drivers/iommu/intel-svm.c
@@ -75,11 +75,11 @@ int intel_svm_free_pasid_tables(struct intel_iommu *iommu)
 		order = 0;
 
 	if (iommu->pasid_table) {
-		free_pages((unsigned long)iommu->pasid_table, order);
+		free_pages(iommu->pasid_table, order);
 		iommu->pasid_table = NULL;
 	}
 	if (iommu->pasid_state_table) {
-		free_pages((unsigned long)iommu->pasid_state_table, order);
+		free_pages(iommu->pasid_state_table, order);
 		iommu->pasid_state_table = NULL;
 	}
 	idr_destroy(&iommu->pasid_idr);
@@ -107,7 +107,7 @@ int intel_svm_enable_prq(struct intel_iommu *iommu)
 		       iommu->name);
 		ret = -EINVAL;
 	err:
-		free_pages((unsigned long)iommu->prq, PRQ_ORDER);
+		free_pages(iommu->prq, PRQ_ORDER);
 		iommu->prq = NULL;
 		return ret;
 	}
@@ -140,7 +140,7 @@ int intel_svm_finish_prq(struct intel_iommu *iommu)
 	dmar_free_hwirq(iommu->pr_irq);
 	iommu->pr_irq = 0;
 
-	free_pages((unsigned long)iommu->prq, PRQ_ORDER);
+	free_pages(iommu->prq, PRQ_ORDER);
 	iommu->prq = NULL;
 
 	return 0;
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index 1fae188..fb79ee2 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -602,7 +602,7 @@ static void intel_teardown_irq_remapping(struct intel_iommu *iommu)
 			irq_domain_remove(iommu->ir_domain);
 			iommu->ir_domain = NULL;
 		}
-		free_pages((unsigned long)iommu->ir_table->base,
+		free_pages(iommu->ir_table->base,
 			   INTR_REMAP_PAGE_ORDER);
 		kfree(iommu->ir_table->bitmap);
 		kfree(iommu->ir_table);
diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index b8bcc57..01afc79 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -262,7 +262,7 @@ static void msm_iommu_domain_free(struct iommu_domain *domain)
 		if ((fl_table[i] & 0x03) == FL_TYPE_TABLE)
 			free_page(__va(((fl_table[i]) & FL_BASE_MASK)));
 
-	free_pages((unsigned long)priv->pgtable, get_order(SZ_16K));
+	free_pages(priv->pgtable, get_order(SZ_16K));
 	priv->pgtable = NULL;
 
 	kfree(priv);
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
index 646fe85..3059674 100644
--- a/drivers/md/bcache/bset.c
+++ b/drivers/md/bcache/bset.c
@@ -292,16 +292,14 @@ void bch_btree_keys_free(struct btree_keys *b)
 	if (bset_prev_bytes(b) < PAGE_SIZE)
 		kfree(t->prev);
 	else
-		free_pages((unsigned long) t->prev,
-			   get_order(bset_prev_bytes(b)));
+		free_pages(t->prev, get_order(bset_prev_bytes(b)));
 
 	if (bset_tree_bytes(b) < PAGE_SIZE)
 		kfree(t->tree);
 	else
-		free_pages((unsigned long) t->tree,
-			   get_order(bset_tree_bytes(b)));
+		free_pages(t->tree, get_order(bset_tree_bytes(b)));
 
-	free_pages((unsigned long) t->data, b->page_order);
+	free_pages(t->data, b->page_order);
 
 	t->prev = NULL;
 	t->tree = NULL;
@@ -1220,7 +1218,7 @@ static void __btree_sort(struct btree_keys *b, struct btree_iter *iter,
 	if (used_mempool)
 		mempool_free(virt_to_page(out), state->pool);
 	else
-		free_pages((unsigned long) out, order);
+		free_pages(out, order);
 
 	bch_bset_build_written_tree(b);
 
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 83392f8..1540114 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -751,7 +751,7 @@ void bch_btree_cache_free(struct cache_set *c)
 	if (c->verify_data)
 		list_move(&c->verify_data->list, &c->btree_cache);
 
-	free_pages((unsigned long) c->verify_ondisk, ilog2(bucket_pages(c)));
+	free_pages(c->verify_ondisk, ilog2(bucket_pages(c)));
 #endif
 
 	list_splice(&c->btree_cache_freeable,
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
index 29eba72..6ed9533 100644
--- a/drivers/md/bcache/journal.c
+++ b/drivers/md/bcache/journal.c
@@ -797,8 +797,8 @@ void bch_journal_meta(struct cache_set *c, struct closure *cl)
 
 void bch_journal_free(struct cache_set *c)
 {
-	free_pages((unsigned long) c->journal.w[1].data, JSET_BITS);
-	free_pages((unsigned long) c->journal.w[0].data, JSET_BITS);
+	free_pages(c->journal.w[1].data, JSET_BITS);
+	free_pages(c->journal.w[0].data, JSET_BITS);
 	free_fifo(&c->journal.pin);
 }
 
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 679a093..cd04e2d 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1329,7 +1329,7 @@ static void cache_set_free(struct closure *cl)
 		}
 
 	bch_bset_sort_state_free(&c->sort);
-	free_pages((unsigned long) c->uuids, ilog2(bucket_pages(c)));
+	free_pages(c->uuids, ilog2(bucket_pages(c)));
 
 	if (c->moving_gc_wq)
 		destroy_workqueue(c->moving_gc_wq);
@@ -1768,7 +1768,7 @@ void bch_cache_release(struct kobject *kobj)
 		ca->set->cache[ca->sb.nr_this_dev] = NULL;
 	}
 
-	free_pages((unsigned long) ca->disk_buckets, ilog2(bucket_pages(ca)));
+	free_pages(ca->disk_buckets, ilog2(bucket_pages(ca)));
 	kfree(ca->prio_buckets);
 	vfree(ca->buckets);
 
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 2dd3308..10f8a45 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -419,7 +419,7 @@ static void free_buffer_data(struct dm_bufio_client *c,
 		break;
 
 	case DATA_MODE_GET_FREE_PAGES:
-		free_pages((unsigned long)data, c->pages_per_block_bits);
+		free_pages(data, c->pages_per_block_bits);
 		break;
 
 	case DATA_MODE_VMALLOC:
diff --git a/drivers/media/pci/solo6x10/solo6x10-p2m.c b/drivers/media/pci/solo6x10/solo6x10-p2m.c
index 8c84846..ef91be9 100644
--- a/drivers/media/pci/solo6x10/solo6x10-p2m.c
+++ b/drivers/media/pci/solo6x10/solo6x10-p2m.c
@@ -227,7 +227,7 @@ static int solo_p2m_test(struct solo_dev *solo_dev, int base, int size)
 
 	rd_buf = (u32 *)__get_free_pages(GFP_KERNEL, order);
 	if (rd_buf == NULL) {
-		free_pages((unsigned long)wr_buf, order);
+		free_pages(wr_buf, order);
 		return -1;
 	}
 
@@ -253,8 +253,8 @@ static int solo_p2m_test(struct solo_dev *solo_dev, int base, int size)
 	ret = 0;
 
 test_fail:
-	free_pages((unsigned long)wr_buf, order);
-	free_pages((unsigned long)rd_buf, order);
+	free_pages(wr_buf, order);
+	free_pages(rd_buf, order);
 
 	return ret;
 }
diff --git a/drivers/media/platform/davinci/dm644x_ccdc.c b/drivers/media/platform/davinci/dm644x_ccdc.c
index ffbefdf..31d4015 100644
--- a/drivers/media/platform/davinci/dm644x_ccdc.c
+++ b/drivers/media/platform/davinci/dm644x_ccdc.c
@@ -261,7 +261,7 @@ static int ccdc_update_raw_params(struct ccdc_config_params_raw *raw_params)
 	 */
 	if (raw_params->fault_pxl.fp_num != config_params->fault_pxl.fp_num) {
 		if (fpc_physaddr != NULL) {
-			free_pages((unsigned long)fpc_physaddr,
+			free_pages(fpc_physaddr,
 				   get_order
 				   (config_params->fault_pxl.fp_num *
 				   FP_NUM_BYTES));
@@ -306,7 +306,7 @@ static int ccdc_close(struct device *dev)
 	if (fpc_physaddr != NULL) {
 		fpc_virtaddr = (unsigned int *)
 		    phys_to_virt((unsigned long)fpc_physaddr);
-		free_pages((unsigned long)fpc_virtaddr,
+		free_pages(fpc_virtaddr,
 			   get_order(config_params->fault_pxl.fp_num *
 			   FP_NUM_BYTES));
 	}
diff --git a/drivers/media/platform/omap/omap_voutlib.c b/drivers/media/platform/omap/omap_voutlib.c
index 80b0d88..f8cf63a 100644
--- a/drivers/media/platform/omap/omap_voutlib.c
+++ b/drivers/media/platform/omap/omap_voutlib.c
@@ -335,7 +335,7 @@ void omap_vout_free_buffer(unsigned long virtaddr, u32 buf_size)
 		addr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
-	free_pages((unsigned long) virtaddr, order);
+	free_pages((void *)virtaddr, order);
 }
 
 bool omap_vout_dss_omap24xx(void)
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
index f409097..4620627 100644
--- a/drivers/misc/cxl/native.c
+++ b/drivers/misc/cxl/native.c
@@ -228,7 +228,7 @@ static inline void detach_spa(struct cxl_afu *afu)
 void cxl_release_spa(struct cxl_afu *afu)
 {
 	if (afu->spa) {
-		free_pages((unsigned long) afu->spa, afu->spa_order);
+		free_pages(afu->spa, afu->spa_order);
 		afu->spa = NULL;
 	}
 }
diff --git a/drivers/misc/mic/card/mic_virtio.c b/drivers/misc/mic/card/mic_virtio.c
index e486a0c..bb364ee 100644
--- a/drivers/misc/mic/card/mic_virtio.c
+++ b/drivers/misc/mic/card/mic_virtio.c
@@ -204,7 +204,7 @@ static void mic_del_vq(struct virtqueue *vq, int n)
 	struct mic_vdev *mvdev = to_micvdev(vq->vdev);
 	struct vring *vr = (struct vring *)(vq + 1);
 
-	free_pages((unsigned long) vr->used, get_order(mvdev->used_size[n]));
+	free_pages(vr->used, get_order(mvdev->used_size[n]));
 	vring_del_virtqueue(vq);
 	mic_card_unmap(mvdev->mdev, mvdev->vr[n]);
 	mvdev->vr[n] = NULL;
diff --git a/drivers/misc/mic/host/mic_virtio.c b/drivers/misc/mic/host/mic_virtio.c
index 58b107a..3474aa2 100644
--- a/drivers/misc/mic/host/mic_virtio.c
+++ b/drivers/misc/mic/host/mic_virtio.c
@@ -663,7 +663,7 @@ int mic_virtio_add_device(struct mic_vdev *mvdev,
 		vr->info->magic = cpu_to_le32(MIC_MAGIC + mvdev->virtio_id + i);
 		vr_addr = mic_map_single(mdev, vr->va, vr_size);
 		if (mic_map_error(vr_addr)) {
-			free_pages((unsigned long)vr->va, get_order(vr_size));
+			free_pages(vr->va, get_order(vr_size));
 			ret = -ENOMEM;
 			dev_err(mic_dev(mvdev), "%s %d err %d\n",
 				__func__, __LINE__, ret);
@@ -732,8 +732,7 @@ err:
 		struct mic_vringh *mvr = &mvdev->mvr[j];
 		mic_unmap_single(mdev, le64_to_cpu(vqconfig[j].address),
 				 mvr->vring.len);
-		free_pages((unsigned long)mvr->vring.va,
-			   get_order(mvr->vring.len));
+		free_pages(mvr->vring.va, get_order(mvr->vring.len));
 	}
 	mutex_unlock(&mdev->mic_mutex);
 	return ret;
@@ -779,14 +778,12 @@ skip_hot_remove:
 
 		mic_unmap_single(mvdev->mdev, mvr->buf_da,
 				 MIC_INT_DMA_BUF_SIZE);
-		free_pages((unsigned long)mvr->buf,
-			   get_order(MIC_INT_DMA_BUF_SIZE));
+		free_pages(mvr->buf, get_order(MIC_INT_DMA_BUF_SIZE));
 		vringh_kiov_cleanup(&mvr->riov);
 		vringh_kiov_cleanup(&mvr->wiov);
 		mic_unmap_single(mdev, le64_to_cpu(vqconfig[i].address),
 				 mvr->vring.len);
-		free_pages((unsigned long)mvr->vring.va,
-			   get_order(mvr->vring.len));
+		free_pages(mvr->vring.va, get_order(mvr->vring.len));
 	}
 
 	list_for_each_safe(pos, tmp, &mdev->vdev_list) {
diff --git a/drivers/misc/mic/scif/scif_rma.h b/drivers/misc/mic/scif/scif_rma.h
index fa67222..e13ab83 100644
--- a/drivers/misc/mic/scif/scif_rma.h
+++ b/drivers/misc/mic/scif/scif_rma.h
@@ -420,7 +420,7 @@ static inline void scif_free(void *addr, size_t size)
 	if (is_vmalloc_addr(addr))
 		vfree(addr);
 	else
-		free_pages((unsigned long)addr, get_order(align));
+		free_pages(addr, get_order(align));
 }
 
 static inline void scif_get_window(struct scif_window *window, int nr_pages)
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c
index 104a05f..276a599 100644
--- a/drivers/misc/sgi-gru/grufile.c
+++ b/drivers/misc/sgi-gru/grufile.c
@@ -306,7 +306,7 @@ static int gru_init_tables(unsigned long gru_base_paddr, void *gru_base_vaddr)
 
 fail:
 	for (bid--; bid >= 0; bid--)
-		free_pages((unsigned long)gru_base[bid], order);
+		free_pages(gru_base[bid], order);
 	return -ENOMEM;
 }
 
@@ -317,7 +317,7 @@ static void gru_free_tables(void)
 			      GRU_CHIPLETS_PER_BLADE);
 
 	for (bid = 0; bid < GRU_MAX_BLADES; bid++)
-		free_pages((unsigned long)gru_base[bid], order);
+		free_pages(gru_base[bid], order);
 }
 
 static unsigned long gru_chiplet_cpu_to_mmr(int chiplet, int cpu, int *corep)
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
index 340b44d..c3fce37 100644
--- a/drivers/misc/sgi-xp/xpc_uv.c
+++ b/drivers/misc/sgi-xp/xpc_uv.c
@@ -295,7 +295,7 @@ out_5:
 out_4:
 	xpc_gru_mq_watchlist_free_uv(mq);
 out_3:
-	free_pages((unsigned long)mq->address, pg_order);
+	free_pages(mq->address, pg_order);
 out_2:
 	kfree(mq->gru_mq_desc);
 out_1:
@@ -324,7 +324,7 @@ xpc_destroy_gru_mq_uv(struct xpc_gru_mq_uv *mq)
 	xpc_gru_mq_watchlist_free_uv(mq);
 
 	pg_order = mq->order - PAGE_SHIFT;
-	free_pages((unsigned long)mq->address, pg_order);
+	free_pages(mq->address, pg_order);
 
 	kfree(mq);
 }
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index e4b05db..be9c8d7 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -350,7 +350,7 @@ void tmio_mmc_release_dma(struct tmio_mmc_host *host)
 		dma_release_channel(chan);
 	}
 	if (host->bounce_buf) {
-		free_pages((unsigned long)host->bounce_buf, 0);
+		free_pages(host->bounce_buf, 0);
 		host->bounce_buf = NULL;
 	}
 }
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index 01e2ac5..c98dea0 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -1182,7 +1182,7 @@ out4:
 	if (dev->irq)
 		free_irq(dev->irq, dev);
 out3:
-	free_pages((unsigned long)ltdmabuf, get_order(1000));
+	free_pages(ltdmabuf, get_order(1000));
 out2:
 	release_region(io, 8);
 out1:
@@ -1277,7 +1277,7 @@ static void __exit ltpc_cleanup(void)
 
 	if(debug & DEBUG_VERBOSE) printk("free_pages\n");
 
-	free_pages( (unsigned long) ltdmabuf, get_order(1000));
+	free_pages(ltdmabuf, get_order(1000));
 
 	if(debug & DEBUG_VERBOSE) printk("returning from cleanup_module\n");
 }
diff --git a/drivers/net/ethernet/amd/mvme147.c b/drivers/net/ethernet/amd/mvme147.c
index 0660ac5..abda91c 100644
--- a/drivers/net/ethernet/amd/mvme147.c
+++ b/drivers/net/ethernet/amd/mvme147.c
@@ -134,7 +134,7 @@ struct net_device * __init mvme147lance_probe(int unit)
 
 	err = register_netdev(dev);
 	if (err) {
-		free_pages(lp->ram, 3);
+		free_pages((void *)lp->ram, 3);
 		free_netdev(dev);
 		return ERR_PTR(err);
 	}
@@ -193,7 +193,7 @@ void __exit cleanup_module(void)
 {
 	struct m147lance_private *lp = netdev_priv(dev_mvme147_lance);
 	unregister_netdev(dev_mvme147_lance);
-	free_pages(lp->ram, 3);
+	free_pages((void *)lp->ram, 3);
 	free_netdev(dev_mvme147_lance);
 }
 
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_main.h b/drivers/net/ethernet/cavium/liquidio/octeon_main.h
index cbd0819..61dbccc 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_main.h
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_main.h
@@ -141,7 +141,7 @@ cnnic_alloc_aligned_dma(struct pci_dev *pci_dev,
 		    (void *)__get_free_pages(GFP_KERNEL,
 					     get_order(size));
 		if ((unsigned long)ptr & 0x07) {
-			free_pages((unsigned long)ptr, get_order(size));
+			free_pages(ptr, get_order(size));
 			ptr = NULL;
 			/* Increment the size required if the first
 			 * attempt failed.
@@ -160,7 +160,7 @@ cnnic_alloc_aligned_dma(struct pci_dev *pci_dev,
 }
 
 #define cnnic_free_aligned_dma(pci_dev, ptr, size, orig_ptr, dma_addr) \
-		free_pages(orig_ptr, get_order(size))
+		free_pages((void *)orig_ptr, get_order(size))
 
 static inline void
 sleep_cond(wait_queue_head_t *wait_queue, int *condition)
diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index 6038304..815c596 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -473,7 +473,7 @@ skip_this_frame:
 static void release_dma_buff(struct net_local *lp)
 {
 	if (lp->dma_buff) {
-		free_pages((unsigned long)(lp->dma_buff),
+		free_pages(lp->dma_buff,
 			   get_order(lp->dmasize * 1024));
 		lp->dma_buff = NULL;
 	}
diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
index d3b1416..e314d3f 100644
--- a/drivers/net/ethernet/sgi/ioc3-eth.c
+++ b/drivers/net/ethernet/sgi/ioc3-eth.c
@@ -872,7 +872,7 @@ static void ioc3_free_rings(struct ioc3_private *ip)
 
 	if (ip->txr) {
 		ioc3_clean_tx_ring(ip);
-		free_pages((unsigned long)ip->txr, 2);
+		free_pages(ip->txr, 2);
 		ip->txr = NULL;
 	}
 
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index ab6051a..66ac0ffe 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -9974,7 +9974,7 @@ static void niu_phys_free_coherent(struct device *dev, size_t size,
 {
 	unsigned long order = get_order(size);
 
-	free_pages((unsigned long) cpu_addr, order);
+	free_pages(cpu_addr, order);
 }
 
 static u64 niu_phys_map_page(struct device *dev, struct page *page,
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c
index 0a15acc..d1a9d77 100644
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -1262,12 +1262,10 @@ static void tile_net_init_mpipe_fail(int instance)
 
 	for_each_online_cpu(cpu) {
 		struct tile_net_info *info = &per_cpu(per_cpu_info, cpu);
-		free_pages(
-			(unsigned long)(
-				info->mpipe[instance].comps_for_echannel[0]),
+		free_pages(info->mpipe[instance].comps_for_echannel[0],
 			get_order(COMPS_SIZE));
 		info->mpipe[instance].comps_for_echannel[0] = NULL;
-		free_pages((unsigned long)(info->mpipe[instance].iqueue.idescs),
+		free_pages(info->mpipe[instance].iqueue.idescs,
 			   get_order(NOTIF_RING_SIZE));
 		info->mpipe[instance].iqueue.idescs = NULL;
 	}
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index 44e4f38..6095cf4 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -242,7 +242,7 @@ static void *dma_alloc(size_t size, dma_addr_t *dma_handle)
 static void dma_free(void *vaddr, size_t size)
 {
 	vaddr = (void *)KSEG0ADDR(vaddr);
-	free_pages((unsigned long) vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 }
 
 
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index 01f08a7..d0c1b13 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -626,7 +626,7 @@ static void __exit rionet_exit(void)
 				kfree(peer);
 			}
 
-			free_pages((unsigned long)nets[i].active,
+			free_pages(nets[i].active,
 				 get_order(sizeof(void *) *
 				 RIO_MAX_ROUTE_ENTRIES(rnet->mport->sys_size)));
 			nets[i].active = NULL;
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c
index 260de71..50a2316 100644
--- a/drivers/net/wireless/b43/debugfs.c
+++ b/drivers/net/wireless/b43/debugfs.c
@@ -540,7 +540,7 @@ static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,
 		memset(buf, 0, bufsize);
 		ret = dfops->read(dev, buf, bufsize);
 		if (ret <= 0) {
-			free_pages((unsigned long)buf, buforder);
+			free_pages(buf, buforder);
 			err = ret;
 			goto out_unlock;
 		}
@@ -552,7 +552,7 @@ static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,
 				      dfile->buffer,
 				      dfile->data_len);
 	if (*ppos >= dfile->data_len) {
-		free_pages((unsigned long)dfile->buffer, buforder);
+		free_pages(dfile->buffer, buforder);
 		dfile->buffer = NULL;
 		dfile->data_len = 0;
 	}
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c
index 947a823..e243955 100644
--- a/drivers/net/wireless/b43legacy/debugfs.c
+++ b/drivers/net/wireless/b43legacy/debugfs.c
@@ -242,7 +242,7 @@ static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf,
 		} else
 			ret = dfops->read(dev, buf, bufsize);
 		if (ret <= 0) {
-			free_pages((unsigned long)buf, buforder);
+			free_pages(buf, buforder);
 			err = ret;
 			goto out_unlock;
 		}
@@ -254,7 +254,7 @@ static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf,
 				      dfile->buffer,
 				      dfile->data_len);
 	if (*ppos >= dfile->data_len) {
-		free_pages((unsigned long)dfile->buffer, buforder);
+		free_pages(dfile->buffer, buforder);
 		dfile->buffer = NULL;
 		dfile->data_len = 0;
 	}
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index ce52cf1..555bf02 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1504,7 +1504,7 @@ __il_free_pages(struct il_priv *il, struct page *page)
 static inline void
 il_free_pages(struct il_priv *il, unsigned long page)
 {
-	free_pages(page, il->hw_params.rx_page_order);
+	free_pages((void *)page, il->hw_params.rx_page_order);
 	il->alloc_rxb_page--;
 }
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 6f76525..8ccbda2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -342,7 +342,7 @@ struct iwl_host_cmd {
 
 static inline void iwl_free_resp(struct iwl_host_cmd *cmd)
 {
-	free_pages(cmd->_rx_page_addr, cmd->_rx_page_order);
+	free_pages((void *)cmd->_rx_page_addr, cmd->_rx_page_order);
 }
 
 struct iwl_rx_cmd_buffer {
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 25defe4..374adb1 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -6354,7 +6354,7 @@ err_dummy_packet:
 	dev_kfree_skb(wl->dummy_packet);
 
 err_aggr:
-	free_pages((unsigned long)wl->aggr_buf, order);
+	free_pages(wl->aggr_buf, order);
 
 err_wq:
 	destroy_workqueue(wl->freezable_wq);
@@ -6386,7 +6386,7 @@ int wlcore_free_hw(struct wl1271 *wl)
 	kfree(wl->mbox);
 	free_page(wl->fwlog);
 	dev_kfree_skb(wl->dummy_packet);
-	free_pages((unsigned long)wl->aggr_buf, get_order(wl->aggr_buf_size));
+	free_pages(wl->aggr_buf, get_order(wl->aggr_buf_size));
 
 	wl1271_debugfs_exit(wl);
 
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index 8e11fb2..b172617 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -871,7 +871,7 @@ ccio_free_consistent(struct device *dev, size_t size, void *cpu_addr,
 		     dma_addr_t dma_handle)
 {
 	ccio_unmap_single(dev, dma_handle, size, 0);
-	free_pages((unsigned long)cpu_addr, get_order(size));
+	free_pages(cpu_addr, get_order(size));
 }
 
 /*
diff --git a/drivers/parisc/ccio-rm-dma.c b/drivers/parisc/ccio-rm-dma.c
index f78f6f1..b9649c2 100644
--- a/drivers/parisc/ccio-rm-dma.c
+++ b/drivers/parisc/ccio-rm-dma.c
@@ -96,7 +96,7 @@ static void *ccio_alloc_consistent(struct pci_dev *dev, size_t size,
 static void ccio_free_consistent(struct pci_dev *dev, size_t size,
 			       void *vaddr, dma_addr_t handle)
 {
-	free_pages((unsigned long)vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 }
 
 static dma_addr_t ccio_map_single(struct pci_dev *dev, void *ptr, size_t size,
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 225049b..6066d4e 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -901,7 +901,7 @@ sba_free_consistent(struct device *hwdev, size_t size, void *vaddr,
 		    dma_addr_t dma_handle)
 {
 	sba_unmap_single(hwdev, dma_handle, size, 0);
-	free_pages((unsigned long) vaddr, get_order(size));
+	free_pages(vaddr, get_order(size));
 }
 
 
@@ -1156,14 +1156,14 @@ sba_alloc_pdir(unsigned int pdir_size)
 			/* allocate a new one on 512k alignment */
 			unsigned long new_pdir = __get_free_pages(GFP_KERNEL, (19-12));
 			/* release original */
-			free_pages(pdir_base, pdir_order);
+			free_pages((void *)pdir_base, pdir_order);
 
 			pdir_base = new_pdir;
 
 			/* release excess */
 			while (pdir_order < (19-12)) {
 				new_pdir += pdir_size;
-				free_pages(new_pdir, pdir_order);
+				free_pages((void *)new_pdir, pdir_order);
 				pdir_order +=1;
 				pdir_size <<=1;
 			}
@@ -1176,10 +1176,10 @@ sba_alloc_pdir(unsigned int pdir_size)
 		unsigned long new_pdir = __get_free_pages(GFP_KERNEL, pdir_order+1); /* 2 or 4MB */
 
 		/* release original */
-		free_pages( pdir_base, pdir_order);
+		free_pages((void *)pdir_base, pdir_order);
 
 		/* release first 1MB */
-		free_pages(new_pdir, 20-12);
+		free_pages((void *)new_pdir, 20-12);
 
 		pdir_base = new_pdir + 1024*1024;
 
@@ -1194,10 +1194,10 @@ sba_alloc_pdir(unsigned int pdir_size)
 
 			new_pdir += 3*1024*1024;
 			/* release last 1MB */
-			free_pages(new_pdir, 20-12);
+			free_pages((void *)new_pdir, 20-12);
 
 			/* release unusable 128KB */
-			free_pages(new_pdir - 128*1024 , 17-12);
+			free_pages((void *)new_pdir - 128*1024 , 17-12);
 
 			pdir_size -= 128*1024;
 		}
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 3018ae5..9ad90fd 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1347,7 +1347,7 @@ static int tegra_pcie_disable_msi(struct tegra_pcie *pcie)
 	afi_writel(pcie, 0, AFI_MSI_EN_VEC6);
 	afi_writel(pcie, 0, AFI_MSI_EN_VEC7);
 
-	free_pages(msi->pages, 0);
+	free_pages((void *)msi->pages, 0);
 
 	if (msi->irq > 0)
 		free_irq(msi->irq, pcie);
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index 3c7a0d5..a9438d2 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -527,7 +527,7 @@ static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port *port)
 	/* Free IRQ Domain */
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
 
-		free_pages(port->msi_pages, 0);
+		free_pages((void *)port->msi_pages, 0);
 
 		num_irqs = XILINX_NUM_MSI_IRQS;
 	} else {
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 5257c80..7b24131 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -104,7 +104,7 @@ struct dasd_device *dasd_alloc_device(void)
 	/* Get one page for error recovery. */
 	device->erp_mem = (void *) get_zeroed_page(GFP_ATOMIC | GFP_DMA);
 	if (!device->erp_mem) {
-		free_pages((unsigned long) device->ccw_mem, 1);
+		free_pages(device->ccw_mem, 1);
 		kfree(device);
 		return ERR_PTR(-ENOMEM);
 	}
@@ -137,7 +137,7 @@ void dasd_free_device(struct dasd_device *device)
 {
 	kfree(device->private);
 	free_page(device->erp_mem);
-	free_pages((unsigned long)device->ccw_mem, 1);
+	free_pages(device->ccw_mem, 1);
 	kfree(device);
 }
 
diff --git a/drivers/s390/char/hmcdrv_cache.c b/drivers/s390/char/hmcdrv_cache.c
index 4cda5ad..60a4233 100644
--- a/drivers/s390/char/hmcdrv_cache.c
+++ b/drivers/s390/char/hmcdrv_cache.c
@@ -240,7 +240,7 @@ int hmcdrv_cache_startup(size_t cachesize)
 void hmcdrv_cache_shutdown(void)
 {
 	if (hmcdrv_cache_file.content) {
-		free_pages((unsigned long) hmcdrv_cache_file.content,
+		free_pages(hmcdrv_cache_file.content,
 			   hmcdrv_cache_order);
 		hmcdrv_cache_file.content = NULL;
 	}
diff --git a/drivers/s390/char/hmcdrv_ftp.c b/drivers/s390/char/hmcdrv_ftp.c
index d8a07bb..c08e633 100644
--- a/drivers/s390/char/hmcdrv_ftp.c
+++ b/drivers/s390/char/hmcdrv_ftp.c
@@ -278,7 +278,7 @@ ssize_t hmcdrv_ftp_cmd(char __kernel *cmd, loff_t offset,
 		break;
 	}
 
-	free_pages((unsigned long) ftp.buf, order);
+	free_pages(ftp.buf, order);
 	return retlen;
 }
 
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index e96fc7f..bb61f97 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -728,7 +728,7 @@ out_write:
 	raw3270_request_free(tp->write);
 out_pages:
 	while (pages--)
-		free_pages((unsigned long) tp->freemem_pages[pages], 0);
+		free_pages(tp->freemem_pages[pages], 0);
 	kfree(tp->freemem_pages);
 	tty_port_destroy(&tp->port);
 out_tp:
@@ -750,7 +750,7 @@ tty3270_free_view(struct tty3270 *tp)
 	raw3270_request_free(tp->read);
 	raw3270_request_free(tp->write);
 	for (pages = 0; pages < TTY3270_STRING_PAGES; pages++)
-		free_pages((unsigned long) tp->freemem_pages[pages], 0);
+		free_pages(tp->freemem_pages[pages], 0);
 	kfree(tp->freemem_pages);
 	tty_port_destroy(&tp->port);
 	kfree(tp);
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index 0fdedad..f73bf6b 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -51,7 +51,7 @@ static int vmcp_release(struct inode *inode, struct file *file)
 
 	session = file->private_data;
 	file->private_data = NULL;
-	free_pages((unsigned long)session->response, get_order(session->bufsize));
+	free_pages(session->response, get_order(session->bufsize));
 	kfree(session);
 	return 0;
 }
@@ -151,8 +151,7 @@ static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		mutex_unlock(&session->mutex);
 		return put_user(temp, argp);
 	case VMCP_SETBUF:
-		free_pages((unsigned long)session->response,
-				get_order(session->bufsize));
+		free_pages(session->response, get_order(session->bufsize));
 		session->response=NULL;
 		temp = get_user(session->bufsize, argp);
 		if (get_order(session->bufsize) > 8) {
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c
index b2afad5..70356a3 100644
--- a/drivers/s390/cio/cmf.c
+++ b/drivers/s390/cio/cmf.c
@@ -578,7 +578,7 @@ static int alloc_cmb(struct ccw_device *cdev)
 
 		if (cmb_area.mem) {
 			/* ok, another thread was faster */
-			free_pages((unsigned long)mem, get_order(size));
+			free_pages(mem, get_order(size));
 		} else if (!mem) {
 			/* no luck */
 			ret = -ENOMEM;
@@ -622,7 +622,7 @@ static void free_cmb(struct ccw_device *cdev)
 		ssize_t size;
 		size = sizeof(struct cmb) * cmb_area.num_channels;
 		cmf_activate(NULL, 0);
-		free_pages((unsigned long)cmb_area.mem, get_order(size));
+		free_pages(cmb_area.mem, get_order(size));
 		cmb_area.mem = NULL;
 	}
 	spin_unlock_irq(cdev->ccwlock);
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index b91d769..d4d6e38 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -622,7 +622,7 @@ static void free_mem(struct cxlflash_cfg *cfg)
 				free_page(buf);
 		}
 
-		free_pages((ulong)afu, get_order(sizeof(struct afu)));
+		free_pages(afu, get_order(sizeof(struct afu)));
 		cfg->afu = NULL;
 	}
 }
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 6bffd91..d03ab52 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2962,7 +2962,7 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
 	iscsi_suspend_tx(conn);
 
 	spin_lock_bh(&session->frwd_lock);
-	free_pages((unsigned long) conn->data,
+	free_pages(conn->data,
 		   get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
 	kfree(conn->persistent_address);
 	kfree(conn->local_ipaddr);
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index db9446c..4d9457b 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -11476,14 +11476,14 @@ lpfc_exit(void)
 		printk(KERN_ERR	"9062 BLKGRD: freeing %lu pages for "
 				"_dump_buf_data at 0x%p\n",
 				(1L << _dump_buf_data_order), _dump_buf_data);
-		free_pages((unsigned long)_dump_buf_data, _dump_buf_data_order);
+		free_pages(_dump_buf_data, _dump_buf_data_order);
 	}
 
 	if (_dump_buf_dif) {
 		printk(KERN_ERR	"9049 BLKGRD: freeing %lu pages for "
 				"_dump_buf_dif at 0x%p\n",
 				(1L << _dump_buf_dif_order), _dump_buf_dif);
-		free_pages((unsigned long)_dump_buf_dif, _dump_buf_dif_order);
+		free_pages(_dump_buf_dif, _dump_buf_dif_order);
 	}
 	kfree(lpfc_used_cpu);
 	idr_destroy(&lpfc_hba_index);
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 97a1c1c..2c81ab3 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -5939,7 +5939,7 @@ static void megasas_detach_one(struct pci_dev *pdev)
 						  fusion->ld_map[i],
 						  fusion->ld_map_phys[i]);
 			if (fusion->ld_drv_map[i])
-				free_pages((ulong)fusion->ld_drv_map[i],
+				free_pages(fusion->ld_drv_map[i],
 					fusion->drv_map_pages);
 				if (fusion->pd_seq_sync)
 					dma_free_coherent(&instance->pdev->dev,
@@ -5947,7 +5947,7 @@ static void megasas_detach_one(struct pci_dev *pdev)
 						fusion->pd_seq_sync[i],
 						fusion->pd_seq_phys[i]);
 		}
-		free_pages((ulong)instance->ctrl_context,
+		free_pages(instance->ctrl_context,
 			instance->ctrl_context_pages);
 	} else {
 		megasas_release_mfi(instance);
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 8d630a5..6429914 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -1193,7 +1193,7 @@ megasas_init_adapter_fusion(struct megasas_instance *instance)
 				"memory for local map info for %d pages\n",
 				fusion->drv_map_pages);
 			if (i == 1)
-				free_pages((ulong)fusion->ld_drv_map[0],
+				free_pages(fusion->ld_drv_map[0],
 					fusion->drv_map_pages);
 			goto fail_ioc_init;
 		}
@@ -2486,7 +2486,7 @@ megasas_free_host_crash_buffer(struct megasas_instance *instance)
 ;
 	for (i = 0; i < instance->drv_buf_alloc; i++) {
 		if (instance->crash_buf[i])
-			free_pages((ulong)instance->crash_buf[i],
+			free_pages(instance->crash_buf[i],
 					instance->crash_buf_pages);
 	}
 	instance->drv_buf_index = 0;
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 11393eb..0d73ea3 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -3115,7 +3115,7 @@ _base_release_memory_pools(struct MPT3SAS_ADAPTER *ioc)
 	}
 
 	if (ioc->scsi_lookup) {
-		free_pages((ulong)ioc->scsi_lookup, ioc->scsi_lookup_pages);
+		free_pages(ioc->scsi_lookup, ioc->scsi_lookup_pages);
 		ioc->scsi_lookup = NULL;
 	}
 	kfree(ioc->hpr_lookup);
@@ -3129,7 +3129,7 @@ _base_release_memory_pools(struct MPT3SAS_ADAPTER *ioc)
 		}
 		if (ioc->chain_dma_pool)
 			pci_pool_destroy(ioc->chain_dma_pool);
-		free_pages((ulong)ioc->chain_lookup, ioc->chain_pages);
+		free_pages(ioc->chain_lookup, ioc->chain_pages);
 		ioc->chain_lookup = NULL;
 	}
 }
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
index 5b93ed8..1c3f5a0 100644
--- a/drivers/scsi/ncr53c8xx.c
+++ b/drivers/scsi/ncr53c8xx.c
@@ -366,7 +366,7 @@ static m_addr_t ___mp0_getp(m_pool_s *mp)
 
 static void ___mp0_freep(m_pool_s *mp, m_addr_t m)
 {
-	free_pages(m, MEMO_PAGE_ORDER);
+	free_pages((void *)m, MEMO_PAGE_ORDER);
 	--mp->nump;
 }
 
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.h b/drivers/scsi/sym53c8xx_2/sym_hipd.h
index a141b17..45f9ac2 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.h
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.h
@@ -1125,7 +1125,7 @@ bad:
 #define sym_get_mem_cluster()	\
 	(void *) __get_free_pages(GFP_ATOMIC, SYM_MEM_PAGE_ORDER)
 #define sym_free_mem_cluster(p)	\
-	free_pages((unsigned long)p, SYM_MEM_PAGE_ORDER)
+	free_pages(p, SYM_MEM_PAGE_ORDER)
 
 /*
  *  Link between free memory chunks of a given size.
diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index 0f133c1..7921fc8 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -1159,7 +1159,7 @@ static void pvscsi_free_sgls(const struct pvscsi_adapter *adapter)
 	unsigned i;
 
 	for (i = 0; i < adapter->req_depth; ++i, ++ctx)
-		free_pages((unsigned long)ctx->sgl, get_order(SGL_SIZE));
+		free_pages(ctx->sgl, get_order(SGL_SIZE));
 }
 
 static int pvscsi_setup_msix(const struct pvscsi_adapter *adapter,
@@ -1257,8 +1257,7 @@ static int pvscsi_allocate_sg(struct pvscsi_adapter *adapter)
 		BUG_ON(!IS_ALIGNED(((unsigned long)ctx->sgl), PAGE_SIZE));
 		if (!ctx->sgl) {
 			for (; i >= 0; --i, --ctx) {
-				free_pages((unsigned long)ctx->sgl,
-					   get_order(SGL_SIZE));
+				free_pages(ctx->sgl, get_order(SGL_SIZE));
 				ctx->sgl = NULL;
 			}
 			return -ENOMEM;
diff --git a/drivers/sh/maple/maple.c b/drivers/sh/maple/maple.c
index bec81c2..84fa4f7 100644
--- a/drivers/sh/maple/maple.c
+++ b/drivers/sh/maple/maple.c
@@ -874,7 +874,7 @@ cleanup_irq:
 	free_irq(HW_EVENT_MAPLE_DMA, 0);
 
 cleanup_dma:
-	free_pages((unsigned long) maple_sendbuf, MAPLE_DMA_PAGES);
+	free_pages(maple_sendbuf, MAPLE_DMA_PAGES);
 
 cleanup_basic:
 	driver_unregister(&maple_unsupported_device.drv);
diff --git a/drivers/staging/rdma/ehca/ehca_mrmw.c b/drivers/staging/rdma/ehca/ehca_mrmw.c
index f914b30..8bc19ca 100644
--- a/drivers/staging/rdma/ehca/ehca_mrmw.c
+++ b/drivers/staging/rdma/ehca/ehca_mrmw.c
@@ -2560,7 +2560,7 @@ static void *ehca_dma_alloc_coherent(struct ib_device *dev, size_t size,
 		addr = page_address(p);
 		dma_addr = ehca_map_vaddr(addr);
 		if (ehca_dma_mapping_error(dev, dma_addr)) {
-			free_pages((unsigned long)addr,	get_order(size));
+			free_pages(addr,	get_order(size));
 			return NULL;
 		}
 		if (dma_handle)
@@ -2574,7 +2574,7 @@ static void ehca_dma_free_coherent(struct ib_device *dev, size_t size,
 				   void *cpu_addr, u64 dma_handle)
 {
 	if (cpu_addr && size)
-		free_pages((unsigned long)cpu_addr, get_order(size));
+		free_pages(cpu_addr, get_order(size));
 }
 
 
diff --git a/drivers/staging/rdma/hfi1/dma.c b/drivers/staging/rdma/hfi1/dma.c
index e03bd73..2ba5ce4 100644
--- a/drivers/staging/rdma/hfi1/dma.c
+++ b/drivers/staging/rdma/hfi1/dma.c
@@ -168,7 +168,7 @@ static void *hfi1_dma_alloc_coherent(struct ib_device *dev, size_t size,
 static void hfi1_dma_free_coherent(struct ib_device *dev, size_t size,
 				   void *cpu_addr, u64 dma_handle)
 {
-	free_pages((unsigned long) cpu_addr, get_order(size));
+	free_pages(cpu_addr, get_order(size));
 }
 
 struct ib_dma_mapping_ops hfi1_dma_mapping_ops = {
diff --git a/drivers/staging/rdma/ipath/ipath_dma.c b/drivers/staging/rdma/ipath/ipath_dma.c
index 123a8c0..e363f70 100644
--- a/drivers/staging/rdma/ipath/ipath_dma.c
+++ b/drivers/staging/rdma/ipath/ipath_dma.c
@@ -161,7 +161,7 @@ static void *ipath_dma_alloc_coherent(struct ib_device *dev, size_t size,
 static void ipath_dma_free_coherent(struct ib_device *dev, size_t size,
 				    void *cpu_addr, u64 dma_handle)
 {
-	free_pages((unsigned long) cpu_addr, get_order(size));
+	free_pages(cpu_addr, get_order(size));
 }
 
 struct ib_dma_mapping_ops ipath_dma_mapping_ops = {
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index 2a3bbdf..b741639 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -583,7 +583,7 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes,
 		if (length > *nbytes)
 			length = *nbytes;
 		if (copy_to_user(*buffer, pages_start + *skip_bytes, length)) {
-			free_pages((unsigned long)pages_start, 1);
+			free_pages(pages_start, 1);
 			return -EFAULT;
 		}
 		*nbytes -= length;
@@ -594,7 +594,7 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes,
 	} else
 		*skip_bytes -= length;
 
-	free_pages((unsigned long)pages_start, 1);
+	free_pages(pages_start, 1);
 
 	/* Now look at all of this device's children. */
 	usb_hub_for_each_child(usbdev, chix, childdev) {
diff --git a/drivers/video/fbdev/vermilion/vermilion.c b/drivers/video/fbdev/vermilion/vermilion.c
index 1c1e95a..0882f41 100644
--- a/drivers/video/fbdev/vermilion/vermilion.c
+++ b/drivers/video/fbdev/vermilion/vermilion.c
@@ -167,7 +167,7 @@ static void vmlfb_free_vram_area(struct vram_area *va)
 		printk(KERN_DEBUG MODULE_NAME
 		       ": Freeing %ld bytes vram area at 0x%08lx\n",
 		       va->size, va->phys);
-		free_pages(va->logical, va->order);
+		free_pages((void *)va->logical, va->order);
 
 		va->logical = 0;
 	}
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 7399782..fa6b56e 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -261,7 +261,7 @@ retry:
 		if (early)
 			free_bootmem(__pa(xen_io_tlb_start), PAGE_ALIGN(bytes));
 		else {
-			free_pages((unsigned long)xen_io_tlb_start, order);
+			free_pages(xen_io_tlb_start, order);
 			xen_io_tlb_start = NULL;
 		}
 		m_ret = XEN_SWIOTLB_EFIXUP;
@@ -288,7 +288,7 @@ error:
 	if (early)
 		panic("%s (rc:%d)", xen_swiotlb_error(m_ret), rc);
 	else
-		free_pages((unsigned long)xen_io_tlb_start, order);
+		free_pages(xen_io_tlb_start, order);
 	return rc;
 }
 void *
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index e7b130a..40c9ef6 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -339,7 +339,7 @@ static void destroy_reply_info(struct ceph_mds_reply_info_parsed *info)
 {
 	if (!info->dir_in)
 		return;
-	free_pages((unsigned long)info->dir_in, get_order(info->dir_buf_size));
+	free_pages(info->dir_in, get_order(info->dir_buf_size));
 }
 
 
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 80d6901..cf53226 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1233,7 +1233,7 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry,
 		goto out_free;
 	}
 out_free:
-	free_pages((unsigned long)virt, order);
+	free_pages(virt, order);
 out:
 	return rc;
 }
diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c
index aa3f0d6..92f1730 100644
--- a/fs/hfs/mdb.c
+++ b/fs/hfs/mdb.c
@@ -360,7 +360,7 @@ void hfs_mdb_put(struct super_block *sb)
 	unload_nls(HFS_SB(sb)->nls_io);
 	unload_nls(HFS_SB(sb)->nls_disk);
 
-	free_pages((unsigned long)HFS_SB(sb)->bitmap, PAGE_SIZE < 8192 ? 1 : 0);
+	free_pages(HFS_SB(sb)->bitmap, PAGE_SIZE < 8192 ? 1 : 0);
 	kfree(HFS_SB(sb));
 	sb->s_fs_info = NULL;
 }
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 81e6226..450a30b 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2322,14 +2322,14 @@ void *jbd2_alloc(size_t size, gfp_t flags)
 void jbd2_free(void *ptr, size_t size)
 {
 	if (size == PAGE_SIZE) {
-		free_pages((unsigned long)ptr, 0);
+		free_pages(ptr, 0);
 		return;
 	}
 	if (size > PAGE_SIZE) {
 		int order = get_order(size);
 
 		if (order < 3)
-			free_pages((unsigned long)ptr, order);
+			free_pages(ptr, order);
 		else
 			vfree(ptr);
 		return;
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index aba4381..09d2ede 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -122,7 +122,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
 	}
 	argv->v_nmembs = total;
 
-	free_pages((unsigned long)buf, 0);
+	free_pages(buf, 0);
 	return ret;
 }
 
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 4e61388..dd6566c 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -990,7 +990,7 @@ static void __init set_vmcore_list_offsets(size_t elfsz, size_t elfnotes_sz,
 
 static void free_elfcorebuf(void)
 {
-	free_pages((unsigned long)elfcorebuf, get_order(elfcorebuf_sz_orig));
+	free_pages(elfcorebuf, get_order(elfcorebuf_sz_orig));
 	elfcorebuf = NULL;
 	vfree(elfnotes_buf);
 	elfnotes_buf = NULL;
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 54c6efd..df5c0a0 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -487,7 +487,7 @@ void * __meminit alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask);
 		__get_free_pages((gfp_mask) | GFP_DMA, (order))
 
 extern void __free_pages(struct page *page, unsigned int order);
-extern void free_pages(unsigned long addr, unsigned int order);
+extern void free_pages(const void *addr, unsigned int order);
 extern void free_hot_cold_page(struct page *page, bool cold);
 extern void free_hot_cold_page_list(struct list_head *list, bool cold);
 
@@ -500,7 +500,7 @@ extern void __free_kmem_pages(struct page *page, unsigned int order);
 extern void free_kmem_pages(unsigned long addr, unsigned int order);
 
 #define __free_page(page) __free_pages((page), 0)
-#define free_page(addr) free_pages((unsigned long)(addr), 0)
+#define free_page(addr) free_pages((addr), 0)
 
 void page_alloc_init(void);
 void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 14703bb..b995e08 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2985,7 +2985,7 @@ ftrace_allocate_pages(unsigned long num_to_init)
 	pg = start_pg;
 	while (pg) {
 		order = get_count_order(pg->size / ENTRIES_PER_PAGE);
-		free_pages((unsigned long)pg->records, order);
+		free_pages(pg->records, order);
 		start_pg = pg->next;
 		kfree(pg);
 		pg = start_pg;
@@ -4931,7 +4931,7 @@ void ftrace_release_mod(struct module *mod)
 
 			*last_pg = pg->next;
 			order = get_count_order(pg->size / ENTRIES_PER_PAGE);
-			free_pages((unsigned long)pg->records, order);
+			free_pages(pg->records, order);
 			kfree(pg);
 		} else
 			last_pg = &pg->next;
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index f2e26df..5d06111 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -600,7 +600,7 @@ static void __ftrace_clear_event_pids(struct trace_array *tr)
 	/* Wait till all users are no longer using pid filtering */
 	synchronize_sched();
 
-	free_pages((unsigned long)pid_list->pids, pid_list->order);
+	free_pages(pid_list->pids, pid_list->order);
 	kfree(pid_list);
 }
 
@@ -1662,7 +1662,7 @@ ftrace_event_pid_write(struct file *filp, const char __user *ubuf,
 				break;
 			memcpy(pid_page, pid_list->pids,
 			       pid_list->nr_pids * sizeof(pid_t));
-			free_pages((unsigned long)pid_list->pids, pid_list->order);
+			free_pages(pid_list->pids, pid_list->order);
 
 			pid_list->order++;
 			pid_list->pids = pid_page;
@@ -1676,7 +1676,7 @@ ftrace_event_pid_write(struct file *filp, const char __user *ubuf,
 
 	if (ret < 0) {
 		if (pid_list)
-			free_pages((unsigned long)pid_list->pids, pid_list->order);
+			free_pages(pid_list->pids, pid_list->order);
 		kfree(pid_list);
 		mutex_unlock(&event_mutex);
 		return ret;
@@ -1717,7 +1717,7 @@ ftrace_event_pid_write(struct file *filp, const char __user *ubuf,
 	if (filtered_pids) {
 		synchronize_sched();
 
-		free_pages((unsigned long)filtered_pids->pids, filtered_pids->order);
+		free_pages(filtered_pids->pids, filtered_pids->order);
 		kfree(filtered_pids);
 	} else {
 		/*
diff --git a/lib/percpu_ida.c b/lib/percpu_ida.c
index 6d40944..d58f5a9 100644
--- a/lib/percpu_ida.c
+++ b/lib/percpu_ida.c
@@ -266,7 +266,7 @@ EXPORT_SYMBOL_GPL(percpu_ida_free);
 void percpu_ida_destroy(struct percpu_ida *pool)
 {
 	free_percpu(pool->tag_cpu);
-	free_pages((unsigned long) pool->freelist,
+	free_pages(pool->freelist,
 		   get_order(pool->nr_tags * sizeof(unsigned)));
 }
 EXPORT_SYMBOL_GPL(percpu_ida_destroy);
diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c
index 975c6e0..3d8cf31 100644
--- a/lib/raid6/algos.c
+++ b/lib/raid6/algos.c
@@ -234,7 +234,7 @@ int __init raid6_select_algo(void)
 	/* select raid recover functions */
 	rec_best = raid6_choose_recov();
 
-	free_pages((unsigned long)syndromes, 1);
+	free_pages(syndromes, 1);
 
 	return gen_best && rec_best ? 0 : -EINVAL;
 }
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 76f29ec..87e33e7 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -278,7 +278,7 @@ swiotlb_late_init_with_default_size(size_t default_size)
 	}
 	rc = swiotlb_late_init_with_tbl(vstart, io_tlb_nslabs);
 	if (rc)
-		free_pages((unsigned long)vstart, order);
+		free_pages(vstart, order);
 	return rc;
 }
 
@@ -336,12 +336,10 @@ swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs)
 	return 0;
 
 cleanup4:
-	free_pages((unsigned long)io_tlb_list, get_order(io_tlb_nslabs *
-	                                                 sizeof(int)));
+	free_pages(io_tlb_list, get_order(io_tlb_nslabs * sizeof(int)));
 	io_tlb_list = NULL;
 cleanup3:
-	free_pages((unsigned long)v_overflow_buffer,
-		   get_order(io_tlb_overflow));
+	free_pages(v_overflow_buffer, get_order(io_tlb_overflow));
 	io_tlb_overflow_buffer = 0;
 cleanup2:
 	io_tlb_end = 0;
@@ -356,13 +354,12 @@ void __init swiotlb_free(void)
 		return;
 
 	if (late_alloc) {
-		free_pages((unsigned long)phys_to_virt(io_tlb_overflow_buffer),
+		free_pages(phys_to_virt(io_tlb_overflow_buffer),
 			   get_order(io_tlb_overflow));
-		free_pages((unsigned long)io_tlb_orig_addr,
+		free_pages(io_tlb_orig_addr,
 			   get_order(io_tlb_nslabs * sizeof(phys_addr_t)));
-		free_pages((unsigned long)io_tlb_list, get_order(io_tlb_nslabs *
-								 sizeof(int)));
-		free_pages((unsigned long)phys_to_virt(io_tlb_start),
+		free_pages(io_tlb_list, get_order(io_tlb_nslabs * sizeof(int)));
+		free_pages(phys_to_virt(io_tlb_start),
 			   get_order(io_tlb_nslabs << IO_TLB_SHIFT));
 	} else {
 		memblock_free_late(io_tlb_overflow_buffer,
@@ -644,7 +641,7 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
 			/*
 			 * The allocated memory isn't reachable by the device.
 			 */
-			free_pages((unsigned long) ret, order);
+			free_pages(ret, order);
 			ret = NULL;
 		}
 	}
@@ -696,7 +693,7 @@ swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
 
 	WARN_ON(irqs_disabled());
 	if (!is_swiotlb_buffer(paddr))
-		free_pages((unsigned long)vaddr, get_order(size));
+		free_pages(vaddr, get_order(size));
 	else
 		/* DMA_TO_DEVICE to avoid memcpy in swiotlb_tbl_unmap_single */
 		swiotlb_tbl_unmap_single(hwdev, paddr, size, DMA_TO_DEVICE);
diff --git a/mm/memory.c b/mm/memory.c
index 47f8f87..8364c20 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -279,7 +279,7 @@ void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long e
 
 	for (batch = tlb->local.next; batch; batch = next) {
 		next = batch->next;
-		free_pages((unsigned long)batch, 0);
+		free_pages(batch, 0);
 	}
 	tlb->local.next = NULL;
 }
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e68689c..11014f3 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3292,11 +3292,11 @@ void __free_pages(struct page *page, unsigned int order)
 
 EXPORT_SYMBOL(__free_pages);
 
-void free_pages(unsigned long addr, unsigned int order)
+void free_pages(const void *addr, unsigned int order)
 {
-	if (addr != 0) {
-		VM_BUG_ON(!virt_addr_valid((void *)addr));
-		__free_pages(virt_to_page((void *)addr), order);
+	if (addr) {
+		VM_BUG_ON(!virt_addr_valid(addr));
+		__free_pages(virt_to_page(addr), order);
 	}
 }
 
diff --git a/mm/slob.c b/mm/slob.c
index 17e8f8c..d6430e8 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -208,7 +208,7 @@ static void slob_free_pages(void *b, int order)
 {
 	if (current->reclaim_state)
 		current->reclaim_state->reclaimed_slab += 1 << order;
-	free_pages((unsigned long)b, order);
+	free_pages(b, order);
 }
 
 /*
diff --git a/mm/slub.c b/mm/slub.c
index b50b454..5da985fe 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4196,8 +4196,7 @@ struct loc_track {
 static void free_loc_track(struct loc_track *t)
 {
 	if (t->max)
-		free_pages((unsigned long)t->loc,
-			get_order(sizeof(struct location) * t->max));
+		free_pages(t->loc, get_order(sizeof(struct location) * t->max));
 }
 
 static int alloc_loc_track(struct loc_track *t, unsigned long max, gfp_t flags)
diff --git a/mm/sparse.c b/mm/sparse.c
index d1b48b6..109258a 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -648,7 +648,7 @@ static void __kfree_section_memmap(struct page *memmap)
 	if (is_vmalloc_addr(memmap))
 		vfree(memmap);
 	else
-		free_pages((unsigned long)memmap,
+		free_pages(memmap,
 			   get_order(sizeof(struct page) * PAGES_PER_SECTION));
 }
 
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index f18ae91..6eb5170 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -352,7 +352,7 @@ static void neigh_hash_free_rcu(struct rcu_head *head)
 	if (size <= PAGE_SIZE)
 		kfree(buckets);
 	else
-		free_pages((unsigned long)buckets, get_order(size));
+		free_pages(buckets, get_order(size));
 	kfree(nht);
 }
 
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 41e6580..b689ca8 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -1211,11 +1211,11 @@ out_ackvec_exit:
 out_free_dccp_mib:
 	dccp_mib_exit();
 out_free_dccp_bhash:
-	free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order);
+	free_pages(dccp_hashinfo.bhash, bhash_order);
 out_free_dccp_locks:
 	inet_ehash_locks_free(&dccp_hashinfo);
 out_free_dccp_ehash:
-	free_pages((unsigned long)dccp_hashinfo.ehash, ehash_order);
+	free_pages(dccp_hashinfo.ehash, ehash_order);
 out_free_bind_bucket_cachep:
 	kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep);
 out_free_percpu:
@@ -1231,10 +1231,10 @@ static void __exit dccp_fini(void)
 {
 	ccid_cleanup_builtins();
 	dccp_mib_exit();
-	free_pages((unsigned long)dccp_hashinfo.bhash,
+	free_pages(dccp_hashinfo.bhash,
 		   get_order(dccp_hashinfo.bhash_size *
 			     sizeof(struct inet_bind_hashbucket)));
-	free_pages((unsigned long)dccp_hashinfo.ehash,
+	free_pages(dccp_hashinfo.ehash,
 		   get_order((dccp_hashinfo.ehash_mask + 1) *
 			     sizeof(struct inet_ehash_bucket)));
 	inet_ehash_locks_free(&dccp_hashinfo);
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index d97268e..f69b6d9 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -853,7 +853,7 @@ static void fib_info_hash_free(struct hlist_head *hash, int bytes)
 	if (bytes <= PAGE_SIZE)
 		kfree(hash);
 	else
-		free_pages((unsigned long) hash, get_order(bytes));
+		free_pages(hash, get_order(bytes));
 }
 
 static void fib_info_hash_move(struct hlist_head *new_info_hash,
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 3cb3cb8..5a80da65 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1444,8 +1444,7 @@ void nf_ct_free_hashtable(void *hash, unsigned int size)
 	if (is_vmalloc_addr(hash))
 		vfree(hash);
 	else
-		free_pages((unsigned long)hash,
-			   get_order(sizeof(struct hlist_head) * size));
+		free_pages(hash, get_order(sizeof(struct hlist_head) * size));
 }
 EXPORT_SYMBOL_GPL(nf_ct_free_hashtable);
 
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 59651af..da6fba6 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -328,7 +328,7 @@ static void free_pg_vec(void **pg_vec, unsigned int order, unsigned int len)
 			if (is_vmalloc_addr(pg_vec[i]))
 				vfree(pg_vec[i]);
 			else
-				free_pages((unsigned long)pg_vec[i], order);
+				free_pages(pg_vec[i], order);
 		}
 	}
 	kfree(pg_vec);
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 992396a..fae2812 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4000,8 +4000,7 @@ static void free_pg_vec(struct pgv *pg_vec, unsigned int order,
 			if (is_vmalloc_addr(pg_vec[i].buffer))
 				vfree(pg_vec[i].buffer);
 			else
-				free_pages((unsigned long)pg_vec[i].buffer,
-					   order);
+				free_pages(pg_vec[i].buffer, order);
 			pg_vec[i].buffer = NULL;
 		}
 	}
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 7ec667d..1c9ff0b 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -645,7 +645,7 @@ static void qdisc_class_hash_free(struct hlist_head *h, unsigned int n)
 	if (size <= PAGE_SIZE)
 		kfree(h);
 	else
-		free_pages((unsigned long)h, get_order(size));
+		free_pages(h, get_order(size));
 }
 
 void qdisc_class_hash_grow(struct Qdisc *sch, struct Qdisc_class_hash *clhash)
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 3d9ea9a..8dfdd0e 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1514,13 +1514,13 @@ err_register_defaults:
 	sctp_v4_pf_exit();
 	sctp_v6_pf_exit();
 	sctp_sysctl_unregister();
-	free_pages((unsigned long)sctp_port_hashtable,
+	free_pages(sctp_port_hashtable,
 		   get_order(sctp_port_hashsize *
 			     sizeof(struct sctp_bind_hashbucket)));
 err_bhash_alloc:
 	kfree(sctp_ep_hashtable);
 err_ehash_alloc:
-	free_pages((unsigned long)sctp_assoc_hashtable,
+	free_pages(sctp_assoc_hashtable,
 		   get_order(sctp_assoc_hashsize *
 			     sizeof(struct sctp_hashbucket)));
 err_ahash_alloc:
@@ -1557,11 +1557,11 @@ static __exit void sctp_exit(void)
 
 	sctp_sysctl_unregister();
 
-	free_pages((unsigned long)sctp_assoc_hashtable,
+	free_pages(sctp_assoc_hashtable,
 		   get_order(sctp_assoc_hashsize *
 			     sizeof(struct sctp_hashbucket)));
 	kfree(sctp_ep_hashtable);
-	free_pages((unsigned long)sctp_port_hashtable,
+	free_pages(sctp_port_hashtable,
 		   get_order(sctp_port_hashsize *
 			     sizeof(struct sctp_bind_hashbucket)));
 
diff --git a/net/sctp/ssnmap.c b/net/sctp/ssnmap.c
index b9c8521..97b1939 100644
--- a/net/sctp/ssnmap.c
+++ b/net/sctp/ssnmap.c
@@ -75,7 +75,7 @@ fail_map:
 	if (size <= KMALLOC_MAX_SIZE)
 		kfree(retval);
 	else
-		free_pages((unsigned long)retval, get_order(size));
+		free_pages(retval, get_order(size));
 fail:
 	return NULL;
 }
@@ -119,7 +119,7 @@ void sctp_ssnmap_free(struct sctp_ssnmap *map)
 	if (size <= KMALLOC_MAX_SIZE)
 		kfree(map);
 	else
-		free_pages((unsigned long)map, get_order(size));
+		free_pages(map, get_order(size));
 
 	SCTP_DBG_OBJCNT_DEC(ssnmap);
 }
diff --git a/net/xfrm/xfrm_hash.c b/net/xfrm/xfrm_hash.c
index 1e98bc0..f19872e 100644
--- a/net/xfrm/xfrm_hash.c
+++ b/net/xfrm/xfrm_hash.c
@@ -35,5 +35,5 @@ void xfrm_hash_free(struct hlist_head *n, unsigned int sz)
 	else if (hashdist)
 		vfree(n);
 	else
-		free_pages((unsigned long)n, get_order(sz));
+		free_pages(n, get_order(sz));
 }
diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c
index 6eb6293..96f416c 100644
--- a/security/integrity/ima/ima_crypto.c
+++ b/security/integrity/ima/ima_crypto.c
@@ -165,7 +165,7 @@ static void ima_free_pages(void *ptr, size_t size)
 {
 	if (!ptr)
 		return;
-	free_pages((unsigned long)ptr, get_order(size));
+	free_pages(ptr, get_order(size));
 }
 
 static struct crypto_ahash *ima_alloc_atfm(enum hash_algo algo)
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index f05cb6a..43ac8b5 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -69,7 +69,7 @@ void snd_free_pages(void *ptr, size_t size)
 	if (ptr == NULL)
 		return;
 	pg = get_order(size);
-	free_pages((unsigned long) ptr, pg);
+	free_pages(ptr, pg);
 }
 
 /*
diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c
index e3f2913..457755a 100644
--- a/sound/oss/dmabuf.c
+++ b/sound/oss/dmabuf.c
@@ -141,7 +141,7 @@ static void sound_free_dmap(struct dma_buffparms *dmap)
 		ClearPageReserved(page);
 
 	dma_unmap_single(NULL, dmap->raw_buf_phys, dmap->buffsize, DMA_BIDIRECTIONAL);
-	free_pages((unsigned long) dmap->raw_buf, sz);
+	free_pages(dmap->raw_buf, sz);
 	dmap->raw_buf = NULL;
 }
 
diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c
index bf618e1..c423951 100644
--- a/sound/usb/usx2y/usb_stream.c
+++ b/sound/usb/usx2y/usb_stream.c
@@ -143,9 +143,9 @@ void usb_stream_free(struct usb_stream_kernel *sk)
 	if (!s)
 		return;
 
-	free_pages((unsigned long)sk->write_page, get_order(s->write_size));
+	free_pages(sk->write_page, get_order(s->write_size));
 	sk->write_page = NULL;
-	free_pages((unsigned long)s, get_order(s->read_size));
+	free_pages(s, get_order(s->read_size));
 	sk->s = NULL;
 }
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ