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-60-git-send-email-viro@ZenIV.linux.org.uk>
Date:	Mon, 21 Dec 2015 23:47:33 +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 60/83] switch obvious cases to get_free_pages()

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                      |  2 +-
 arch/arc/include/asm/pgalloc.h                     |  6 +++---
 arch/arm/include/asm/tlb.h                         |  4 ++--
 arch/arm/kvm/mmu.c                                 |  4 ++--
 arch/arm/mm/pgd.c                                  |  2 +-
 arch/blackfin/include/asm/mmu_context.h            |  4 ++--
 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                    | 10 ++++------
 arch/ia64/include/asm/agp.h                        |  2 +-
 arch/ia64/include/asm/tlb.h                        |  4 ++--
 arch/ia64/kernel/mca.c                             |  3 +--
 arch/ia64/sn/pci/pci_dma.c                         |  2 +-
 arch/m68k/kernel/dma.c                             |  2 +-
 arch/microblaze/include/asm/pgalloc.h              |  2 +-
 arch/microblaze/mm/consistent.c                    |  2 +-
 arch/mips/include/asm/pgalloc.h                    |  6 +++---
 arch/mips/jazz/jazzdma.c                           |  3 +--
 arch/mips/mm/dma-default.c                         |  2 +-
 arch/nios2/include/asm/pgalloc.h                   |  2 +-
 arch/nios2/mm/dma-mapping.c                        |  2 +-
 arch/nios2/mm/pgtable.c                            |  2 +-
 arch/parisc/include/asm/agp.h                      |  2 +-
 arch/parisc/include/asm/pgalloc.h                  |  6 ++----
 arch/parisc/kernel/pci-dma.c                       |  5 ++---
 arch/powerpc/include/asm/agp.h                     |  2 +-
 arch/powerpc/kernel/fadump.c                       |  2 +-
 arch/powerpc/kvm/book3s_64_mmu_hv.c                |  2 +-
 arch/powerpc/mm/pgtable_32.c                       |  2 +-
 arch/powerpc/platforms/cell/spufs/inode.c          |  2 +-
 arch/s390/hypfs/hypfs_diag.c                       |  2 +-
 arch/s390/include/asm/idals.h                      |  3 +--
 arch/s390/kernel/smp.c                             |  3 +--
 arch/s390/mm/vmem.c                                |  2 +-
 arch/s390/pci/pci_clp.c                            |  2 +-
 arch/score/include/asm/pgalloc.h                   |  4 ++--
 arch/sh/mm/consistent.c                            |  2 +-
 arch/sparc/include/asm/agp.h                       |  2 +-
 arch/sparc/kernel/ioport.c                         |  4 ++--
 arch/sparc/kernel/irq_64.c                         |  3 +--
 arch/sparc/kernel/ldc.c                            |  5 ++---
 arch/sparc/kernel/pci_fire.c                       |  2 +-
 arch/sparc/kernel/pci_sun4v.c                      |  2 +-
 arch/sparc/kernel/traps_64.c                       |  3 +--
 arch/um/drivers/net_kern.c                         |  2 +-
 arch/um/kernel/process.c                           |  2 +-
 arch/unicore32/mm/pgd.c                            |  2 +-
 arch/x86/include/asm/agp.h                         |  2 +-
 arch/x86/include/asm/xen/page-coherent.h           |  2 +-
 arch/x86/kernel/amd_gart_64.c                      |  4 ++--
 arch/x86/kernel/pci-calgary_64.c                   |  2 +-
 arch/x86/mm/init.c                                 |  2 +-
 arch/x86/platform/efi/efi.c                        |  2 +-
 arch/x86/um/ldt.c                                  |  3 +--
 arch/xtensa/include/asm/pgalloc.h                  |  2 +-
 crypto/xor.c                                       |  2 +-
 drivers/base/devres.c                              |  2 +-
 drivers/block/ps3vram.c                            |  3 +--
 drivers/block/xen-blkfront.c                       |  3 +--
 drivers/block/zram/zcomp.c                         |  2 +-
 drivers/char/agp/hp-agp.c                          |  2 +-
 drivers/char/agp/uninorth-agp.c                    |  2 +-
 drivers/crypto/atmel-aes.c                         |  4 ++--
 drivers/crypto/atmel-tdes.c                        |  4 ++--
 drivers/crypto/nx/nx-842.c                         |  4 ++--
 drivers/crypto/omap-aes.c                          |  4 ++--
 drivers/crypto/omap-des.c                          |  4 ++--
 drivers/dma/ste_dma40.c                            |  2 +-
 drivers/firmware/dell_rbu.c                        |  6 ++----
 drivers/gpu/drm/amd/amdkfd/kfd_events.c            |  2 +-
 drivers/hv/channel.c                               |  6 +++---
 drivers/hv/connection.c                            |  7 +++----
 drivers/iommu/amd_iommu_init.c                     | 16 ++++++++--------
 drivers/iommu/exynos-iommu.c                       |  4 ++--
 drivers/iommu/msm_iommu.c                          |  8 +++-----
 drivers/irqchip/irq-gic-v3-its.c                   |  2 +-
 drivers/md/bcache/bset.c                           |  8 ++++----
 drivers/md/bcache/btree.c                          |  3 +--
 drivers/md/bcache/journal.c                        |  4 ++--
 drivers/md/bcache/super.c                          |  2 +-
 drivers/md/dm-bufio.c                              |  3 +--
 drivers/media/pci/solo6x10/solo6x10-p2m.c          |  4 ++--
 drivers/media/platform/davinci/dm644x_ccdc.c       |  3 +--
 drivers/misc/cxl/native.c                          |  4 ++--
 drivers/misc/mic/card/mic_virtio.c                 |  2 +-
 drivers/misc/mic/host/mic_virtio.c                 |  5 ++---
 drivers/misc/mic/scif/scif_rma.h                   |  2 +-
 drivers/net/ethernet/cavium/liquidio/octeon_main.h |  4 +---
 drivers/net/ethernet/sgi/ioc3-eth.c                |  2 +-
 drivers/net/irda/au1k_ir.c                         |  2 +-
 drivers/net/rionet.c                               |  2 +-
 drivers/net/wireless/b43/debugfs.c                 |  2 +-
 drivers/net/wireless/b43legacy/debugfs.c           |  2 +-
 drivers/net/wireless/ti/wlcore/main.c              |  2 +-
 drivers/parisc/ccio-dma.c                          |  8 +++-----
 drivers/parisc/ccio-rm-dma.c                       |  2 +-
 drivers/parisc/sba_iommu.c                         |  7 +++----
 drivers/pci/host/pci-tegra.c                       |  2 +-
 drivers/pci/host/pcie-designware.c                 |  2 +-
 drivers/pci/host/pcie-rcar.c                       |  2 +-
 drivers/pci/host/pcie-xilinx.c                     |  2 +-
 drivers/s390/block/dasd.c                          |  2 +-
 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                           |  2 +-
 drivers/s390/cio/cmf.c                             |  2 +-
 drivers/scsi/cxlflash/main.c                       |  2 +-
 drivers/scsi/libiscsi.c                            |  3 +--
 drivers/scsi/lpfc/lpfc_init.c                      |  6 ++----
 drivers/scsi/megaraid/megaraid_sas_base.c          |  2 +-
 drivers/scsi/megaraid/megaraid_sas_fusion.c        |  4 ++--
 drivers/scsi/mpt3sas/mpt3sas_base.c                |  5 ++---
 drivers/scsi/sym53c8xx_2/sym_hipd.h                |  2 +-
 drivers/scsi/vmw_pvscsi.c                          |  3 +--
 drivers/sh/maple/maple.c                           |  3 +--
 drivers/usb/core/devices.c                         |  2 +-
 drivers/video/fbdev/fb-puv3.c                      |  2 +-
 drivers/video/fbdev/ssd1307fb.c                    |  2 +-
 fs/ceph/mds_client.c                               |  3 +--
 fs/configfs/file.c                                 |  2 +-
 fs/hfs/mdb.c                                       |  2 +-
 fs/jbd2/journal.c                                  |  4 ++--
 fs/nilfs2/ioctl.c                                  |  2 +-
 fs/proc/vmcore.c                                   |  4 ++--
 fs/quota/dquot.c                                   |  2 +-
 kernel/trace/ftrace.c                              |  2 +-
 kernel/trace/trace_events.c                        |  6 ++----
 lib/percpu_ida.c                                   |  2 +-
 lib/raid6/algos.c                                  |  2 +-
 lib/swiotlb.c                                      | 12 +++++-------
 mm/memory.c                                        |  2 +-
 mm/page_alloc.c                                    |  4 ++--
 mm/slub.c                                          |  2 +-
 net/core/neighbour.c                               |  3 +--
 net/dccp/proto.c                                   |  8 ++++----
 net/decnet/dn_route.c                              |  3 +--
 net/ipv4/fib_semantics.c                           |  3 +--
 net/netfilter/nf_conntrack_core.c                  |  2 +-
 net/netlink/af_netlink.c                           |  4 ++--
 net/packet/af_packet.c                             |  4 ++--
 net/sched/sch_api.c                                |  3 +--
 net/sctp/protocol.c                                |  8 ++++----
 net/sctp/ssnmap.c                                  |  3 +--
 net/xfrm/xfrm_hash.c                               |  3 +--
 security/integrity/ima/ima_crypto.c                |  4 ++--
 sound/core/memalloc.c                              |  2 +-
 sound/oss/dmabuf.c                                 |  2 +-
 sound/usb/usx2y/usb_stream.c                       |  5 ++---
 152 files changed, 222 insertions(+), 269 deletions(-)

diff --git a/arch/alpha/include/asm/agp.h b/arch/alpha/include/asm/agp.h
index 2fe5800..6179691 100644
--- a/arch/alpha/include/asm/agp.h
+++ b/arch/alpha/include/asm/agp.h
@@ -11,7 +11,7 @@
 
 /* GATT allocation. Returns/accepts GATT kernel virtual address. */
 #define alloc_gatt_pages(order)		\
-	((char *)__get_free_pages(GFP_KERNEL, (order)))
+	((char *)get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
 	free_pages((table), (order))
 
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c
index d3bcb88..543e3e7 100644
--- a/arch/alpha/kernel/pci-noop.c
+++ b/arch/alpha/kernel/pci-noop.c
@@ -115,7 +115,7 @@ static void *alpha_noop_alloc_coherent(struct device *dev, size_t size,
 
 	if (!dev || *dev->dma_mask >= 0xffffffffUL)
 		gfp &= ~GFP_DMA;
-	ret = (void *)__get_free_pages(gfp, get_order(size));
+	ret = get_free_pages(gfp, get_order(size));
 	if (ret) {
 		memset(ret, 0, size);
 		*dma_handle = virt_to_phys(ret);
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c
index fb0b20ee..b9b910f 100644
--- a/arch/alpha/kernel/pci_iommu.c
+++ b/arch/alpha/kernel/pci_iommu.c
@@ -442,7 +442,7 @@ static void *alpha_pci_alloc_coherent(struct device *dev, size_t size,
 	gfp &= ~GFP_DMA;
 
 try_again:
-	cpu_addr = (void *)__get_free_pages(gfp, order);
+	cpu_addr = get_free_pages(gfp, order);
 	if (! cpu_addr) {
 		printk(KERN_INFO "pci_alloc_consistent: "
 		       "get_free_pages failed from %pf\n",
diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h
index 1200117..a540e9b 100644
--- a/arch/arc/include/asm/pgalloc.h
+++ b/arch/arc/include/asm/pgalloc.h
@@ -55,7 +55,7 @@ static inline int __get_order_pgd(void)
 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	int num, num2;
-	pgd_t *ret = (pgd_t *) __get_free_pages(GFP_KERNEL, __get_order_pgd());
+	pgd_t *ret = get_free_pages(GFP_KERNEL, __get_order_pgd());
 
 	if (ret) {
 		num = USER_PTRS_PER_PGD + USER_KERNEL_GUTTER / PGDIR_SIZE;
@@ -95,7 +95,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
 {
 	pte_t *pte;
 
-	pte = (pte_t *) __get_free_pages(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO,
+	pte = get_free_pages(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO,
 					 __get_order_pte());
 
 	return pte;
@@ -107,7 +107,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long address)
 	pgtable_t pte_pg;
 	struct page *page;
 
-	pte_pg = (pgtable_t)__get_free_pages(GFP_KERNEL | __GFP_REPEAT, __get_order_pte());
+	pte_pg = get_free_pages(GFP_KERNEL | __GFP_REPEAT, __get_order_pte());
 	if (!pte_pg)
 		return 0;
 	memzero((void *)pte_pg, PTRS_PER_PTE * sizeof(pte_t));
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index c8611f2..21300f4 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -117,10 +117,10 @@ static inline void tlb_add_flush(struct mmu_gather *tlb, unsigned long addr)
 
 static inline void __tlb_alloc_page(struct mmu_gather *tlb)
 {
-	unsigned long addr = __get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0);
+	void *addr = get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0);
 
 	if (addr) {
-		tlb->pages = (void *)addr;
+		tlb->pages = addr;
 		tlb->max = PAGE_SIZE / sizeof(struct page *);
 	}
 }
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 190e9fb..429b673 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -1657,8 +1657,8 @@ int kvm_mmu_init(void)
 	 */
 	BUG_ON((hyp_idmap_start ^ (hyp_idmap_end - 1)) & PAGE_MASK);
 
-	hyp_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, hyp_pgd_order);
-	boot_hyp_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, hyp_pgd_order);
+	hyp_pgd = get_free_pages(GFP_KERNEL | __GFP_ZERO, hyp_pgd_order);
+	boot_hyp_pgd = get_free_pages(GFP_KERNEL | __GFP_ZERO, hyp_pgd_order);
 
 	if (!hyp_pgd || !boot_hyp_pgd) {
 		kvm_err("Hyp mode PGD not allocated\n");
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c
index b8799fa..f65e684 100644
--- a/arch/arm/mm/pgd.c
+++ b/arch/arm/mm/pgd.c
@@ -23,7 +23,7 @@
 #define __pgd_alloc()	kmalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL)
 #define __pgd_free(pgd)	kfree(pgd)
 #else
-#define __pgd_alloc()	(pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_REPEAT, 2)
+#define __pgd_alloc()	get_free_pages(GFP_KERNEL | __GFP_REPEAT, 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 198cb70..75147aa 100644
--- a/arch/blackfin/include/asm/mmu_context.h
+++ b/arch/blackfin/include/asm/mmu_context.h
@@ -173,8 +173,8 @@ static inline int
 init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 {
 #ifdef CONFIG_MPU
-	unsigned long p = __get_free_pages(GFP_KERNEL, page_mask_order);
-	mm->context.page_rwx_mask = (unsigned long *)p;
+	unsigned long *p = get_free_pages(GFP_KERNEL, page_mask_order);
+	mm->context.page_rwx_mask = p;
 	memset(mm->context.page_rwx_mask, 0,
 	       page_mask_nelts * 3 * sizeof(long));
 #endif
diff --git a/arch/cris/arch-v32/drivers/pci/dma.c b/arch/cris/arch-v32/drivers/pci/dma.c
index 9b43cec..979a2c7 100644
--- a/arch/cris/arch-v32/drivers/pci/dma.c
+++ b/arch/cris/arch-v32/drivers/pci/dma.c
@@ -30,7 +30,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
 	if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
 		gfp |= GFP_DMA;
 
-	ret = (void *)__get_free_pages(gfp, order);
+	ret = get_free_pages(gfp, order);
 
 	if (ret != NULL) {
 		memset(ret, 0, size);
diff --git a/arch/frv/mm/dma-alloc.c b/arch/frv/mm/dma-alloc.c
index 62268e1..60dea14 100644
--- a/arch/frv/mm/dma-alloc.c
+++ b/arch/frv/mm/dma-alloc.c
@@ -93,7 +93,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
 	size = PAGE_ALIGN(size);
 	order = get_order(size);
 
-	page = (void *)__get_free_pages(gfp, order);
+	page = get_free_pages(gfp, order);
 	if (!page) {
 		BUG();
 		return NULL;
diff --git a/arch/h8300/kernel/dma.c b/arch/h8300/kernel/dma.c
index 063a0f5..3092f45 100644
--- a/arch/h8300/kernel/dma.c
+++ b/arch/h8300/kernel/dma.c
@@ -21,7 +21,7 @@ static void *dma_alloc(struct device *dev, size_t size,
 
 	if (dev == NULL || (*dev->dma_mask < 0xffffffff))
 		gfp |= GFP_DMA;
-	ret = (void *)__get_free_pages(gfp, get_order(size));
+	ret = get_free_pages(gfp, get_order(size));
 
 	if (ret != NULL) {
 		memset(ret, 0, size);
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 2988500..c721949 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -1149,7 +1149,7 @@ sba_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
 		addr = page_address(page);
 	}
 #else
-	addr = (void *) __get_free_pages(flags, get_order(size));
+	addr = get_free_pages(flags, get_order(size));
 #endif
 	if (unlikely(!addr))
 		return NULL;
@@ -1631,8 +1631,7 @@ ioc_iova_init(struct ioc *ioc)
 	WRITE_REG(tcnfg, ioc->ioc_hpa + IOC_TCNFG);
 
 	ioc->pdir_size = (ioc->iov_size / iovp_size) * PDIR_ENTRY_SIZE;
-	ioc->pdir_base = (void *) __get_free_pages(GFP_KERNEL,
-						   get_order(ioc->pdir_size));
+	ioc->pdir_base = get_free_pages(GFP_KERNEL, get_order(ioc->pdir_size));
 	if (!ioc->pdir_base)
 		panic(PFX "Couldn't allocate I/O Page Table\n");
 
@@ -1671,7 +1670,7 @@ ioc_iova_init(struct ioc *ioc)
 		int poison_size = 16;
 		void *poison_addr, *addr;
 
-		addr = (void *)__get_free_pages(GFP_KERNEL, get_order(iovp_size));
+		addr = get_free_pages(GFP_KERNEL, get_order(iovp_size));
 		if (!addr)
 			panic(PFX "Couldn't allocate PDIR spill page\n");
 
@@ -1712,8 +1711,7 @@ ioc_resource_init(struct ioc *ioc)
 	ioc->res_size >>= 3;  /* convert bit count to byte count */
 	DBG_INIT("%s() res_size 0x%x\n", __func__, ioc->res_size);
 
-	ioc->res_map = (char *) __get_free_pages(GFP_KERNEL,
-						 get_order(ioc->res_size));
+	ioc->res_map = get_free_pages(GFP_KERNEL, get_order(ioc->res_size));
 	if (!ioc->res_map)
 		panic(PFX "Couldn't allocate resource map\n");
 
diff --git a/arch/ia64/include/asm/agp.h b/arch/ia64/include/asm/agp.h
index 80c30d4..4f360b9 100644
--- a/arch/ia64/include/asm/agp.h
+++ b/arch/ia64/include/asm/agp.h
@@ -19,7 +19,7 @@
 
 /* GATT allocation. Returns/accepts GATT kernel virtual address. */
 #define alloc_gatt_pages(order)		\
-	((char *)__get_free_pages(GFP_KERNEL, (order)))
+	((char *)get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
 	free_pages((table), (order))
 
diff --git a/arch/ia64/include/asm/tlb.h b/arch/ia64/include/asm/tlb.h
index 52ab3a9..06dc9e3 100644
--- a/arch/ia64/include/asm/tlb.h
+++ b/arch/ia64/include/asm/tlb.h
@@ -158,10 +158,10 @@ ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long e
 
 static inline void __tlb_alloc_page(struct mmu_gather *tlb)
 {
-	unsigned long addr = __get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0);
+	void *addr = get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0);
 
 	if (addr) {
-		tlb->pages = (void *)addr;
+		tlb->pages = addr;
 		tlb->max = PAGE_SIZE / sizeof(void *);
 	}
 }
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 2889412..2648a6f 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -1858,8 +1858,7 @@ ia64_mca_cpu_init(void *cpu_data)
 			data = mca_bootmem();
 			first_time = 0;
 		} else
-			data = (void *)__get_free_pages(GFP_KERNEL,
-							get_order(sz));
+			data = get_free_pages(GFP_KERNEL, get_order(sz));
 		if (!data)
 			panic("Could not allocate MCA memory for cpu %d\n",
 					cpu);
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index f25c898..2126b54 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -100,7 +100,7 @@ static void *sn_dma_alloc_coherent(struct device *dev, size_t size,
 		else
 			return NULL;
 	} else
-		cpuaddr = (void *)__get_free_pages(flags, get_order(size));
+		cpuaddr = get_free_pages(flags, get_order(size));
 
 	if (unlikely(!cpuaddr))
 		return NULL;
diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c
index 2bdf7bf..da443983 100644
--- a/arch/m68k/kernel/dma.c
+++ b/arch/m68k/kernel/dma.c
@@ -81,7 +81,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
 
 	if (dev == NULL || (*dev->dma_mask < 0xffffffff))
 		gfp |= GFP_DMA;
-	ret = (void *)__get_free_pages(gfp, get_order(size));
+	ret = get_free_pages(gfp, get_order(size));
 
 	if (ret != NULL) {
 		memset(ret, 0, size);
diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h
index 5e3fc6c..13030db 100644
--- a/arch/microblaze/include/asm/pgalloc.h
+++ b/arch/microblaze/include/asm/pgalloc.h
@@ -64,7 +64,7 @@ static inline pgd_t *get_pgd_slow(void)
 {
 	pgd_t *ret;
 
-	ret = (pgd_t *)__get_free_pages(GFP_KERNEL, PGDIR_ORDER);
+	ret = get_free_pages(GFP_KERNEL, PGDIR_ORDER);
 	if (ret != NULL)
 		clear_page(ret);
 	return ret;
diff --git a/arch/microblaze/mm/consistent.c b/arch/microblaze/mm/consistent.c
index bdeb2cb..335f006 100644
--- a/arch/microblaze/mm/consistent.c
+++ b/arch/microblaze/mm/consistent.c
@@ -79,7 +79,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
 	size = PAGE_ALIGN(size);
 	order = get_order(size);
 
-	vaddr = (void *)__get_free_pages(gfp, order);
+	vaddr = get_free_pages(gfp, order);
 	if (!vaddr)
 		return NULL;
 
diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h
index e29cc40..820ca21 100644
--- a/arch/mips/include/asm/pgalloc.h
+++ b/arch/mips/include/asm/pgalloc.h
@@ -48,7 +48,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	pgd_t *ret, *init;
 
-	ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
+	ret = get_free_pages(GFP_KERNEL, PGD_ORDER);
 	if (ret) {
 		init = pgd_offset(&init_mm, 0UL);
 		pgd_init((unsigned long)ret);
@@ -69,7 +69,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
 {
 	pte_t *pte;
 
-	pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, PTE_ORDER);
+	pte = get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, PTE_ORDER);
 
 	return pte;
 }
@@ -113,7 +113,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	pmd_t *pmd;
 
-	pmd = (pmd_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT, PMD_ORDER);
+	pmd = get_free_pages(GFP_KERNEL|__GFP_REPEAT, PMD_ORDER);
 	if (pmd)
 		pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table);
 	return pmd;
diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c
index db6f5af..8f65436 100644
--- a/arch/mips/jazz/jazzdma.c
+++ b/arch/mips/jazz/jazzdma.c
@@ -67,8 +67,7 @@ static int __init vdma_init(void)
 	 * aligned and should be uncached to avoid cache flushing after every
 	 * update.
 	 */
-	pgtbl = (VDMA_PGTBL_ENTRY *)__get_free_pages(GFP_KERNEL | GFP_DMA,
-						    get_order(VDMA_PGTBL_SIZE));
+	pgtbl = get_free_pages(GFP_KERNEL | GFP_DMA, get_order(VDMA_PGTBL_SIZE));
 	BUG_ON(!pgtbl);
 	dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE);
 	pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index d3c1cec..c0863e9 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -119,7 +119,7 @@ static void *mips_dma_alloc_noncoherent(struct device *dev, size_t size,
 
 	gfp = massage_gfp_flags(dev, gfp);
 
-	ret = (void *) __get_free_pages(gfp, get_order(size));
+	ret = get_free_pages(gfp, get_order(size));
 
 	if (ret != NULL) {
 		memset(ret, 0, size);
diff --git a/arch/nios2/include/asm/pgalloc.h b/arch/nios2/include/asm/pgalloc.h
index 91cd323..12cfc5e 100644
--- a/arch/nios2/include/asm/pgalloc.h
+++ b/arch/nios2/include/asm/pgalloc.h
@@ -42,7 +42,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
 {
 	pte_t *pte;
 
-	pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO,
+	pte = get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO,
 					PTE_ORDER);
 
 	return pte;
diff --git a/arch/nios2/mm/dma-mapping.c b/arch/nios2/mm/dma-mapping.c
index 0195f8f..7efef15 100644
--- a/arch/nios2/mm/dma-mapping.c
+++ b/arch/nios2/mm/dma-mapping.c
@@ -35,7 +35,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
 	if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
 		gfp |= GFP_DMA;
 
-	ret = (void *) __get_free_pages(gfp, get_order(size));
+	ret = get_free_pages(gfp, get_order(size));
 	if (ret != NULL) {
 		*dma_handle = virt_to_phys(ret);
 		flush_dcache_range((unsigned long) ret,
diff --git a/arch/nios2/mm/pgtable.c b/arch/nios2/mm/pgtable.c
index 61e24a2..9af52c7 100644
--- a/arch/nios2/mm/pgtable.c
+++ b/arch/nios2/mm/pgtable.c
@@ -55,7 +55,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	pgd_t *ret, *init;
 
-	ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
+	ret = get_free_pages(GFP_KERNEL, PGD_ORDER);
 	if (ret) {
 		init = pgd_offset(&init_mm, 0UL);
 		pgd_init(ret);
diff --git a/arch/parisc/include/asm/agp.h b/arch/parisc/include/asm/agp.h
index 31f67a5..4ecd394 100644
--- a/arch/parisc/include/asm/agp.h
+++ b/arch/parisc/include/asm/agp.h
@@ -13,7 +13,7 @@
 
 /* GATT allocation. Returns/accepts GATT kernel virtual address. */
 #define alloc_gatt_pages(order)		\
-	((char *)__get_free_pages(GFP_KERNEL, (order)))
+	((char *)get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
 	free_pages((table), (order))
 
diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h
index 51cb827..5c10934 100644
--- a/arch/parisc/include/asm/pgalloc.h
+++ b/arch/parisc/include/asm/pgalloc.h
@@ -20,8 +20,7 @@
  * kernel for machines with under 4GB of memory) */
 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	pgd_t *pgd = (pgd_t *)__get_free_pages(GFP_KERNEL,
-					       PGD_ALLOC_ORDER);
+	pgd_t *pgd = get_free_pages(GFP_KERNEL, PGD_ALLOC_ORDER);
 	pgd_t *actual_pgd = pgd;
 
 	if (likely(pgd != NULL)) {
@@ -63,8 +62,7 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
 
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	pmd_t *pmd = (pmd_t *)__get_free_pages(GFP_KERNEL|__GFP_REPEAT,
-					       PMD_ORDER);
+	pmd_t *pmd = get_free_pages(GFP_KERNEL|__GFP_REPEAT, PMD_ORDER);
 	if (pmd)
 		memset(pmd, 0, PAGE_SIZE<<PMD_ORDER);
 	return pmd;
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index 3c4ebba..6f15633 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -393,8 +393,7 @@ pcxl_dma_init(void)
 	spin_lock_init(&pcxl_res_lock);
 	pcxl_res_size = PCXL_DMA_MAP_SIZE >> (PAGE_SHIFT + 3);
 	pcxl_res_hint = 0;
-	pcxl_res_map = (char *)__get_free_pages(GFP_KERNEL,
-					    get_order(pcxl_res_size));
+	pcxl_res_map = get_free_pages(GFP_KERNEL, get_order(pcxl_res_size));
 	memset(pcxl_res_map, 0, pcxl_res_size);
 	proc_gsc_root = proc_mkdir("gsc", NULL);
 	if (!proc_gsc_root)
@@ -571,7 +570,7 @@ static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
 {
 	void *addr;
 
-	addr = (void *)__get_free_pages(flag, get_order(size));
+	addr = get_free_pages(flag, get_order(size));
 	if (addr)
 		*dma_handle = (dma_addr_t)virt_to_phys(addr);
 
diff --git a/arch/powerpc/include/asm/agp.h b/arch/powerpc/include/asm/agp.h
index 06df165..3c16089 100644
--- a/arch/powerpc/include/asm/agp.h
+++ b/arch/powerpc/include/asm/agp.h
@@ -10,7 +10,7 @@
 
 /* GATT allocation. Returns/accepts GATT kernel virtual address. */
 #define alloc_gatt_pages(order)		\
-	((char *)__get_free_pages(GFP_KERNEL, (order)))
+	((char *)get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
 	free_pages((table), (order))
 
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 26d091a..63fdb91 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -551,7 +551,7 @@ static void *fadump_cpu_notes_buf_alloc(unsigned long size)
 	unsigned long order, count, i;
 
 	order = get_order(size);
-	vaddr = (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, order);
+	vaddr = get_free_pages(GFP_KERNEL|__GFP_ZERO, order);
 	if (!vaddr)
 		return NULL;
 
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index 3dd6f8e..3e5c71c 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -72,7 +72,7 @@ long kvmppc_alloc_hpt(struct kvm *kvm, u32 *htab_orderp)
 	/* Lastly try successively smaller sizes from the page allocator */
 	/* Only do this if userspace didn't specify a size via ioctl */
 	while (!hpt && order > PPC_MIN_HPT_ORDER && !htab_orderp) {
-		hpt = (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO|
+		hpt = get_free_pages(GFP_KERNEL|__GFP_ZERO|
 					__GFP_REPEAT| __GFP_NOWARN,
 					order - PAGE_SHIFT);
 		if (!hpt)
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 89bfc17..6e6c311 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -89,7 +89,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 #ifndef CONFIG_PPC_4K_PAGES
 	ret = kmem_cache_alloc(pgtable_cache, GFP_KERNEL | __GFP_ZERO);
 #else
-	ret = (pgd_t *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
+	ret = get_free_pages(GFP_KERNEL|__GFP_ZERO,
 			PGDIR_ORDER - PAGE_SHIFT);
 #endif
 	return ret;
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 14a47f9..9ef5a940 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -668,7 +668,7 @@ spufs_init_isolated_loader(void)
 		return;
 
 	/* the loader must be align on a 16 byte boundary */
-	isolated_loader = (char *)__get_free_pages(GFP_KERNEL, get_order(size));
+	isolated_loader = get_free_pages(GFP_KERNEL, get_order(size));
 	if (!isolated_loader)
 		return;
 
diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c
index 08f71f8..dda5bf0 100644
--- a/arch/s390/hypfs/hypfs_diag.c
+++ b/arch/s390/hypfs/hypfs_diag.c
@@ -396,7 +396,7 @@ static void *diag204_alloc_vbuf(int pages)
 
 static void *diag204_alloc_rbuf(void)
 {
-	diag204_buf = (void*)__get_free_pages(GFP_KERNEL,0);
+	diag204_buf = get_free_pages(GFP_KERNEL,0);
 	if (!diag204_buf)
 		return ERR_PTR(-ENOMEM);
 	diag204_buf_pages = 1;
diff --git a/arch/s390/include/asm/idals.h b/arch/s390/include/asm/idals.h
index 56b1baf..cdbf89a 100644
--- a/arch/s390/include/asm/idals.h
+++ b/arch/s390/include/asm/idals.h
@@ -132,8 +132,7 @@ idal_buffer_alloc(size_t size, int page_order)
 			ib->data[i] = ib->data[i-1] + IDA_BLOCK_SIZE;
 			continue;
 		}
-		ib->data[i] = (void *)
-			__get_free_pages(GFP_KERNEL, page_order);
+		ib->data[i] = get_free_pages(GFP_KERNEL, page_order);
 		if (ib->data[i] != NULL)
 			continue;
 		// Not enough memory
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 63c1c8c..34a5041 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -183,8 +183,7 @@ static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu)
 	struct _lowcore *lc;
 
 	if (pcpu != &pcpu_devices[0]) {
-		pcpu->lowcore =	(struct _lowcore *)
-			__get_free_pages(GFP_KERNEL | GFP_DMA, LC_ORDER);
+		pcpu->lowcore =	get_free_pages(GFP_KERNEL | GFP_DMA, LC_ORDER);
 		async_stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER);
 		panic_stack = __get_free_page(GFP_KERNEL);
 		if (!pcpu->lowcore || !panic_stack || !async_stack)
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index ef7d6c8..44cb4af 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -30,7 +30,7 @@ static LIST_HEAD(mem_segs);
 static void __ref *vmem_alloc_pages(unsigned int order)
 {
 	if (slab_is_available())
-		return (void *)__get_free_pages(GFP_KERNEL, order);
+		return get_free_pages(GFP_KERNEL, order);
 	return alloc_bootmem_pages((1 << order) * PAGE_SIZE);
 }
 
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c
index 5914a16..162d9b6 100644
--- a/arch/s390/pci/pci_clp.c
+++ b/arch/s390/pci/pci_clp.c
@@ -48,7 +48,7 @@ static inline u8 clp_instr(void *data)
 
 static void *clp_alloc_block(gfp_t gfp_mask)
 {
-	return (void *) __get_free_pages(gfp_mask, get_order(CLP_BLK_SIZE));
+	return get_free_pages(gfp_mask, get_order(CLP_BLK_SIZE));
 }
 
 static void clp_free_block(void *ptr)
diff --git a/arch/score/include/asm/pgalloc.h b/arch/score/include/asm/pgalloc.h
index 55fb080..6e07805 100644
--- a/arch/score/include/asm/pgalloc.h
+++ b/arch/score/include/asm/pgalloc.h
@@ -21,7 +21,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	pgd_t *ret, *init;
 
-	ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
+	ret = get_free_pages(GFP_KERNEL, PGD_ORDER);
 	if (ret) {
 		init = pgd_offset(&init_mm, 0UL);
 		pgd_init((unsigned long)ret);
@@ -42,7 +42,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
 {
 	pte_t *pte;
 
-	pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO,
+	pte = get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO,
 					PTE_ORDER);
 
 	return pte;
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index 4721e24..6324c40 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -41,7 +41,7 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
 
 	gfp |= __GFP_ZERO;
 
-	ret = (void *)__get_free_pages(gfp, order);
+	ret = get_free_pages(gfp, order);
 	if (!ret)
 		return NULL;
 
diff --git a/arch/sparc/include/asm/agp.h b/arch/sparc/include/asm/agp.h
index 363d3e6..dd31037 100644
--- a/arch/sparc/include/asm/agp.h
+++ b/arch/sparc/include/asm/agp.h
@@ -9,7 +9,7 @@
 
 /* GATT allocation. Returns/accepts GATT kernel virtual address. */
 #define alloc_gatt_pages(order)		\
-	((char *)__get_free_pages(GFP_KERNEL, (order)))
+	((char *)get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
 	free_pages((table), (order))
 
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 3bd3481..1ff0516 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -278,7 +278,7 @@ static void *sbus_alloc_coherent(struct device *dev, size_t len,
 	}
 
 	order = get_order(len_total);
-	va = (void *)__get_free_pages(gfp, order);
+	va = get_free_pages(gfp, order);
 	if (!va)
 		goto err_nopages;
 
@@ -444,7 +444,7 @@ static void *pci32_alloc_coherent(struct device *dev, size_t len,
 	}
 
 	order = get_order(len_total);
-	va = (void *) __get_free_pages(gfp, order);
+	va = get_free_pages(gfp, order);
 	if (va == NULL) {
 		printk("pci_alloc_consistent: no %ld pages\n", len_total>>PAGE_SHIFT);
 		goto err_nopages;
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index e2d198d..8858bb0 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -1095,8 +1095,7 @@ static void __init irq_ivector_init(void)
 	ivecs = size_nr_ivec();
 	size = sizeof(struct ino_bucket) * ivecs;
 	order = get_order(size);
-	ivector_table = (struct ino_bucket *)
-		__get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
+	ivector_table = get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
 	if (!ivector_table) {
 		prom_printf("Fatal error, cannot allocate ivector_table\n");
 		prom_halt();
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c
index 1cba9b7..05fe8eb 100644
--- a/arch/sparc/kernel/ldc.c
+++ b/arch/sparc/kernel/ldc.c
@@ -975,7 +975,7 @@ static int alloc_queue(const char *name, unsigned long num_entries,
 	size = num_entries * LDC_PACKET_SIZE;
 	order = get_order(size);
 
-	q = (void *) __get_free_pages(GFP_KERNEL, order);
+	q = get_free_pages(GFP_KERNEL, order);
 	if (!q) {
 		printk(KERN_ERR PFX "Alloc of %s queue failed with "
 		       "size=%lu order=%lu\n", name, size, order);
@@ -1059,8 +1059,7 @@ static int ldc_iommu_init(const char *name, struct ldc_channel *lp)
 
 	order = get_order(tsbsize);
 
-	table = (struct ldc_mtable_entry *)
-		__get_free_pages(GFP_KERNEL, order);
+	table = get_free_pages(GFP_KERNEL, order);
 	err = -ENOMEM;
 	if (!table) {
 		printk(KERN_ERR PFX "Alloc of MTE table failed, "
diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c
index ff44386..59c96bf 100644
--- a/arch/sparc/kernel/pci_fire.c
+++ b/arch/sparc/kernel/pci_fire.c
@@ -232,7 +232,7 @@ static int pci_fire_msiq_alloc(struct pci_pbm_info *pbm)
 	void *pages;
 
 	order = get_order(512 * 1024);
-	pages = (void *)__get_free_pages(GFP_KERNEL | __GFP_COMP, order);
+	pages = get_free_pages(GFP_KERNEL | __GFP_COMP, order);
 	if (!pages) {
 		printk(KERN_ERR "MSI: Cannot allocate MSI queues (o=%lu).\n",
 		       order);
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index 9d84e4e..d700a73 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -753,7 +753,7 @@ static int pci_sun4v_msiq_alloc(struct pci_pbm_info *pbm)
 	q_size = pbm->msiq_ent_count * sizeof(struct pci_sun4v_msiq_entry);
 	alloc_size = (pbm->msiq_num * q_size);
 	order = get_order(alloc_size);
-	pages = (void *)__get_free_pages(GFP_KERNEL | __GFP_COMP, order);
+	pages = get_free_pages(GFP_KERNEL | __GFP_COMP, order);
 	if (!pages) {
 		printk(KERN_ERR "MSI: Cannot allocate MSI queues (o=%lu).\n",
 		       order);
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index d21cd62..cc04b28 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -872,8 +872,7 @@ void __init cheetah_ecache_flush_init(void)
 		if ((PAGE_SIZE << order) >= sz)
 			break;
 	}
-	cheetah_error_log = (struct cheetah_err_info *)
-		__get_free_pages(GFP_KERNEL, order);
+	cheetah_error_log = get_free_pages(GFP_KERNEL, order);
 	if (!cheetah_error_log) {
 		prom_printf("cheetah_ecache_flush_init: Failed to allocate "
 			    "error logging scoreboard (%d bytes).\n", sz);
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 504f60b..3d2ced3 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -880,7 +880,7 @@ void *get_output_buffer(int *len_out)
 {
 	void *ret;
 
-	ret = (void *) __get_free_pages(GFP_KERNEL, 0);
+	ret = get_free_pages(GFP_KERNEL, 0);
 	if (ret) *len_out = PAGE_SIZE;
 	else *len_out = 0;
 	return ret;
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index 69c8d56..05826e3 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -66,7 +66,7 @@ void *alloc_stack(int order, int atomic)
 
 	if (atomic)
 		flags = GFP_ATOMIC;
-	return (void *)__get_free_pages(flags, order);
+	return get_free_pages(flags, order);
 }
 
 static inline void set_current(struct task_struct *task)
diff --git a/arch/unicore32/mm/pgd.c b/arch/unicore32/mm/pgd.c
index 9485183..cf141a1c 100644
--- a/arch/unicore32/mm/pgd.c
+++ b/arch/unicore32/mm/pgd.c
@@ -30,7 +30,7 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
 	pmd_t *new_pmd, *init_pmd;
 	pte_t *new_pte, *init_pte;
 
-	new_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL, 0);
+	new_pgd = get_free_pages(GFP_KERNEL, 0);
 	if (!new_pgd)
 		goto no_pgd;
 
diff --git a/arch/x86/include/asm/agp.h b/arch/x86/include/asm/agp.h
index 4f98370..84a43f3 100644
--- a/arch/x86/include/asm/agp.h
+++ b/arch/x86/include/asm/agp.h
@@ -24,7 +24,7 @@
 
 /* GATT allocation. Returns/accepts GATT kernel virtual address. */
 #define alloc_gatt_pages(order)		\
-	((char *)__get_free_pages(GFP_KERNEL, (order)))
+	((char *)get_free_pages(GFP_KERNEL, (order)))
 #define free_gatt_pages(table, order)	\
 	free_pages((table), (order))
 
diff --git a/arch/x86/include/asm/xen/page-coherent.h b/arch/x86/include/asm/xen/page-coherent.h
index 8a55a89..1de4d93 100644
--- a/arch/x86/include/asm/xen/page-coherent.h
+++ b/arch/x86/include/asm/xen/page-coherent.h
@@ -9,7 +9,7 @@ static inline void *xen_alloc_coherent_pages(struct device *hwdev, size_t size,
 		dma_addr_t *dma_handle, gfp_t flags,
 		struct dma_attrs *attrs)
 {
-	void *vstart = (void*)__get_free_pages(flags, get_order(size));
+	void *vstart = get_free_pages(flags, get_order(size));
 	*dma_handle = virt_to_phys(vstart);
 	return vstart;
 }
diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c
index 94da9dd..5bc0312 100644
--- a/arch/x86/kernel/amd_gart_64.c
+++ b/arch/x86/kernel/amd_gart_64.c
@@ -671,7 +671,7 @@ static __init int init_amd_gatt(struct agp_kern_info *info)
 	info->aper_size = aper_size >> 20;
 
 	gatt_size = (aper_size >> PAGE_SHIFT) * sizeof(u32);
-	gatt = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	gatt = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 					get_order(gatt_size));
 	if (!gatt)
 		panic("Cannot allocate GATT table");
@@ -776,7 +776,7 @@ int __init gart_iommu_init(void)
 	iommu_size = check_iommu_size(info.aper_base, aper_size);
 	iommu_pages = iommu_size >> PAGE_SHIFT;
 
-	iommu_gart_bitmap = (void *) __get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	iommu_gart_bitmap = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 						      get_order(iommu_pages/8));
 	if (!iommu_gart_bitmap)
 		panic("Cannot allocate iommu bitmap\n");
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 97e092d..738ed3e 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -446,7 +446,7 @@ static void* calgary_alloc_coherent(struct device *dev, size_t size,
 	flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
 
 	/* alloc enough pages (and possibly more) */
-	ret = (void *)__get_free_pages(flag, order);
+	ret = get_free_pages(flag, order);
 	if (!ret)
 		goto error;
 	memset(ret, 0, size);
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 493f541..bce45cf 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -89,7 +89,7 @@ __ref void *alloc_low_pages(unsigned int num)
 		unsigned int order;
 
 		order = get_order((unsigned long)num << PAGE_SHIFT);
-		return (void *)__get_free_pages(GFP_ATOMIC | __GFP_NOTRACK |
+		return get_free_pages(GFP_ATOMIC | __GFP_NOTRACK |
 						__GFP_ZERO, order);
 	}
 
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index ed873dd..0478d9f 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -687,7 +687,7 @@ static void *realloc_pages(void *old_memmap, int old_shift)
 {
 	void *ret;
 
-	ret = (void *)__get_free_pages(GFP_KERNEL, old_shift + 1);
+	ret = get_free_pages(GFP_KERNEL, old_shift + 1);
 	if (!ret)
 		goto out;
 
diff --git a/arch/x86/um/ldt.c b/arch/x86/um/ldt.c
index 52e173d..5264f55 100644
--- a/arch/x86/um/ldt.c
+++ b/arch/x86/um/ldt.c
@@ -247,8 +247,7 @@ static void ldt_get_host_info(void)
 	for (i = LDT_PAGES_MAX-1, order=0; i; i>>=1, order++)
 		;
 
-	ldt = (struct ldt_entry *)
-	      __get_free_pages(GFP_KERNEL|__GFP_ZERO, order);
+	ldt = get_free_pages(GFP_KERNEL|__GFP_ZERO, order);
 	if (ldt == NULL) {
 		printk(KERN_ERR "ldt_get_host_info: couldn't allocate buffer "
 		       "for host ldt\n");
diff --git a/arch/xtensa/include/asm/pgalloc.h b/arch/xtensa/include/asm/pgalloc.h
index 022b9b3..2a7631f 100644
--- a/arch/xtensa/include/asm/pgalloc.h
+++ b/arch/xtensa/include/asm/pgalloc.h
@@ -30,7 +30,7 @@
 static inline pgd_t*
 pgd_alloc(struct mm_struct *mm)
 {
-	return (pgd_t*) __get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER);
+	return get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER);
 }
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
diff --git a/crypto/xor.c b/crypto/xor.c
index 20060f8..e25b834 100644
--- a/crypto/xor.c
+++ b/crypto/xor.c
@@ -114,7 +114,7 @@ calibrate_xor_blocks(void)
 	 * test the XOR speed, we don't really want kmemcheck to warn about
 	 * reading uninitialized bytes here.
 	 */
-	b1 = (void *) __get_free_pages(GFP_KERNEL | __GFP_NOTRACK, 2);
+	b1 = get_free_pages(GFP_KERNEL | __GFP_NOTRACK, 2);
 	if (!b1) {
 		printk(KERN_WARNING "xor: Yikes!  No memory available.\n");
 		return -ENOMEM;
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index 414ac33..16876fa 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -947,7 +947,7 @@ void *devm_get_free_pages(struct device *dev,
 				  gfp_t gfp_mask, unsigned int order)
 {
 	struct pages_devres *devres;
-	void *addr = (void *)__get_free_pages(gfp_mask, order);
+	void *addr = get_free_pages(gfp_mask, order);
 
 	if (unlikely(!addr))
 		return 0;
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index db7ece5..9fbd9e8 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -644,8 +644,7 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev)
 	ps3_system_bus_set_drvdata(dev, priv);
 
 	/* Allocate XDR buffer (1MiB aligned) */
-	priv->xdr_buf = (void *)__get_free_pages(GFP_KERNEL,
-		get_order(XDR_BUF_SIZE));
+	priv->xdr_buf = get_free_pages(GFP_KERNEL, get_order(XDR_BUF_SIZE));
 	if (priv->xdr_buf == NULL) {
 		dev_err(&dev->core, "Could not allocate XDR buffer\n");
 		error = -ENOMEM;
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index c5873c2..fa97cc3 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1418,8 +1418,7 @@ static int setup_blkring(struct xenbus_device *dev,
 	for (i = 0; i < info->nr_ring_pages; i++)
 		info->ring_ref[i] = GRANT_INVALID_REF;
 
-	sring = (struct blkif_sring *)__get_free_pages(GFP_NOIO | __GFP_HIGH,
-						       get_order(ring_size));
+	sring = get_free_pages(GFP_NOIO | __GFP_HIGH, get_order(ring_size));
 	if (!sring) {
 		xenbus_dev_fatal(dev, -ENOMEM, "allocating shared ring");
 		return -ENOMEM;
diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
index efaa135..806546c 100644
--- a/drivers/block/zram/zcomp.c
+++ b/drivers/block/zram/zcomp.c
@@ -85,7 +85,7 @@ static struct zcomp_strm *zcomp_strm_alloc(struct zcomp *comp)
 	 * allocate 2 pages. 1 for compressed data, plus 1 extra for the
 	 * case when compressed size is larger than the original one
 	 */
-	zstrm->buffer = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1);
+	zstrm->buffer = get_free_pages(GFP_KERNEL | __GFP_ZERO, 1);
 	if (!zstrm->private || !zstrm->buffer) {
 		zcomp_strm_free(comp, zstrm);
 		zstrm = NULL;
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c
index 9f83f13..5a7fe5f 100644
--- a/drivers/char/agp/hp-agp.c
+++ b/drivers/char/agp/hp-agp.c
@@ -294,7 +294,7 @@ hp_zx1_create_gatt_table (struct agp_bridge_data *bridge)
 	int i;
 
 	if (hp->io_pdir_owner) {
-		hp->io_pdir = (u64 *) __get_free_pages(GFP_KERNEL,
+		hp->io_pdir = get_free_pages(GFP_KERNEL,
 						get_order(hp->io_pdir_size));
 		if (!hp->io_pdir) {
 			printk(KERN_ERR PFX "Couldn't allocate contiguous "
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index bcbe6a5..71d3f1a 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -390,7 +390,7 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge)
 		page_order = A_SIZE_32(temp)->page_order;
 		num_entries = A_SIZE_32(temp)->num_entries;
 
-		table = (char *) __get_free_pages(GFP_KERNEL, page_order);
+		table = get_free_pages(GFP_KERNEL, page_order);
 
 		if (table == NULL) {
 			i++;
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index bf75457..dc99f80 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -652,8 +652,8 @@ static int atmel_aes_buff_init(struct atmel_aes_dev *dd)
 {
 	int err = -ENOMEM;
 
-	dd->buf_in = (void *)__get_free_pages(GFP_KERNEL, 0);
-	dd->buf_out = (void *)__get_free_pages(GFP_KERNEL, 0);
+	dd->buf_in = get_free_pages(GFP_KERNEL, 0);
+	dd->buf_out = get_free_pages(GFP_KERNEL, 0);
 	dd->buflen = PAGE_SIZE;
 	dd->buflen &= ~(AES_BLOCK_SIZE - 1);
 
diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c
index 0219027e..5f69db6 100644
--- a/drivers/crypto/atmel-tdes.c
+++ b/drivers/crypto/atmel-tdes.c
@@ -347,8 +347,8 @@ static int atmel_tdes_buff_init(struct atmel_tdes_dev *dd)
 {
 	int err = -ENOMEM;
 
-	dd->buf_in = (void *)__get_free_pages(GFP_KERNEL, 0);
-	dd->buf_out = (void *)__get_free_pages(GFP_KERNEL, 0);
+	dd->buf_in = get_free_pages(GFP_KERNEL, 0);
+	dd->buf_out = get_free_pages(GFP_KERNEL, 0);
 	dd->buflen = PAGE_SIZE;
 	dd->buflen &= ~(DES_BLOCK_SIZE - 1);
 
diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c
index ce459cb..be7cdf6 100644
--- a/drivers/crypto/nx/nx-842.c
+++ b/drivers/crypto/nx/nx-842.c
@@ -117,8 +117,8 @@ int nx842_crypto_init(struct crypto_tfm *tfm, struct nx842_driver *driver)
 	spin_lock_init(&ctx->lock);
 	ctx->driver = driver;
 	ctx->wmem = kmalloc(driver->workmem_size, GFP_KERNEL);
-	ctx->sbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
-	ctx->dbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
+	ctx->sbounce = get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
+	ctx->dbounce = get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
 	if (!ctx->wmem || !ctx->sbounce || !ctx->dbounce) {
 		kfree(ctx->wmem);
 		free_page(ctx->sbounce);
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index cd41ce7..4c91b97 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -582,8 +582,8 @@ static int omap_aes_copy_sgs(struct omap_aes_dev *dd)
 	total = ALIGN(dd->total, AES_BLOCK_SIZE);
 	pages = get_order(total);
 
-	buf_in = (void *)__get_free_pages(GFP_ATOMIC, pages);
-	buf_out = (void *)__get_free_pages(GFP_ATOMIC, pages);
+	buf_in = get_free_pages(GFP_ATOMIC, pages);
+	buf_out = get_free_pages(GFP_ATOMIC, pages);
 
 	if (!buf_in || !buf_out) {
 		pr_err("Couldn't allocated pages for unaligned cases.\n");
diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index 462f2bc..35c916e 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -563,8 +563,8 @@ static int omap_des_copy_sgs(struct omap_des_dev *dd)
 
 	BUG_ON(!pages);
 
-	buf_in = (void *)__get_free_pages(GFP_ATOMIC, pages);
-	buf_out = (void *)__get_free_pages(GFP_ATOMIC, pages);
+	buf_in = get_free_pages(GFP_ATOMIC, pages);
+	buf_out = get_free_pages(GFP_ATOMIC, pages);
 
 	if (!buf_in || !buf_out) {
 		pr_err("Couldn't allocated pages for unaligned cases.\n");
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index e2e0225..287d468 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3425,7 +3425,7 @@ static int __init d40_lcla_allocate(struct d40_base *base)
 	base->lcla_pool.pages = SZ_1K * base->num_phy_chans / PAGE_SIZE;
 
 	for (i = 0; i < MAX_LCLA_ALLOC_ATTEMPTS; i++) {
-		page_list[i] = (void *)__get_free_pages(GFP_KERNEL,
+		page_list[i] = get_free_pages(GFP_KERNEL,
 						base->lcla_pool.pages);
 		if (!page_list[i]) {
 
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index 7d1afaa..ba66b09 100644
--- a/drivers/firmware/dell_rbu.c
+++ b/drivers/firmware/dell_rbu.c
@@ -160,8 +160,7 @@ static int create_packet(void *data, size_t length)
 	}
 
 	while (!packet_data_temp_buf) {
-		packet_data_temp_buf = (unsigned char *)
-			__get_free_pages(GFP_KERNEL, ordernum);
+		packet_data_temp_buf = get_free_pages(GFP_KERNEL, ordernum);
 		if (!packet_data_temp_buf) {
 			printk(KERN_WARNING
 				"dell_rbu:%s: failed to allocate new "
@@ -434,8 +433,7 @@ static int img_update_realloc(unsigned long size)
 	spin_unlock(&rbu_data.lock);
 
 	ordernum = get_order(size);
-	image_update_buffer =
-		(unsigned char *) __get_free_pages(GFP_KERNEL, ordernum);
+	image_update_buffer = get_free_pages(GFP_KERNEL, ordernum);
 
 	img_buf_phys_addr =
 		(unsigned long) virt_to_phys(image_update_buffer);
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
index 8bb3671..82d206f 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
@@ -137,7 +137,7 @@ static bool allocate_signal_page(struct file *devkfd, struct kfd_process *p)
 
 	page->free_slots = SLOTS_PER_PAGE;
 
-	backing_store = (void *) __get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	backing_store = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 					get_order(KFD_SIGNAL_EVENT_LIMIT * 8));
 	if (!backing_store)
 		goto fail_alloc_signal_store;
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index 0b65dc5..c06147c 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -94,11 +94,11 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 				recv_ringbuffer_size));
 
 	if (!page)
-		out = (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
-					       get_order(send_ringbuffer_size +
+		out = get_free_pages(GFP_KERNEL|__GFP_ZERO,
+				       get_order(send_ringbuffer_size +
 					       recv_ringbuffer_size));
 	else
-		out = (void *)page_address(page);
+		out = page_address(page);
 
 	if (!out) {
 		err = -ENOMEM;
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 99cf9e9..1ec553d 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -152,8 +152,7 @@ int vmbus_connect(void)
 	 * Setup the vmbus event connection for channel interrupt
 	 * abstraction stuff
 	 */
-	vmbus_connection.int_page =
-	(void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, 0);
+	vmbus_connection.int_page = get_free_pages(GFP_KERNEL|__GFP_ZERO, 0);
 	if (vmbus_connection.int_page == NULL) {
 		ret = -ENOMEM;
 		goto cleanup;
@@ -168,8 +167,8 @@ int vmbus_connect(void)
 	 * Setup the monitor notification facility. The 1st page for
 	 * parent->child and the 2nd page for child->parent
 	 */
-	vmbus_connection.monitor_pages[0] = (void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 0);
-	vmbus_connection.monitor_pages[1] = (void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 0);
+	vmbus_connection.monitor_pages[0] = get_free_pages((GFP_KERNEL|__GFP_ZERO), 0);
+	vmbus_connection.monitor_pages[1] = get_free_pages((GFP_KERNEL|__GFP_ZERO), 0);
 	if ((vmbus_connection.monitor_pages[0] == NULL) ||
 	    (vmbus_connection.monitor_pages[1] == NULL)) {
 		ret = -ENOMEM;
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index ace59ca..a89b9d5 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -500,7 +500,7 @@ static int __init find_last_devid_acpi(struct acpi_table_header *table)
  */
 static int __init alloc_command_buffer(struct amd_iommu *iommu)
 {
-	iommu->cmd_buf = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	iommu->cmd_buf = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 						  get_order(CMD_BUFFER_SIZE));
 
 	return iommu->cmd_buf ? 0 : -ENOMEM;
@@ -547,7 +547,7 @@ static void __init free_command_buffer(struct amd_iommu *iommu)
 /* allocates the memory where the IOMMU will log its events to */
 static int __init alloc_event_buffer(struct amd_iommu *iommu)
 {
-	iommu->evt_buf = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	iommu->evt_buf = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 						  get_order(EVT_BUFFER_SIZE));
 
 	return iommu->evt_buf ? 0 : -ENOMEM;
@@ -579,7 +579,7 @@ static void __init free_event_buffer(struct amd_iommu *iommu)
 /* allocates the memory where the IOMMU will log its events to */
 static int __init alloc_ppr_log(struct amd_iommu *iommu)
 {
-	iommu->ppr_log = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	iommu->ppr_log = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 						  get_order(PPR_LOG_SIZE));
 
 	return iommu->ppr_log ? 0 : -ENOMEM;
@@ -1833,7 +1833,7 @@ static int __init early_amd_iommu_init(void)
 
 	/* Device table - directly used by all IOMMUs */
 	ret = -ENOMEM;
-	amd_iommu_dev_table = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	amd_iommu_dev_table = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 				      get_order(dev_table_size));
 	if (amd_iommu_dev_table == NULL)
 		goto out;
@@ -1842,19 +1842,19 @@ static int __init early_amd_iommu_init(void)
 	 * Alias table - map PCI Bus/Dev/Func to Bus/Dev/Func the
 	 * IOMMU see for that device
 	 */
-	amd_iommu_alias_table = (void *)__get_free_pages(GFP_KERNEL,
+	amd_iommu_alias_table = get_free_pages(GFP_KERNEL,
 			get_order(alias_table_size));
 	if (amd_iommu_alias_table == NULL)
 		goto out;
 
 	/* IOMMU rlookup table - find the IOMMU for a specific device */
-	amd_iommu_rlookup_table = (void *)__get_free_pages(
+	amd_iommu_rlookup_table = get_free_pages(
 			GFP_KERNEL | __GFP_ZERO,
 			get_order(rlookup_table_size));
 	if (amd_iommu_rlookup_table == NULL)
 		goto out;
 
-	amd_iommu_pd_alloc_bitmap = (void *)__get_free_pages(
+	amd_iommu_pd_alloc_bitmap = get_free_pages(
 					    GFP_KERNEL | __GFP_ZERO,
 					    get_order(MAX_DOMAIN_ID/8));
 	if (amd_iommu_pd_alloc_bitmap == NULL)
@@ -1898,7 +1898,7 @@ static int __init early_amd_iommu_init(void)
 		if (!amd_iommu_irq_cache)
 			goto out;
 
-		irq_lookup_table = (void *)__get_free_pages(
+		irq_lookup_table = get_free_pages(
 				GFP_KERNEL | __GFP_ZERO,
 				get_order(rlookup_table_size));
 		if (!irq_lookup_table)
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 828a316..6d376c8 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -669,11 +669,11 @@ static struct iommu_domain *exynos_iommu_domain_alloc(unsigned type)
 	if (!domain)
 		return NULL;
 
-	domain->pgtable = (sysmmu_pte_t *)__get_free_pages(GFP_KERNEL, 2);
+	domain->pgtable = get_free_pages(GFP_KERNEL, 2);
 	if (!domain->pgtable)
 		goto err_pgtable;
 
-	domain->lv2entcnt = (short *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1);
+	domain->lv2entcnt = get_free_pages(GFP_KERNEL | __GFP_ZERO, 1);
 	if (!domain->lv2entcnt)
 		goto err_counter;
 
diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index 01afc79..2d9f859 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -227,8 +227,7 @@ static struct iommu_domain *msm_iommu_domain_alloc(unsigned type)
 		goto fail_nomem;
 
 	INIT_LIST_HEAD(&priv->list_attached);
-	priv->pgtable = (unsigned long *)__get_free_pages(GFP_KERNEL,
-							  get_order(SZ_16K));
+	priv->pgtable = get_free_pages(GFP_KERNEL, get_order(SZ_16K));
 
 	if (!priv->pgtable)
 		goto fail_nomem;
@@ -433,9 +432,8 @@ static int msm_iommu_map(struct iommu_domain *domain, unsigned long va,
 
 	/* Need a 2nd level table */
 	if ((len == SZ_4K || len == SZ_64K) && (*fl_pte) == 0) {
-		unsigned long *sl;
-		sl = (unsigned long *) __get_free_pages(GFP_ATOMIC,
-							get_order(SZ_4K));
+		unsigned long *sl = get_free_pages(GFP_ATOMIC,
+						   get_order(SZ_4K));
 
 		if (!sl) {
 			pr_debug("Could not allocate second level table\n");
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 2513a68..217765a 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -883,7 +883,7 @@ static int its_alloc_tables(const char *node_name, struct its_node *its)
 				node_name, order, alloc_pages);
 		}
 
-		base = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
+		base = get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
 		if (!base) {
 			err = -ENOMEM;
 			goto out_free;
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
index 3059674..22b8aaa 100644
--- a/drivers/md/bcache/bset.c
+++ b/drivers/md/bcache/bset.c
@@ -315,19 +315,19 @@ int bch_btree_keys_alloc(struct btree_keys *b, unsigned page_order, gfp_t gfp)
 
 	b->page_order = page_order;
 
-	t->data = (void *) __get_free_pages(gfp, b->page_order);
+	t->data = get_free_pages(gfp, b->page_order);
 	if (!t->data)
 		goto err;
 
 	t->tree = bset_tree_bytes(b) < PAGE_SIZE
 		? kmalloc(bset_tree_bytes(b), gfp)
-		: (void *) __get_free_pages(gfp, get_order(bset_tree_bytes(b)));
+		: get_free_pages(gfp, get_order(bset_tree_bytes(b)));
 	if (!t->tree)
 		goto err;
 
 	t->prev = bset_prev_bytes(b) < PAGE_SIZE
 		? kmalloc(bset_prev_bytes(b), gfp)
-		: (void *) __get_free_pages(gfp, get_order(bset_prev_bytes(b)));
+		: get_free_pages(gfp, get_order(bset_prev_bytes(b)));
 	if (!t->prev)
 		goto err;
 
@@ -1180,7 +1180,7 @@ static void __btree_sort(struct btree_keys *b, struct btree_iter *iter,
 {
 	uint64_t start_time;
 	bool used_mempool = false;
-	struct bset *out = (void *) __get_free_pages(__GFP_NOWARN|GFP_NOWAIT,
+	struct bset *out = get_free_pages(__GFP_NOWARN|GFP_NOWAIT,
 						     order);
 	if (!out) {
 		struct page *outp;
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 1540114..9499bfb 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -792,8 +792,7 @@ int bch_btree_cache_alloc(struct cache_set *c)
 #ifdef CONFIG_BCACHE_DEBUG
 	mutex_init(&c->verify_lock);
 
-	c->verify_ondisk = (void *)
-		__get_free_pages(GFP_KERNEL, ilog2(bucket_pages(c)));
+	c->verify_ondisk = get_free_pages(GFP_KERNEL, ilog2(bucket_pages(c)));
 
 	c->verify_data = mca_bucket_alloc(c, &ZERO_KEY, GFP_KERNEL);
 
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
index 6ed9533..813def6 100644
--- a/drivers/md/bcache/journal.c
+++ b/drivers/md/bcache/journal.c
@@ -815,8 +815,8 @@ int bch_journal_alloc(struct cache_set *c)
 	j->w[1].c = c;
 
 	if (!(init_fifo(&j->pin, JOURNAL_PIN, GFP_KERNEL)) ||
-	    !(j->w[0].data = (void *) __get_free_pages(GFP_KERNEL, JSET_BITS)) ||
-	    !(j->w[1].data = (void *) __get_free_pages(GFP_KERNEL, JSET_BITS)))
+	    !(j->w[0].data = get_free_pages(GFP_KERNEL, JSET_BITS)) ||
+	    !(j->w[1].data = get_free_pages(GFP_KERNEL, JSET_BITS)))
 		return -ENOMEM;
 
 	return 0;
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index cd04e2d..2fb3624 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1431,7 +1431,7 @@ void bch_cache_set_unregister(struct cache_set *c)
 }
 
 #define alloc_bucket_pages(gfp, c)			\
-	((void *) __get_free_pages(__GFP_ZERO|gfp, ilog2(bucket_pages(c))))
+	(get_free_pages(__GFP_ZERO|gfp, ilog2(bucket_pages(c))))
 
 struct cache_set *bch_cache_set_alloc(struct cache_sb *sb)
 {
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 10f8a45..f2aae7e 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -380,8 +380,7 @@ static void *alloc_buffer_data(struct dm_bufio_client *c, gfp_t gfp_mask,
 	if (c->block_size <= DM_BUFIO_BLOCK_SIZE_GFP_LIMIT &&
 	    gfp_mask & __GFP_NORETRY) {
 		*data_mode = DATA_MODE_GET_FREE_PAGES;
-		return (void *)__get_free_pages(gfp_mask,
-						c->pages_per_block_bits);
+		return get_free_pages(gfp_mask, c->pages_per_block_bits);
 	}
 
 	*data_mode = DATA_MODE_VMALLOC;
diff --git a/drivers/media/pci/solo6x10/solo6x10-p2m.c b/drivers/media/pci/solo6x10/solo6x10-p2m.c
index ef91be9..85bdeac 100644
--- a/drivers/media/pci/solo6x10/solo6x10-p2m.c
+++ b/drivers/media/pci/solo6x10/solo6x10-p2m.c
@@ -221,11 +221,11 @@ static int solo_p2m_test(struct solo_dev *solo_dev, int base, int size)
 	int ret = -EIO;
 	int order = get_order(size);
 
-	wr_buf = (u32 *)__get_free_pages(GFP_KERNEL, order);
+	wr_buf = get_free_pages(GFP_KERNEL, order);
 	if (wr_buf == NULL)
 		return -1;
 
-	rd_buf = (u32 *)__get_free_pages(GFP_KERNEL, order);
+	rd_buf = get_free_pages(GFP_KERNEL, order);
 	if (rd_buf == NULL) {
 		free_pages(wr_buf, order);
 		return -1;
diff --git a/drivers/media/platform/davinci/dm644x_ccdc.c b/drivers/media/platform/davinci/dm644x_ccdc.c
index 42df06f..f816042 100644
--- a/drivers/media/platform/davinci/dm644x_ccdc.c
+++ b/drivers/media/platform/davinci/dm644x_ccdc.c
@@ -268,8 +268,7 @@ static int ccdc_update_raw_params(struct ccdc_config_params_raw *raw_params)
 		}
 
 		/* Allocate memory for FPC table */
-		fpc_virtaddr =
-			(unsigned int *)__get_free_pages(GFP_KERNEL | GFP_DMA,
+		fpc_virtaddr = get_free_pages(GFP_KERNEL | GFP_DMA,
 							 get_order(raw_params->
 							 fault_pxl.fp_num *
 							 FP_NUM_BYTES));
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
index 4620627..6ff5696 100644
--- a/drivers/misc/cxl/native.c
+++ b/drivers/misc/cxl/native.c
@@ -195,8 +195,8 @@ int cxl_alloc_spa(struct cxl_afu *afu)
 
 	WARN_ON(afu->spa_size > 0x100000); /* Max size supported by the hardware */
 
-	if (!(afu->spa = (struct cxl_process_element *)
-	      __get_free_pages(GFP_KERNEL | __GFP_ZERO, afu->spa_order))) {
+	if (!(afu->spa = 
+	      get_free_pages(GFP_KERNEL | __GFP_ZERO, afu->spa_order))) {
 		pr_err("cxl_alloc_spa: Unable to allocate scheduled process area\n");
 		return -ENOMEM;
 	}
diff --git a/drivers/misc/mic/card/mic_virtio.c b/drivers/misc/mic/card/mic_virtio.c
index bb364ee..19e5731 100644
--- a/drivers/misc/mic/card/mic_virtio.c
+++ b/drivers/misc/mic/card/mic_virtio.c
@@ -279,7 +279,7 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev,
 	mvdev->used_size[index] = PAGE_ALIGN(sizeof(__u16) * 3 +
 					     sizeof(struct vring_used_elem) *
 					     le16_to_cpu(config.num));
-	used = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	used = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 					get_order(mvdev->used_size[index]));
 	if (!used) {
 		err = -ENOMEM;
diff --git a/drivers/misc/mic/host/mic_virtio.c b/drivers/misc/mic/host/mic_virtio.c
index 3474aa2..253c525 100644
--- a/drivers/misc/mic/host/mic_virtio.c
+++ b/drivers/misc/mic/host/mic_virtio.c
@@ -649,8 +649,7 @@ int mic_virtio_add_device(struct mic_vdev *mvdev,
 		mutex_init(&mvr->vr_mutex);
 		vr_size = PAGE_ALIGN(vring_size(num, MIC_VIRTIO_RING_ALIGN) +
 			sizeof(struct _mic_vring_info));
-		vr->va = (void *)
-			__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+		vr->va = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 					 get_order(vr_size));
 		if (!vr->va) {
 			ret = -ENOMEM;
@@ -688,7 +687,7 @@ int mic_virtio_add_device(struct mic_vdev *mvdev,
 		dev_dbg(&mdev->pdev->dev,
 			"%s %d index %d va %p info %p vr_size 0x%x\n",
 			__func__, __LINE__, i, vr->va, vr->info, vr_size);
-		mvr->buf = (void *)__get_free_pages(GFP_KERNEL,
+		mvr->buf = get_free_pages(GFP_KERNEL,
 					get_order(MIC_INT_DMA_BUF_SIZE));
 		mvr->buf_da = mic_map_single(mvdev->mdev, mvr->buf,
 					  MIC_INT_DMA_BUF_SIZE);
diff --git a/drivers/misc/mic/scif/scif_rma.h b/drivers/misc/mic/scif/scif_rma.h
index e13ab83..020073e 100644
--- a/drivers/misc/mic/scif/scif_rma.h
+++ b/drivers/misc/mic/scif/scif_rma.h
@@ -402,7 +402,7 @@ static inline void *scif_zalloc(size_t size)
 	size_t align = ALIGN(size, PAGE_SIZE);
 
 	if (align && get_order(align) < MAX_ORDER)
-		ret = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+		ret = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 					       get_order(align));
 	return ret ? ret : vzalloc(align);
 }
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_main.h b/drivers/net/ethernet/cavium/liquidio/octeon_main.h
index b6a90a9..e053e4a 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_main.h
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_main.h
@@ -136,9 +136,7 @@ cnnic_alloc_aligned_dma(struct pci_dev *pci_dev,
 
 #define OCTEON_MAX_ALLOC_RETRIES     1
 	do {
-		ptr =
-		    (void *)__get_free_pages(GFP_KERNEL,
-					     get_order(size));
+		ptr = get_free_pages(GFP_KERNEL, get_order(size));
 		retries++;
 	} while ((retries <= OCTEON_MAX_ALLOC_RETRIES) && !ptr);
 
diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
index e314d3f..6a256b1 100644
--- a/drivers/net/ethernet/sgi/ioc3-eth.c
+++ b/drivers/net/ethernet/sgi/ioc3-eth.c
@@ -932,7 +932,7 @@ static void ioc3_alloc_rings(struct net_device *dev)
 
 	if (ip->txr == NULL) {
 		/* Allocate and initialize tx rings.  16kb = 128 bufs.  */
-		ip->txr = (struct ioc3_etxd *)__get_free_pages(GFP_KERNEL, 2);
+		ip->txr = get_free_pages(GFP_KERNEL, 2);
 		if (!ip->txr)
 			printk("ioc3_alloc_rings(): __get_free_pages() failed!\n");
 		ip->tx_pi = 0;
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index 6095cf4..ec4b640 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -229,7 +229,7 @@ static void *dma_alloc(size_t size, dma_addr_t *dma_handle)
 	void *ret;
 	int gfp = GFP_ATOMIC | GFP_DMA;
 
-	ret = (void *)__get_free_pages(gfp, get_order(size));
+	ret = get_free_pages(gfp, get_order(size));
 
 	if (ret != NULL) {
 		memset(ret, 0, size);
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index d0c1b13..2d060ff 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -467,7 +467,7 @@ static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev)
 	const size_t rionet_active_bytes = sizeof(void *) *
 				RIO_MAX_ROUTE_ENTRIES(mport->sys_size);
 
-	nets[mport->id].active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
+	nets[mport->id].active = get_free_pages(GFP_KERNEL,
 						get_order(rionet_active_bytes));
 	if (!nets[mport->id].active) {
 		rc = -ENOMEM;
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c
index 50a2316..844e290 100644
--- a/drivers/net/wireless/b43/debugfs.c
+++ b/drivers/net/wireless/b43/debugfs.c
@@ -532,7 +532,7 @@ static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,
 	dfile = fops_to_dfs_file(dev, dfops);
 
 	if (!dfile->buffer) {
-		buf = (char *)__get_free_pages(GFP_KERNEL, buforder);
+		buf = get_free_pages(GFP_KERNEL, buforder);
 		if (!buf) {
 			err = -ENOMEM;
 			goto out_unlock;
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c
index e243955..371ece0 100644
--- a/drivers/net/wireless/b43legacy/debugfs.c
+++ b/drivers/net/wireless/b43legacy/debugfs.c
@@ -229,7 +229,7 @@ static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf,
 	dfile = fops_to_dfs_file(dev, dfops);
 
 	if (!dfile->buffer) {
-		buf = (char *)__get_free_pages(GFP_KERNEL, buforder);
+		buf = get_free_pages(GFP_KERNEL, buforder);
 		if (!buf) {
 			err = -ENOMEM;
 			goto out_unlock;
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 374adb1..ec979ba 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -6309,7 +6309,7 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size,
 	init_completion(&wl->nvs_loading_complete);
 
 	order = get_order(aggr_buf_size);
-	wl->aggr_buf = (u8 *)__get_free_pages(GFP_KERNEL, order);
+	wl->aggr_buf = get_free_pages(GFP_KERNEL, order);
 	if (!wl->aggr_buf) {
 		ret = -ENOMEM;
 		goto err_wq;
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index b172617..633c6d4 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -847,7 +847,7 @@ ccio_alloc_consistent(struct device *dev, size_t size, dma_addr_t *dma_handle, g
 		return 0;
 	}
 #endif
-        ret = (void *) __get_free_pages(flag, get_order(size));
+        ret = get_free_pages(flag, get_order(size));
 
 	if (ret) {
 		memset(ret, 0, size);
@@ -1299,8 +1299,7 @@ ccio_ioc_init(struct ioc *ioc)
 			iova_space_size>>20,
 			iov_order + PAGE_SHIFT);
 
-	ioc->pdir_base = (u64 *)__get_free_pages(GFP_KERNEL, 
-						 get_order(ioc->pdir_size));
+	ioc->pdir_base = get_free_pages(GFP_KERNEL, get_order(ioc->pdir_size));
 	if(NULL == ioc->pdir_base) {
 		panic("%s() could not allocate I/O Page Table\n", __func__);
 	}
@@ -1313,8 +1312,7 @@ ccio_ioc_init(struct ioc *ioc)
  	ioc->res_size = (ioc->pdir_size / sizeof(u64)) >> 3;
 	DBG_INIT("%s() res_size 0x%x\n", __func__, ioc->res_size);
 	
-	ioc->res_map = (u8 *)__get_free_pages(GFP_KERNEL, 
-					      get_order(ioc->res_size));
+	ioc->res_map = get_free_pages(GFP_KERNEL, get_order(ioc->res_size));
 	if(NULL == ioc->res_map) {
 		panic("%s() could not allocate resource map\n", __func__);
 	}
diff --git a/drivers/parisc/ccio-rm-dma.c b/drivers/parisc/ccio-rm-dma.c
index b9649c2..e4239f8 100644
--- a/drivers/parisc/ccio-rm-dma.c
+++ b/drivers/parisc/ccio-rm-dma.c
@@ -84,7 +84,7 @@ static void *ccio_alloc_consistent(struct pci_dev *dev, size_t size,
 {
 	void *ret;
 	
-	ret = (void *)__get_free_pages(GFP_ATOMIC, get_order(size));
+	ret = get_free_pages(GFP_ATOMIC, get_order(size));
 
 	if (ret != NULL) {
 		memset(ret, 0, size);
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 6066d4e..10ca71d 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -876,7 +876,7 @@ static void *sba_alloc_consistent(struct device *hwdev, size_t size,
 		return NULL;
 	}
 
-        ret = (void *) __get_free_pages(gfp, get_order(size));
+        ret = get_free_pages(gfp, get_order(size));
 
 	if (ret) {
 		memset(ret, 0, size);
@@ -1283,8 +1283,7 @@ sba_ioc_init_pluto(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
 		__func__, ioc->ioc_hpa, iova_space_size >> 20,
 		iov_order + PAGE_SHIFT);
 
-	ioc->pdir_base = (void *) __get_free_pages(GFP_KERNEL,
-						   get_order(ioc->pdir_size));
+	ioc->pdir_base = get_free_pages(GFP_KERNEL, get_order(ioc->pdir_size));
 	if (!ioc->pdir_base)
 		panic("Couldn't allocate I/O Page Table\n");
 
@@ -1697,7 +1696,7 @@ sba_common_init(struct sba_device *sba_dev)
 			__func__, res_size);
 
 		sba_dev->ioc[i].res_size = res_size;
-		sba_dev->ioc[i].res_map = (char *) __get_free_pages(GFP_KERNEL, get_order(res_size));
+		sba_dev->ioc[i].res_map = get_free_pages(GFP_KERNEL, get_order(res_size));
 
 #ifdef DEBUG_DMB_TRAP
 		iterate_pages( sba_dev->ioc[i].res_map, res_size,
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index ba7fc9e..9d12ce1 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1296,7 +1296,7 @@ static int tegra_pcie_enable_msi(struct tegra_pcie *pcie)
 	}
 
 	/* setup AFI/FPCI range */
-	msi->pages = (void *)__get_free_pages(GFP_KERNEL, 0);
+	msi->pages = get_free_pages(GFP_KERNEL, 0);
 	base = virt_to_phys(msi->pages);
 
 	afi_writel(pcie, base >> soc->msi_base_shift, AFI_MSI_FPCI_BAR_ST);
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 769fc9d..a46c493 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -206,7 +206,7 @@ void dw_pcie_msi_init(struct pcie_port *pp)
 {
 	u64 msi_target;
 
-	pp->msi_data = (void *)__get_free_pages(GFP_KERNEL, 0);
+	pp->msi_data = get_free_pages(GFP_KERNEL, 0);
 	msi_target = virt_to_phys(pp->msi_data);
 
 	/* program the msi_data */
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index fdeb72f..1cf7746 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -734,7 +734,7 @@ static int rcar_pcie_enable_msi(struct rcar_pcie *pcie)
 	}
 
 	/* setup MSI data target */
-	msi->pages = (void *)__get_free_pages(GFP_KERNEL, 0);
+	msi->pages = get_free_pages(GFP_KERNEL, 0);
 	base = virt_to_phys(msi->pages);
 
 	rcar_pci_write_reg(pcie, base | MSIFE, PCIEMSIALR);
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index 3cc679d..a31938b 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -353,7 +353,7 @@ static void xilinx_pcie_enable_msi(struct xilinx_pcie_port *port)
 {
 	phys_addr_t msg_addr;
 
-	port->msi_pages = (void *)__get_free_pages(GFP_KERNEL, 0);
+	port->msi_pages = get_free_pages(GFP_KERNEL, 0);
 	msg_addr = virt_to_phys(port->msi_pages);
 	pcie_write(port, 0x0, XILINX_PCIE_REG_MSIBASE1);
 	pcie_write(port, msg_addr, XILINX_PCIE_REG_MSIBASE2);
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 7b24131..ddab935 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -96,7 +96,7 @@ struct dasd_device *dasd_alloc_device(void)
 		return ERR_PTR(-ENOMEM);
 
 	/* Get two pages for normal block device operations. */
-	device->ccw_mem = (void *) __get_free_pages(GFP_ATOMIC | GFP_DMA, 1);
+	device->ccw_mem = get_free_pages(GFP_ATOMIC | GFP_DMA, 1);
 	if (!device->ccw_mem) {
 		kfree(device);
 		return ERR_PTR(-ENOMEM);
diff --git a/drivers/s390/char/hmcdrv_cache.c b/drivers/s390/char/hmcdrv_cache.c
index 60a4233..98f049b 100644
--- a/drivers/s390/char/hmcdrv_cache.c
+++ b/drivers/s390/char/hmcdrv_cache.c
@@ -217,7 +217,7 @@ int hmcdrv_cache_startup(size_t cachesize)
 	if (cachesize > 0) { /* perform caching ? */
 		hmcdrv_cache_order = get_order(cachesize);
 		hmcdrv_cache_file.content =
-			(void *) __get_free_pages(GFP_KERNEL | GFP_DMA,
+			get_free_pages(GFP_KERNEL | GFP_DMA,
 						  hmcdrv_cache_order);
 
 		if (!hmcdrv_cache_file.content) {
diff --git a/drivers/s390/char/hmcdrv_ftp.c b/drivers/s390/char/hmcdrv_ftp.c
index c08e633..0ee0827 100644
--- a/drivers/s390/char/hmcdrv_ftp.c
+++ b/drivers/s390/char/hmcdrv_ftp.c
@@ -245,7 +245,7 @@ ssize_t hmcdrv_ftp_cmd(char __kernel *cmd, loff_t offset,
 		return retlen;
 
 	order = get_order(ftp.len);
-	ftp.buf = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, order);
+	ftp.buf = get_free_pages(GFP_KERNEL | GFP_DMA, order);
 
 	if (!ftp.buf)
 		return -ENOMEM;
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index bb61f97..f5c9599 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -690,8 +690,8 @@ tty3270_alloc_view(void)
 	tp->rcl_max = 20;
 
 	for (pages = 0; pages < TTY3270_STRING_PAGES; pages++) {
-		tp->freemem_pages[pages] = (void *)
-			__get_free_pages(GFP_KERNEL|GFP_DMA, 0);
+		tp->freemem_pages[pages] = 
+			get_free_pages(GFP_KERNEL|GFP_DMA, 0);
 		if (!tp->freemem_pages[pages])
 			goto out_pages;
 		add_string_memory(&tp->freemem,
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index f73bf6b..fea0a72 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -102,7 +102,7 @@ vmcp_write(struct file *file, const char __user *buff, size_t count,
 		return -ERESTARTSYS;
 	}
 	if (!session->response)
-		session->response = (char *)__get_free_pages(GFP_KERNEL
+		session->response = get_free_pages(GFP_KERNEL
 						| __GFP_REPEAT | GFP_DMA,
 						get_order(session->bufsize));
 	if (!session->response) {
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c
index 70356a3..6ee6ad6 100644
--- a/drivers/s390/cio/cmf.c
+++ b/drivers/s390/cio/cmf.c
@@ -572,7 +572,7 @@ static int alloc_cmb(struct ccw_device *cdev)
 		WARN_ON(!list_empty(&cmb_area.list));
 
 		spin_unlock(&cmb_area.lock);
-		mem = (void*)__get_free_pages(GFP_KERNEL | GFP_DMA,
+		mem = get_free_pages(GFP_KERNEL | GFP_DMA,
 				 get_order(size));
 		spin_lock(&cmb_area.lock);
 
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index d4d6e38..ff85994 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -763,7 +763,7 @@ static int alloc_mem(struct cxlflash_cfg *cfg)
 	struct device *dev = &cfg->dev->dev;
 
 	/* AFU is ~12k, i.e. only one 64k page or up to four 4k pages */
-	cfg->afu = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	cfg->afu = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 					    get_order(sizeof(struct afu)));
 	if (unlikely(!cfg->afu)) {
 		dev_err(dev, "%s: cannot get %d free pages\n",
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index d03ab52..4513104 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2912,8 +2912,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,
 	}
 	spin_unlock_bh(&session->frwd_lock);
 
-	data = (char *) __get_free_pages(GFP_KERNEL,
-					 get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
+	data = get_free_pages(GFP_KERNEL, get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
 	if (!data)
 		goto login_task_data_alloc_fail;
 	conn->login_task->data = conn->data = data;
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 4d9457b..5447150 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -6233,8 +6233,7 @@ lpfc_setup_bg(struct lpfc_hba *phba, struct Scsi_Host *shost)
 	if (!_dump_buf_data) {
 		while (pagecnt) {
 			spin_lock_init(&_dump_buf_lock);
-			_dump_buf_data =
-				(char *) __get_free_pages(GFP_KERNEL, pagecnt);
+			_dump_buf_data = get_free_pages(GFP_KERNEL, pagecnt);
 			if (_dump_buf_data) {
 				lpfc_printf_log(phba, KERN_ERR, LOG_BG,
 					"9043 BLKGRD: allocated %d pages for "
@@ -6257,8 +6256,7 @@ lpfc_setup_bg(struct lpfc_hba *phba, struct Scsi_Host *shost)
 		       "\n", _dump_buf_data);
 	if (!_dump_buf_dif) {
 		while (pagecnt) {
-			_dump_buf_dif =
-				(char *) __get_free_pages(GFP_KERNEL, pagecnt);
+			_dump_buf_dif = get_free_pages(GFP_KERNEL, pagecnt);
 			if (_dump_buf_dif) {
 				lpfc_printf_log(phba, KERN_ERR, LOG_BG,
 					"9046 BLKGRD: allocated %d pages for "
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 2c81ab3..56710df 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -5382,7 +5382,7 @@ static int megasas_probe_one(struct pci_dev *pdev,
 	{
 		instance->ctrl_context_pages =
 			get_order(sizeof(struct fusion_context));
-		instance->ctrl_context = (void *)__get_free_pages(GFP_KERNEL,
+		instance->ctrl_context = get_free_pages(GFP_KERNEL,
 				instance->ctrl_context_pages);
 		if (!instance->ctrl_context) {
 			dev_printk(KERN_DEBUG, &pdev->dev, "Failed to allocate "
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 6429914..f11c3b7 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -1186,7 +1186,7 @@ megasas_init_adapter_fusion(struct megasas_instance *instance)
 	fusion->drv_map_pages = get_order(fusion->drv_map_sz);
 	for (i = 0; i < 2; i++) {
 		fusion->ld_map[i] = NULL;
-		fusion->ld_drv_map[i] = (void *)__get_free_pages(GFP_KERNEL,
+		fusion->ld_drv_map[i] = get_free_pages(GFP_KERNEL,
 			fusion->drv_map_pages);
 		if (!fusion->ld_drv_map[i]) {
 			dev_err(&instance->pdev->dev, "Could not allocate "
@@ -2462,7 +2462,7 @@ megasas_alloc_host_crash_buffer(struct megasas_instance *instance)
 
 	instance->crash_buf_pages = get_order(CRASH_DMA_BUF_SIZE);
 	for (i = 0; i < MAX_CRASH_DUMP_SIZE; i++) {
-		instance->crash_buf[i] = (void	*)__get_free_pages(GFP_KERNEL,
+		instance->crash_buf[i] = get_free_pages(GFP_KERNEL,
 				instance->crash_buf_pages);
 		if (!instance->crash_buf[i]) {
 			dev_info(&instance->pdev->dev, "Firmware crash dump "
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 0d73ea3..13e893a 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -3386,7 +3386,7 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc,  int sleep_flag)
 
 	sz = ioc->scsiio_depth * sizeof(struct scsiio_tracker);
 	ioc->scsi_lookup_pages = get_order(sz);
-	ioc->scsi_lookup = (struct scsiio_tracker *)__get_free_pages(
+	ioc->scsi_lookup = get_free_pages(
 	    GFP_KERNEL, ioc->scsi_lookup_pages);
 	if (!ioc->scsi_lookup) {
 		pr_err(MPT3SAS_FMT "scsi_lookup: get_free_pages failed, sz(%d)\n",
@@ -3400,8 +3400,7 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc,  int sleep_flag)
 	ioc->chain_depth = min_t(u32, ioc->chain_depth, MAX_CHAIN_DEPTH);
 	sz = ioc->chain_depth * sizeof(struct chain_tracker);
 	ioc->chain_pages = get_order(sz);
-	ioc->chain_lookup = (struct chain_tracker *)__get_free_pages(
-	    GFP_KERNEL, ioc->chain_pages);
+	ioc->chain_lookup = get_free_pages(GFP_KERNEL, ioc->chain_pages);
 	if (!ioc->chain_lookup) {
 		pr_err(MPT3SAS_FMT "chain_lookup: __get_free_pages failed\n",
 			ioc->name);
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.h b/drivers/scsi/sym53c8xx_2/sym_hipd.h
index 45f9ac2..6c0161e 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.h
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.h
@@ -1123,7 +1123,7 @@ bad:
  */
 
 #define sym_get_mem_cluster()	\
-	(void *) __get_free_pages(GFP_ATOMIC, SYM_MEM_PAGE_ORDER)
+	get_free_pages(GFP_ATOMIC, SYM_MEM_PAGE_ORDER)
 #define sym_free_mem_cluster(p)	\
 	free_pages(p, SYM_MEM_PAGE_ORDER)
 
diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index 7921fc8..16467b53 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -1251,8 +1251,7 @@ static int pvscsi_allocate_sg(struct pvscsi_adapter *adapter)
 	BUILD_BUG_ON(sizeof(struct pvscsi_sg_list) > SGL_SIZE);
 
 	for (i = 0; i < adapter->req_depth; ++i, ++ctx) {
-		ctx->sgl = (void *)__get_free_pages(GFP_KERNEL,
-						    get_order(SGL_SIZE));
+		ctx->sgl = get_free_pages(GFP_KERNEL, get_order(SGL_SIZE));
 		ctx->sglPA = 0;
 		BUG_ON(!IS_ALIGNED(((unsigned long)ctx->sgl), PAGE_SIZE));
 		if (!ctx->sgl) {
diff --git a/drivers/sh/maple/maple.c b/drivers/sh/maple/maple.c
index 84fa4f7..4495a56 100644
--- a/drivers/sh/maple/maple.c
+++ b/drivers/sh/maple/maple.c
@@ -738,8 +738,7 @@ static int maple_set_vblank_interrupt_handler(void)
 
 static int maple_get_dma_buffer(void)
 {
-	maple_sendbuf =
-	    (void *) __get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	maple_sendbuf = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 				      MAPLE_DMA_PAGES);
 	if (!maple_sendbuf)
 		return -ENOMEM;
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index b741639..3163ae4 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -513,7 +513,7 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes,
 		return 0;
 	/* allocate 2^1 pages = 8K (on i386);
 	 * should be more than enough for one device */
-	pages_start = (char *)__get_free_pages(GFP_NOIO, 1);
+	pages_start = get_free_pages(GFP_NOIO, 1);
 	if (!pages_start)
 		return -ENOMEM;
 
diff --git a/drivers/video/fbdev/fb-puv3.c b/drivers/video/fbdev/fb-puv3.c
index 88fa2e7..e6dfba5 100644
--- a/drivers/video/fbdev/fb-puv3.c
+++ b/drivers/video/fbdev/fb-puv3.c
@@ -671,7 +671,7 @@ static int unifb_probe(struct platform_device *dev)
 	struct resource *iomem;
 	void *videomemory;
 
-	videomemory = (void *)__get_free_pages(GFP_KERNEL | __GFP_COMP,
+	videomemory = get_free_pages(GFP_KERNEL | __GFP_COMP,
 				get_order(UNIFB_MEMSIZE));
 	if (!videomemory)
 		goto err;
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index fa34808..ba475e1 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -592,7 +592,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
 
 	vmem_size = par->width * par->height / 8;
 
-	vmem = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	vmem = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 					get_order(vmem_size));
 	if (!vmem) {
 		dev_err(&client->dev, "Couldn't allocate graphical memory.\n");
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 40c9ef6..459cb01731 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1677,8 +1677,7 @@ int ceph_alloc_readdir_reply_buffer(struct ceph_mds_request *req,
 
 	order = get_order(size * num_entries);
 	while (order >= 0) {
-		rinfo->dir_in = (void*)__get_free_pages(GFP_KERNEL |
-							__GFP_NOWARN,
+		rinfo->dir_in = get_free_pages(GFP_KERNEL | __GFP_NOWARN,
 							order);
 		if (rinfo->dir_in)
 			break;
diff --git a/fs/configfs/file.c b/fs/configfs/file.c
index c4a3c5c..0fd6d8e 100644
--- a/fs/configfs/file.c
+++ b/fs/configfs/file.c
@@ -140,7 +140,7 @@ fill_write_buffer(struct configfs_buffer * buffer, const char __user * buf, size
 	int error;
 
 	if (!buffer->page)
-		buffer->page = (char *)__get_free_pages(GFP_KERNEL, 0);
+		buffer->page = get_free_pages(GFP_KERNEL, 0);
 	if (!buffer->page)
 		return -ENOMEM;
 
diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c
index 92f1730..914a40e 100644
--- a/fs/hfs/mdb.c
+++ b/fs/hfs/mdb.c
@@ -166,7 +166,7 @@ int hfs_mdb_get(struct super_block *sb)
 		pr_warn("continuing without an alternate MDB\n");
 	}
 
-	HFS_SB(sb)->bitmap = (__be32 *)__get_free_pages(GFP_KERNEL, PAGE_SIZE < 8192 ? 1 : 0);
+	HFS_SB(sb)->bitmap = get_free_pages(GFP_KERNEL, PAGE_SIZE < 8192 ? 1 : 0);
 	if (!HFS_SB(sb)->bitmap)
 		goto out;
 
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 450a30b..337faf2 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2301,12 +2301,12 @@ void *jbd2_alloc(size_t size, gfp_t flags)
 
 	flags |= __GFP_REPEAT;
 	if (size == PAGE_SIZE)
-		ptr = (void *)__get_free_pages(flags, 0);
+		ptr = get_free_pages(flags, 0);
 	else if (size > PAGE_SIZE) {
 		int order = get_order(size);
 
 		if (order < 3)
-			ptr = (void *)__get_free_pages(flags, order);
+			ptr = get_free_pages(flags, order);
 		else
 			ptr = vmalloc(size);
 	} else
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index 09d2ede..da2c0ee 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -84,7 +84,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
 	if (argv->v_index > ~(__u64)0 - argv->v_nmembs)
 		return -EINVAL;
 
-	buf = (void *)__get_free_pages(GFP_NOFS, 0);
+	buf = get_free_pages(GFP_NOFS, 0);
 	if (unlikely(!buf))
 		return -ENOMEM;
 	maxmembs = PAGE_SIZE / argv->v_size;
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index dd6566c..b4cf217 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -1027,7 +1027,7 @@ static int __init parse_crash_elf64_headers(void)
 	elfcorebuf_sz_orig = sizeof(Elf64_Ehdr) +
 				ehdr.e_phnum * sizeof(Elf64_Phdr);
 	elfcorebuf_sz = elfcorebuf_sz_orig;
-	elfcorebuf = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	elfcorebuf = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 					      get_order(elfcorebuf_sz_orig));
 	if (!elfcorebuf)
 		return -ENOMEM;
@@ -1082,7 +1082,7 @@ static int __init parse_crash_elf32_headers(void)
 	/* Read in all elf headers. */
 	elfcorebuf_sz_orig = sizeof(Elf32_Ehdr) + ehdr.e_phnum * sizeof(Elf32_Phdr);
 	elfcorebuf_sz = elfcorebuf_sz_orig;
-	elfcorebuf = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+	elfcorebuf = get_free_pages(GFP_KERNEL | __GFP_ZERO,
 					      get_order(elfcorebuf_sz_orig));
 	if (!elfcorebuf)
 		return -ENOMEM;
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index ef0d64b..b814eeb 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2894,7 +2894,7 @@ static int __init dquot_init(void)
 			NULL);
 
 	order = 0;
-	dquot_hash = (struct hlist_head *)__get_free_pages(GFP_ATOMIC, order);
+	dquot_hash = get_free_pages(GFP_ATOMIC, order);
 	if (!dquot_hash)
 		panic("Cannot create dquot hash table");
 
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 927cdd4..1d42951 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2924,7 +2924,7 @@ static int ftrace_allocate_records(struct ftrace_page *pg, int count)
 		order--;
 
  again:
-	pg->records = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
+	pg->records = get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
 
 	if (!pg->records) {
 		/* if we can't allocate this size, try something smaller */
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 5d06111..0a0a08e 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1640,8 +1640,7 @@ ftrace_event_pid_write(struct file *filp, const char __user *ubuf,
 			else
 				pid_list->order = 0;
 
-			pid_list->pids = (void *)__get_free_pages(GFP_KERNEL,
-								  pid_list->order);
+			pid_list->pids = get_free_pages(GFP_KERNEL, pid_list->order);
 			if (!pid_list->pids)
 				break;
 
@@ -1656,8 +1655,7 @@ ftrace_event_pid_write(struct file *filp, const char __user *ubuf,
 		if (pid_list->nr_pids >= max_pids(pid_list)) {
 			pid_t *pid_page;
 
-			pid_page = (void *)__get_free_pages(GFP_KERNEL,
-							    pid_list->order + 1);
+			pid_page = get_free_pages(GFP_KERNEL, pid_list->order + 1);
 			if (!pid_page)
 				break;
 			memcpy(pid_page, pid_list->pids,
diff --git a/lib/percpu_ida.c b/lib/percpu_ida.c
index d58f5a9..ef95209 100644
--- a/lib/percpu_ida.c
+++ b/lib/percpu_ida.c
@@ -303,7 +303,7 @@ int __percpu_ida_init(struct percpu_ida *pool, unsigned long nr_tags,
 	}
 
 	order = get_order(nr_tags * sizeof(unsigned));
-	pool->freelist = (void *) __get_free_pages(GFP_KERNEL, order);
+	pool->freelist = get_free_pages(GFP_KERNEL, order);
 	if (!pool->freelist)
 		return -ENOMEM;
 
diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c
index 3d8cf31..c98026d 100644
--- a/lib/raid6/algos.c
+++ b/lib/raid6/algos.c
@@ -218,7 +218,7 @@ int __init raid6_select_algo(void)
 		dptrs[i] = ((char *)raid6_gfmul) + PAGE_SIZE*i;
 
 	/* Normal code - use a 2-page allocation to avoid D$ conflict */
-	syndromes = (void *) __get_free_pages(GFP_KERNEL, 1);
+	syndromes = get_free_pages(GFP_KERNEL, 1);
 
 	if (!syndromes) {
 		pr_err("raid6: Yikes!  No memory available.\n");
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 87e33e7..456e38d 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -260,7 +260,7 @@ swiotlb_late_init_with_default_size(size_t default_size)
 	bytes = io_tlb_nslabs << IO_TLB_SHIFT;
 
 	while ((SLABS_PER_PAGE << order) > IO_TLB_MIN_SLABS) {
-		vstart = (void *)__get_free_pages(GFP_DMA | __GFP_NOWARN,
+		vstart = get_free_pages(GFP_DMA | __GFP_NOWARN,
 						  order);
 		if (vstart)
 			break;
@@ -299,8 +299,7 @@ swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs)
 	/*
 	 * Get the overflow emergency buffer
 	 */
-	v_overflow_buffer = (void *)__get_free_pages(GFP_DMA,
-						     get_order(io_tlb_overflow));
+	v_overflow_buffer = get_free_pages(GFP_DMA, get_order(io_tlb_overflow));
 	if (!v_overflow_buffer)
 		goto cleanup2;
 
@@ -311,13 +310,12 @@ swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs)
 	 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
 	 * between io_tlb_start and io_tlb_end.
 	 */
-	io_tlb_list = (unsigned int *)__get_free_pages(GFP_KERNEL,
+	io_tlb_list = get_free_pages(GFP_KERNEL,
 	                              get_order(io_tlb_nslabs * sizeof(int)));
 	if (!io_tlb_list)
 		goto cleanup3;
 
-	io_tlb_orig_addr = (phys_addr_t *)
-		__get_free_pages(GFP_KERNEL,
+	io_tlb_orig_addr = get_free_pages(GFP_KERNEL,
 				 get_order(io_tlb_nslabs *
 					   sizeof(phys_addr_t)));
 	if (!io_tlb_orig_addr)
@@ -634,7 +632,7 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
 	if (hwdev && hwdev->coherent_dma_mask)
 		dma_mask = hwdev->coherent_dma_mask;
 
-	ret = (void *)__get_free_pages(flags, order);
+	ret = get_free_pages(flags, order);
 	if (ret) {
 		dev_addr = swiotlb_virt_to_bus(hwdev, ret);
 		if (dev_addr + size - 1 > dma_mask) {
diff --git a/mm/memory.c b/mm/memory.c
index 8364c20..a3c4440 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -194,7 +194,7 @@ static bool tlb_next_batch(struct mmu_gather *tlb)
 	if (tlb->batch_count == MAX_GATHER_BATCH_COUNT)
 		return false;
 
-	batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0);
+	batch = get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0);
 	if (!batch)
 		return false;
 
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9ab053f..a4d01ea 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3276,7 +3276,7 @@ EXPORT_SYMBOL(get_free_pages);
 
 void *get_zeroed_page(gfp_t gfp_mask)
 {
-	return (void *)__get_free_pages(gfp_mask | __GFP_ZERO, 0);
+	return get_free_pages(gfp_mask | __GFP_ZERO, 0);
 }
 EXPORT_SYMBOL(get_zeroed_page);
 
@@ -3481,7 +3481,7 @@ static void *make_alloc_exact(void *addr, unsigned int order,
 void *alloc_pages_exact(size_t size, gfp_t gfp_mask)
 {
 	unsigned int order = get_order(size);
-	void *addr = (void *)__get_free_pages(gfp_mask, order);
+	void *addr = get_free_pages(gfp_mask, order);
 	return make_alloc_exact(addr, order, size);
 }
 EXPORT_SYMBOL(alloc_pages_exact);
diff --git a/mm/slub.c b/mm/slub.c
index 5da985fe..c04a507 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4206,7 +4206,7 @@ static int alloc_loc_track(struct loc_track *t, unsigned long max, gfp_t flags)
 
 	order = get_order(sizeof(struct location) * max);
 
-	l = (void *)__get_free_pages(flags, order);
+	l = get_free_pages(flags, order);
 	if (!l)
 		return 0;
 
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 6eb5170..621eaac 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -327,8 +327,7 @@ static struct neigh_hash_table *neigh_hash_alloc(unsigned int shift)
 	if (size <= PAGE_SIZE)
 		buckets = kzalloc(size, GFP_ATOMIC);
 	else
-		buckets = (struct neighbour __rcu **)
-			  __get_free_pages(GFP_ATOMIC | __GFP_ZERO,
+		buckets = get_free_pages(GFP_ATOMIC | __GFP_ZERO,
 					   get_order(size));
 	if (!buckets) {
 		kfree(ret);
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index b689ca8..77c2afe 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -1147,8 +1147,8 @@ static int __init dccp_init(void)
 		while (hash_size & (hash_size - 1))
 			hash_size--;
 		dccp_hashinfo.ehash_mask = hash_size - 1;
-		dccp_hashinfo.ehash = (struct inet_ehash_bucket *)
-			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, ehash_order);
+		dccp_hashinfo.ehash = 
+			get_free_pages(GFP_ATOMIC|__GFP_NOWARN, ehash_order);
 	} while (!dccp_hashinfo.ehash && --ehash_order > 0);
 
 	if (!dccp_hashinfo.ehash) {
@@ -1170,8 +1170,8 @@ static int __init dccp_init(void)
 		if ((dccp_hashinfo.bhash_size > (64 * 1024)) &&
 		    bhash_order > 0)
 			continue;
-		dccp_hashinfo.bhash = (struct inet_bind_hashbucket *)
-			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, bhash_order);
+		dccp_hashinfo.bhash =
+			get_free_pages(GFP_ATOMIC|__GFP_NOWARN, bhash_order);
 	} while (!dccp_hashinfo.bhash && --bhash_order >= 0);
 
 	if (!dccp_hashinfo.bhash) {
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 607a14f..9aae75d 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1894,8 +1894,7 @@ void __init dn_route_init(void)
 			sizeof(struct dn_rt_hash_bucket);
 		while(dn_rt_hash_mask & (dn_rt_hash_mask - 1))
 			dn_rt_hash_mask--;
-		dn_rt_hash_table = (struct dn_rt_hash_bucket *)
-			__get_free_pages(GFP_ATOMIC, order);
+		dn_rt_hash_table = get_free_pages(GFP_ATOMIC, order);
 	} while (dn_rt_hash_table == NULL && --order > 0);
 
 	if (!dn_rt_hash_table)
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index f69b6d9..fddffc1 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -840,8 +840,7 @@ static struct hlist_head *fib_info_hash_alloc(int bytes)
 	if (bytes <= PAGE_SIZE)
 		return kzalloc(bytes, GFP_KERNEL);
 	else
-		return (struct hlist_head *)
-			__get_free_pages(GFP_KERNEL | __GFP_ZERO,
+		return get_free_pages(GFP_KERNEL | __GFP_ZERO,
 					 get_order(bytes));
 }
 
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 5a80da65..9124509 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1544,7 +1544,7 @@ void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls)
 	BUILD_BUG_ON(sizeof(struct hlist_nulls_head) != sizeof(struct hlist_head));
 	nr_slots = *sizep = roundup(*sizep, PAGE_SIZE / sizeof(struct hlist_nulls_head));
 	sz = nr_slots * sizeof(struct hlist_nulls_head);
-	hash = (void *)__get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO,
+	hash = get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO,
 					get_order(sz));
 	if (!hash)
 		hash = vzalloc(sz);
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index da6fba6..587eb78 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -340,7 +340,7 @@ static void *alloc_one_pg_vec_page(unsigned long order)
 	gfp_t gfp_flags = GFP_KERNEL | __GFP_COMP | __GFP_ZERO |
 			  __GFP_NOWARN | __GFP_NORETRY;
 
-	buffer = (void *)__get_free_pages(gfp_flags, order);
+	buffer = get_free_pages(gfp_flags, order);
 	if (buffer != NULL)
 		return buffer;
 
@@ -349,7 +349,7 @@ static void *alloc_one_pg_vec_page(unsigned long order)
 		return buffer;
 
 	gfp_flags &= ~__GFP_NORETRY;
-	return (void *)__get_free_pages(gfp_flags, order);
+	return get_free_pages(gfp_flags, order);
 }
 
 static void **alloc_pg_vec(struct netlink_sock *nlk,
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index fae2812..c1d1284 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4013,7 +4013,7 @@ static char *alloc_one_pg_vec_page(unsigned long order)
 	gfp_t gfp_flags = GFP_KERNEL | __GFP_COMP |
 			  __GFP_ZERO | __GFP_NOWARN | __GFP_NORETRY;
 
-	buffer = (char *) __get_free_pages(gfp_flags, order);
+	buffer = get_free_pages(gfp_flags, order);
 	if (buffer)
 		return buffer;
 
@@ -4024,7 +4024,7 @@ static char *alloc_one_pg_vec_page(unsigned long order)
 
 	/* vmalloc failed, lets dig into swap here */
 	gfp_flags &= ~__GFP_NORETRY;
-	buffer = (char *) __get_free_pages(gfp_flags, order);
+	buffer = get_free_pages(gfp_flags, order);
 	if (buffer)
 		return buffer;
 
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 1c9ff0b..4c854f0 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -628,8 +628,7 @@ static struct hlist_head *qdisc_class_hash_alloc(unsigned int n)
 	if (size <= PAGE_SIZE)
 		h = kmalloc(size, GFP_KERNEL);
 	else
-		h = (struct hlist_head *)
-			__get_free_pages(GFP_KERNEL, get_order(size));
+		h = get_free_pages(GFP_KERNEL, get_order(size));
 
 	if (h != NULL) {
 		for (i = 0; i < n; i++)
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 8dfdd0e..4e44dfd 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1418,8 +1418,8 @@ static __init int sctp_init(void)
 					sizeof(struct sctp_hashbucket);
 		if ((sctp_assoc_hashsize > (64 * 1024)) && order > 0)
 			continue;
-		sctp_assoc_hashtable = (struct sctp_hashbucket *)
-			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
+		sctp_assoc_hashtable = 
+			get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
 	} while (!sctp_assoc_hashtable && --order > 0);
 	if (!sctp_assoc_hashtable) {
 		pr_err("Failed association hash alloc\n");
@@ -1451,8 +1451,8 @@ static __init int sctp_init(void)
 					sizeof(struct sctp_bind_hashbucket);
 		if ((sctp_port_hashsize > (64 * 1024)) && order > 0)
 			continue;
-		sctp_port_hashtable = (struct sctp_bind_hashbucket *)
-			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
+		sctp_port_hashtable =
+			get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
 	} while (!sctp_port_hashtable && --order > 0);
 	if (!sctp_port_hashtable) {
 		pr_err("Failed bind hash alloc\n");
diff --git a/net/sctp/ssnmap.c b/net/sctp/ssnmap.c
index 97b1939..e3e290c 100644
--- a/net/sctp/ssnmap.c
+++ b/net/sctp/ssnmap.c
@@ -59,8 +59,7 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
 	if (size <= KMALLOC_MAX_SIZE)
 		retval = kmalloc(size, gfp);
 	else
-		retval = (struct sctp_ssnmap *)
-			  __get_free_pages(gfp, get_order(size));
+		retval = get_free_pages(gfp, get_order(size));
 	if (!retval)
 		goto fail;
 
diff --git a/net/xfrm/xfrm_hash.c b/net/xfrm/xfrm_hash.c
index f19872e..47c40d3 100644
--- a/net/xfrm/xfrm_hash.c
+++ b/net/xfrm/xfrm_hash.c
@@ -21,8 +21,7 @@ struct hlist_head *xfrm_hash_alloc(unsigned int sz)
 	else if (hashdist)
 		n = vzalloc(sz);
 	else
-		n = (struct hlist_head *)
-			__get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO,
+		n = get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO,
 					 get_order(sz));
 
 	return n;
diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c
index 96f416c..f52bf51 100644
--- a/security/integrity/ima/ima_crypto.c
+++ b/security/integrity/ima/ima_crypto.c
@@ -132,7 +132,7 @@ static void *ima_alloc_pages(loff_t max_size, size_t *allocated_size,
 		order = min(get_order(max_size), order);
 
 	for (; order; order--) {
-		ptr = (void *)__get_free_pages(gfp_mask, order);
+		ptr = get_free_pages(gfp_mask, order);
 		if (ptr) {
 			*allocated_size = PAGE_SIZE << order;
 			return ptr;
@@ -146,7 +146,7 @@ static void *ima_alloc_pages(loff_t max_size, size_t *allocated_size,
 	if (!last_warn)
 		gfp_mask |= __GFP_NOWARN;
 
-	ptr = (void *)__get_free_pages(gfp_mask, 0);
+	ptr = get_free_pages(gfp_mask, 0);
 	if (ptr) {
 		*allocated_size = PAGE_SIZE;
 		return ptr;
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 43ac8b5..3a0b54c 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -52,7 +52,7 @@ void *snd_malloc_pages(size_t size, gfp_t gfp_flags)
 		return NULL;
 	gfp_flags |= __GFP_COMP;	/* compound page lets parts be mapped */
 	pg = get_order(size);
-	return (void *) __get_free_pages(gfp_flags, pg);
+	return get_free_pages(gfp_flags, pg);
 }
 
 /**
diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c
index 457755a..e7c45ab 100644
--- a/sound/oss/dmabuf.c
+++ b/sound/oss/dmabuf.c
@@ -91,7 +91,7 @@ static int sound_alloc_dmap(struct dma_buffparms *dmap)
 	while (start_addr == NULL && dmap->buffsize > PAGE_SIZE) {
 		for (sz = 0, size = PAGE_SIZE; size < dmap->buffsize; sz++, size <<= 1);
 		dmap->buffsize = PAGE_SIZE * (1 << sz);
-		start_addr = (char *) __get_free_pages(GFP_ATOMIC|GFP_DMA|__GFP_NOWARN, sz);
+		start_addr = get_free_pages(GFP_ATOMIC|GFP_DMA|__GFP_NOWARN, sz);
 		if (start_addr == NULL)
 			dmap->buffsize /= 2;
 	}
diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c
index c423951..8ca8200 100644
--- a/sound/usb/usx2y/usb_stream.c
+++ b/sound/usb/usx2y/usb_stream.c
@@ -191,7 +191,7 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
 	}
 
 	pg = get_order(read_size);
-	sk->s = (void *) __get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO, pg);
+	sk->s = get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO, pg);
 	if (!sk->s) {
 		snd_printk(KERN_WARNING "couldn't __get_free_pages()\n");
 		goto out;
@@ -210,8 +210,7 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
 	sk->s->write_size = write_size;
 	pg = get_order(write_size);
 
-	sk->write_page =
-		(void *)__get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO, pg);
+	sk->write_page = get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO, pg);
 	if (!sk->write_page) {
 		snd_printk(KERN_WARNING "couldn't __get_free_pages()\n");
 		usb_stream_free(sk);
-- 
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