[POC][PATCH 01/83] switch free_page() from unsigned long to const void *
From: Al Viro
Date: Mon Dec 21 2015 - 19:10:00 EST
From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
---
arch/alpha/include/asm/pgalloc.h | 6 ++--
arch/alpha/kernel/srm_env.c | 4 +--
arch/arc/include/asm/page.h | 2 +-
arch/arc/kernel/setup.c | 2 +-
arch/arc/kernel/troubleshoot.c | 4 +--
arch/arm/include/asm/page-nommu.h | 2 +-
arch/arm/include/asm/pgalloc.h | 4 +--
arch/arm/kvm/arm.c | 2 +-
arch/arm/kvm/mmu.c | 4 +--
arch/arm64/include/asm/pgalloc.h | 6 ++--
arch/arm64/mm/pgd.c | 2 +-
arch/c6x/include/asm/processor.h | 2 +-
arch/cris/include/asm/pgalloc.h | 4 +--
arch/cris/mm/init.c | 2 +-
arch/frv/include/asm/page.h | 2 +-
arch/frv/include/asm/pgalloc.h | 2 +-
arch/hexagon/include/asm/pgalloc.h | 4 +--
arch/ia64/hp/sim/simserial.c | 4 +--
arch/m32r/include/asm/pgalloc.h | 4 +--
arch/m68k/include/asm/mcf_pgalloc.h | 4 +--
arch/m68k/include/asm/motorola_pgalloc.h | 2 +-
arch/m68k/include/asm/page_mm.h | 2 +-
arch/m68k/include/asm/page_no.h | 2 +-
arch/m68k/include/asm/sun3_pgalloc.h | 4 +--
arch/m68k/mm/memory.c | 2 +-
arch/metag/include/asm/pgalloc.h | 4 +--
arch/microblaze/include/asm/pgalloc.h | 4 +--
arch/mn10300/include/asm/pgalloc.h | 2 +-
arch/openrisc/include/asm/page.h | 2 +-
arch/openrisc/include/asm/pgalloc.h | 4 +--
arch/parisc/include/asm/pgalloc.h | 2 +-
arch/powerpc/include/asm/pgalloc-32.h | 4 +--
arch/powerpc/include/asm/pgalloc-64.h | 4 +--
arch/powerpc/kvm/book3s_pr.c | 2 +-
arch/powerpc/kvm/e500.c | 2 +-
arch/powerpc/kvm/e500mc.c | 2 +-
arch/powerpc/mm/hugetlbpage.c | 2 +-
arch/powerpc/mm/subpage-prot.c | 6 ++--
arch/powerpc/platforms/cell/spufs/coredump.c | 4 +--
arch/powerpc/platforms/pseries/cmm.c | 16 +++++-----
arch/powerpc/platforms/pseries/pseries_energy.c | 4 +--
arch/s390/crypto/aes_s390.c | 4 +--
arch/s390/crypto/des_s390.c | 2 +-
arch/s390/crypto/prng.c | 2 +-
arch/s390/hypfs/hypfs_sprp.c | 6 ++--
arch/s390/kernel/ipl.c | 8 ++---
arch/s390/kernel/kprobes.c | 2 +-
arch/s390/kernel/perf_cpum_sf.c | 4 +--
arch/s390/kernel/setup.c | 2 +-
arch/s390/kernel/smp.c | 4 +--
arch/s390/kernel/suspend.c | 2 +-
arch/s390/kernel/sysinfo.c | 4 +--
arch/s390/kernel/time.c | 2 +-
arch/s390/kernel/vdso.c | 8 ++---
arch/s390/kvm/kvm-s390.c | 14 ++++-----
arch/s390/kvm/priv.c | 4 +--
arch/s390/mm/cmm.c | 8 ++---
arch/s390/mm/maccess.c | 4 +--
arch/s390/mm/pgtable.c | 2 +-
arch/s390/oprofile/hwsampler.c | 8 ++---
arch/sh/boards/mach-hp6xx/pm.c | 2 +-
arch/sparc/kernel/iommu.c | 2 +-
arch/sparc/mm/init_64.c | 2 +-
arch/tile/mm/elf.c | 2 +-
arch/um/drivers/mconsole_kern.c | 2 +-
arch/um/include/asm/pgalloc.h | 4 +--
arch/um/kernel/mem.c | 2 +-
arch/um/kernel/skas/mmu.c | 4 +--
arch/unicore32/include/asm/pgalloc.h | 2 +-
arch/x86/include/asm/pgalloc.h | 6 ++--
arch/x86/kernel/cpu/perf_event_intel_pt.c | 2 +-
arch/x86/kernel/ldt.c | 2 +-
arch/x86/kernel/machine_kexec_32.c | 10 +++----
arch/x86/kernel/machine_kexec_64.c | 6 ++--
arch/x86/kvm/lapic.c | 2 +-
arch/x86/kvm/mmu.c | 10 +++----
arch/x86/kvm/vmx.c | 36 +++++++++++------------
arch/x86/kvm/x86.c | 4 +--
arch/x86/mm/pageattr.c | 6 ++--
arch/x86/mm/pgtable.c | 8 ++---
arch/x86/pci/pcbios.c | 2 +-
arch/x86/um/ldt.c | 2 +-
arch/x86/xen/mmu.c | 2 +-
arch/x86/xen/p2m.c | 2 +-
arch/xtensa/include/asm/pgalloc.h | 4 +--
block/partitions/check.c | 4 +--
crypto/blkcipher.c | 2 +-
crypto/tcrypt.c | 6 ++--
crypto/testmgr.c | 4 +--
drivers/acpi/apei/ghes.c | 2 +-
drivers/acpi/nvs.c | 2 +-
drivers/atm/eni.c | 2 +-
drivers/atm/lanai.c | 2 +-
drivers/auxdisplay/cfag12864b.c | 4 +--
drivers/block/aoe/aoecmd.c | 2 +-
drivers/block/cciss.c | 2 +-
drivers/block/drbd/drbd_main.c | 4 +--
drivers/char/agp/amd-k7-agp.c | 2 +-
drivers/char/agp/ati-agp.c | 2 +-
drivers/char/agp/efficeon-agp.c | 2 +-
drivers/char/agp/sworks-agp.c | 2 +-
drivers/char/mem.c | 4 +--
drivers/char/pcmcia/synclink_cs.c | 2 +-
drivers/char/tpm/tpm_ibmvtpm.c | 4 +--
drivers/char/tpm/xen-tpmfront.c | 2 +-
drivers/char/xilinx_hwicap/xilinx_hwicap.c | 14 ++++-----
drivers/crypto/atmel-aes.c | 8 ++---
drivers/crypto/atmel-tdes.c | 8 ++---
drivers/crypto/nx/nx-842.c | 8 ++---
drivers/dma/nbpfaxi.c | 2 +-
drivers/dma/sh/rcar-dmac.c | 2 +-
drivers/extcon/extcon.c | 2 +-
drivers/firewire/ohci.c | 4 +--
drivers/gpu/drm/via/via_dmablit.c | 2 +-
drivers/hsi/clients/cmt_speech.c | 4 +--
drivers/hv/hv.c | 6 ++--
drivers/ide/ide-proc.c | 6 ++--
drivers/infiniband/core/device.c | 2 +-
drivers/infiniband/core/umem.c | 4 +--
drivers/infiniband/core/umem_odp.c | 2 +-
drivers/infiniband/hw/cxgb3/iwch_provider.c | 2 +-
drivers/infiniband/hw/cxgb4/device.c | 2 +-
drivers/infiniband/hw/cxgb4/mem.c | 2 +-
drivers/infiniband/hw/mlx4/mr.c | 2 +-
drivers/infiniband/hw/mlx5/mr.c | 2 +-
drivers/infiniband/hw/mlx5/odp.c | 2 +-
drivers/infiniband/hw/mthca/mthca_allocator.c | 4 +--
drivers/infiniband/hw/mthca/mthca_provider.c | 2 +-
drivers/infiniband/hw/qib/qib_qp.c | 4 +--
drivers/infiniband/hw/usnic/usnic_uiom.c | 2 +-
drivers/input/misc/xen-kbdfront.c | 2 +-
drivers/iommu/amd_iommu.c | 18 ++++++------
drivers/iommu/amd_iommu_v2.c | 6 ++--
drivers/iommu/dmar.c | 4 +--
drivers/iommu/intel-iommu.c | 2 +-
drivers/iommu/msm_iommu.c | 5 ++--
drivers/iommu/rockchip-iommu.c | 4 +--
drivers/irqchip/irq-gic-v3-its.c | 2 +-
drivers/lguest/lguest_user.c | 4 +--
drivers/lguest/page_tables.c | 8 ++---
drivers/macintosh/rack-meter.c | 4 +--
drivers/media/pci/pt1/pt1.c | 4 +--
drivers/media/pci/saa7134/saa7134-go7007.c | 8 ++---
drivers/media/pci/ttpci/av7110_ca.c | 2 +-
drivers/media/pci/zoran/zoran_driver.c | 4 +--
drivers/misc/cxl/context.c | 2 +-
drivers/misc/cxl/pci.c | 2 +-
drivers/misc/ibmasm/ibmasmfs.c | 2 +-
drivers/misc/lkdtm.c | 10 +++----
drivers/net/ethernet/i825xx/82596.c | 4 +--
drivers/net/ethernet/ibm/ehea/ehea_main.c | 26 ++++++++--------
drivers/net/ethernet/ibm/ehea/ehea_qmr.c | 8 ++---
drivers/net/ethernet/ibm/ibmveth.c | 4 +--
drivers/net/ethernet/seeq/sgiseeq.c | 2 +-
drivers/net/ethernet/sfc/mcdi.c | 4 +--
drivers/net/ethernet/sgi/ioc3-eth.c | 2 +-
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 12 ++++----
drivers/net/usb/kaweth.c | 2 +-
drivers/net/wan/z85230.c | 8 ++---
drivers/net/wireless/b43/debugfs.c | 2 +-
drivers/net/wireless/b43legacy/debugfs.c | 2 +-
drivers/net/wireless/libertas/debugfs.c | 34 ++++++++++-----------
drivers/net/wireless/mwifiex/debugfs.c | 26 ++++++++--------
drivers/net/wireless/ti/wlcore/main.c | 4 +--
drivers/net/xen-netfront.c | 4 +--
drivers/pci/xen-pcifront.c | 2 +-
drivers/platform/x86/dell-laptop.c | 4 +--
drivers/power/power_supply_sysfs.c | 2 +-
drivers/s390/block/dasd.c | 4 +--
drivers/s390/block/dasd_diag.c | 2 +-
drivers/s390/block/dasd_eckd.c | 8 ++---
drivers/s390/block/dasd_eer.c | 2 +-
drivers/s390/block/dasd_fba.c | 2 +-
drivers/s390/block/scm_blk.c | 2 +-
drivers/s390/block/scm_blk_cluster.c | 2 +-
drivers/s390/block/xpram.c | 4 +--
drivers/s390/char/diag_ftp.c | 2 +-
drivers/s390/char/hmcdrv_ftp.c | 2 +-
drivers/s390/char/sclp_async.c | 4 +--
drivers/s390/char/sclp_cmd.c | 14 ++++-----
drivers/s390/char/sclp_cpi_sys.c | 2 +-
drivers/s390/char/sclp_ctl.c | 2 +-
drivers/s390/char/sclp_ftp.c | 4 +--
drivers/s390/char/sclp_vt220.c | 2 +-
drivers/s390/char/vmlogrdr.c | 2 +-
drivers/s390/char/vmur.c | 4 +--
drivers/s390/char/zcore.c | 4 +--
drivers/s390/cio/chsc.c | 16 +++++-----
drivers/s390/cio/chsc_sch.c | 24 +++++++--------
drivers/s390/cio/qdio_main.c | 2 +-
drivers/s390/cio/qdio_setup.c | 14 ++++-----
drivers/s390/cio/scm.c | 2 +-
drivers/s390/crypto/zcrypt_api.c | 4 +--
drivers/s390/crypto/zcrypt_msgtype6.c | 4 +--
drivers/s390/crypto/zcrypt_pcixcc.c | 4 +--
drivers/s390/net/qeth_core_main.c | 9 +++---
drivers/s390/scsi/zfcp_aux.c | 2 +-
drivers/scsi/cxlflash/main.c | 2 +-
drivers/scsi/cxlflash/superpipe.c | 2 +-
drivers/scsi/ibmvscsi/ibmvfc.c | 8 ++---
drivers/scsi/ibmvscsi/ibmvscsi.c | 4 +--
drivers/scsi/ipr.c | 2 +-
drivers/scsi/scsi_devinfo.c | 2 +-
drivers/scsi/scsi_proc.c | 4 +--
drivers/scsi/xen-scsifront.c | 2 +-
drivers/spi/spi-ep93xx.c | 4 +--
drivers/spi/spi-sh-msiof.c | 8 ++---
drivers/staging/comedi/comedi_buf.c | 2 +-
drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +-
drivers/staging/rdma/ehca/ehca_iverbs.h | 2 +-
drivers/staging/rdma/ehca/ehca_pd.c | 2 +-
drivers/staging/rdma/ehca/ipz_pt_fn.c | 6 ++--
drivers/staging/rdma/hfi1/qp.c | 4 +--
drivers/staging/rdma/ipath/ipath_qp.c | 4 +--
drivers/staging/unisys/visorbus/visorchannel.c | 2 +-
drivers/target/target_core_file.c | 2 +-
drivers/tty/amiserial.c | 6 ++--
drivers/tty/cyclades.c | 8 ++---
drivers/tty/hvc/hvc_iucv.c | 4 +--
drivers/tty/hvc/hvc_xen.c | 2 +-
drivers/tty/hvc/hvcs.c | 4 +--
drivers/tty/mxser.c | 4 +--
drivers/tty/rocket.c | 4 +--
drivers/tty/serial/68328serial.c | 2 +-
drivers/tty/serial/crisv10.c | 6 ++--
drivers/tty/serial/men_z135_uart.c | 4 +--
drivers/tty/serial/pch_uart.c | 4 +--
drivers/tty/serial/serial_core.c | 2 +-
drivers/tty/synclink.c | 2 +-
drivers/tty/tty_port.c | 4 +--
drivers/tty/vt/vc_screen.c | 4 +--
drivers/usb/atm/cxacru.c | 10 +++----
drivers/usb/atm/speedtch.c | 2 +-
drivers/usb/core/devio.c | 2 +-
drivers/usb/host/ohci-dbg.c | 2 +-
drivers/usb/misc/rio500.c | 10 +++----
drivers/usb/mon/mon_bin.c | 4 +--
drivers/usb/serial/usb_wwan.c | 4 +--
drivers/uwb/hwa-rc.c | 4 +--
drivers/video/fbdev/xen-fbfront.c | 2 +-
drivers/xen/events/events_base.c | 2 +-
drivers/xen/events/events_fifo.c | 6 ++--
drivers/xen/evtchn.c | 2 +-
drivers/xen/grant-table.c | 6 ++--
drivers/xen/xenbus/xenbus_probe.c | 2 +-
fs/affs/inode.c | 2 +-
fs/afs/mntpt.c | 8 ++---
fs/bfs/inode.c | 2 +-
fs/binfmt_misc.c | 2 +-
fs/compat.c | 2 +-
fs/configfs/file.c | 2 +-
fs/configfs/symlink.c | 2 +-
fs/ext4/super.c | 2 +-
fs/fuse/dir.c | 2 +-
fs/fuse/file.c | 2 +-
fs/isofs/dir.c | 2 +-
fs/jfs/jfs_dtree.c | 4 +--
fs/jfs/jfs_logmgr.c | 2 +-
fs/kernfs/symlink.c | 2 +-
fs/libfs.c | 6 ++--
fs/namespace.c | 4 +--
fs/nfs/namespace.c | 2 +-
fs/nfs/nfs4namespace.c | 8 ++---
fs/nfs/super.c | 2 +-
fs/nfsd/vfs.c | 2 +-
fs/ocfs2/dlm/dlmdebug.c | 4 +--
fs/ocfs2/dlm/dlmdomain.c | 2 +-
fs/ocfs2/dlm/dlmmaster.c | 2 +-
fs/ocfs2/dlm/dlmrecovery.c | 2 +-
fs/overlayfs/copy_up.c | 4 +--
fs/proc/base.c | 10 +++----
fs/select.c | 2 +-
include/asm-generic/page.h | 2 +-
include/linux/gfp.h | 2 +-
include/linux/security.h | 2 +-
kernel/events/ring_buffer.c | 4 +--
kernel/groups.c | 4 +--
kernel/power/swap.c | 10 +++----
kernel/sysctl.c | 10 +++----
kernel/trace/ftrace.c | 2 +-
kernel/trace/ring_buffer.c | 4 +--
kernel/trace/trace_events.c | 8 ++---
kernel/trace/trace_events_filter.c | 2 +-
kernel/trace/trace_events_trigger.c | 6 ++--
kernel/trace/trace_uprobe.c | 5 ++--
kernel/user_namespace.c | 2 +-
lib/scatterlist.c | 2 +-
mm/memory.c | 4 +--
mm/migrate.c | 2 +-
mm/mincore.c | 2 +-
mm/page_alloc.c | 4 +--
mm/quicklist.c | 2 +-
mm/slub.c | 2 +-
net/atm/mpoa_proc.c | 4 +--
net/atm/proc.c | 2 +-
net/core/dev.c | 2 +-
net/netfilter/nf_tables_api.c | 2 +-
net/rds/cong.c | 4 +--
net/sunrpc/backchannel_rqst.c | 4 +--
net/sunrpc/xprtsock.c | 2 +-
security/selinux/hooks.c | 4 +--
security/selinux/selinuxfs.c | 20 ++++++-------
security/smack/smack_lsm.c | 2 +-
sound/drivers/dummy.c | 2 +-
sound/oss/msnd_pinnacle.c | 16 +++++-----
sound/oss/vidc.c | 4 +--
sound/pci/emu10k1/memory.c | 2 +-
tools/virtio/linux/kernel.h | 4 +--
virt/kvm/coalesced_mmio.c | 2 +-
virt/kvm/kvm_main.c | 4 +--
310 files changed, 666 insertions(+), 669 deletions(-)
diff --git a/arch/alpha/include/asm/pgalloc.h b/arch/alpha/include/asm/pgalloc.h
index aab14a0..078da57 100644
--- a/arch/alpha/include/asm/pgalloc.h
+++ b/arch/alpha/include/asm/pgalloc.h
@@ -34,7 +34,7 @@ extern pgd_t *pgd_alloc(struct mm_struct *mm);
static inline void
pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
- free_page((unsigned long)pgd);
+ free_page(pgd);
}
static inline pmd_t *
@@ -47,7 +47,7 @@ pmd_alloc_one(struct mm_struct *mm, unsigned long address)
static inline void
pmd_free(struct mm_struct *mm, pmd_t *pmd)
{
- free_page((unsigned long)pmd);
+ free_page(pmd);
}
static inline pte_t *
@@ -60,7 +60,7 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
static inline void
pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline pgtable_t
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c
index ffe996a..a66f23b 100644
--- a/arch/alpha/kernel/srm_env.c
+++ b/arch/alpha/kernel/srm_env.c
@@ -93,7 +93,7 @@ static int srm_env_proc_show(struct seq_file *m, void *v)
ret = 0;
} else
ret = -EFAULT;
- free_page((unsigned long)page);
+ free_page(page);
return ret;
}
@@ -131,7 +131,7 @@ static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer,
}
out:
- free_page((unsigned long)buf);
+ free_page(buf);
return res;
}
diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h
index 429957f..fa23f40 100644
--- a/arch/arc/include/asm/page.h
+++ b/arch/arc/include/asm/page.h
@@ -14,7 +14,7 @@
#ifndef __ASSEMBLY__
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
-#define free_user_page(page, addr) free_page(addr)
+#define free_user_page(page, addr) free_page((void *)addr)
#define clear_page(paddr) memset((paddr), 0, PAGE_SIZE)
#define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index c33e77c..56fd4fc 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -488,7 +488,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, arc_extn_mumbojumbo(cpu_id, str, PAGE_SIZE));
seq_printf(m, arc_platform_smp_cpuinfo());
- free_page((unsigned long)str);
+ free_page(str);
done:
seq_printf(m, "\n");
diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c
index a6f91e8..eb3464d 100644
--- a/arch/arc/kernel/troubleshoot.c
+++ b/arch/arc/kernel/troubleshoot.c
@@ -222,7 +222,7 @@ void show_regs(struct pt_regs *regs)
if (cregs)
show_callee_regs(cregs);
- free_page((unsigned long)buf);
+ free_page(buf);
}
void show_kernel_fault_diag(const char *str, struct pt_regs *regs,
@@ -309,7 +309,7 @@ static ssize_t tlb_stats_clear(struct file *file, const char __user *user_buf,
static int tlb_stats_close(struct inode *inode, struct file *file)
{
- free_page((unsigned long)(file->private_data));
+ free_page(file->private_data);
return 0;
}
diff --git a/arch/arm/include/asm/page-nommu.h b/arch/arm/include/asm/page-nommu.h
index d1b162a..c4f6081 100644
--- a/arch/arm/include/asm/page-nommu.h
+++ b/arch/arm/include/asm/page-nommu.h
@@ -18,7 +18,7 @@
#endif
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
-#define free_user_page(page, addr) free_page(addr)
+#define free_user_page(page, addr) free_page((void *)addr)
#define clear_page(page) memset((page), 0, PAGE_SIZE)
#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h
index 19cfab5..540647d 100644
--- a/arch/arm/include/asm/pgalloc.h
+++ b/arch/arm/include/asm/pgalloc.h
@@ -35,7 +35,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
{
BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
- free_page((unsigned long)pmd);
+ free_page(pmd);
}
static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
@@ -119,7 +119,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr)
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
if (pte)
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index e06fd29..08fe183 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -1136,7 +1136,7 @@ out_free_mappings:
free_hyp_pgds();
out_free_stack_pages:
for_each_possible_cpu(cpu)
- free_page(per_cpu(kvm_arm_hyp_stack_page, cpu));
+ free_page((void *)per_cpu(kvm_arm_hyp_stack_page, cpu));
out_err:
kvm_err("error initializing Hyp mode: %d\n", err);
return err;
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 61d96a6..5de6c6b 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -142,7 +142,7 @@ static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache,
static void mmu_free_memory_cache(struct kvm_mmu_memory_cache *mc)
{
while (mc->nobjs)
- free_page((unsigned long)mc->objects[--mc->nobjs]);
+ free_page(mc->objects[--mc->nobjs]);
}
static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc)
@@ -441,7 +441,7 @@ void free_hyp_pgds(void)
}
if (merged_hyp_pgd) {
clear_page(merged_hyp_pgd);
- free_page((unsigned long)merged_hyp_pgd);
+ free_page(merged_hyp_pgd);
merged_hyp_pgd = NULL;
}
diff --git a/arch/arm64/include/asm/pgalloc.h b/arch/arm64/include/asm/pgalloc.h
index c150539..ce9b3c0 100644
--- a/arch/arm64/include/asm/pgalloc.h
+++ b/arch/arm64/include/asm/pgalloc.h
@@ -39,7 +39,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
{
BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
- free_page((unsigned long)pmd);
+ free_page(pmd);
}
static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
@@ -59,7 +59,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
static inline void pud_free(struct mm_struct *mm, pud_t *pud)
{
BUG_ON((unsigned long)pud & (PAGE_SIZE-1));
- free_page((unsigned long)pud);
+ free_page(pud);
}
static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)
@@ -99,7 +99,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr)
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
if (pte)
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c
index cb3ba1b..a468648 100644
--- a/arch/arm64/mm/pgd.c
+++ b/arch/arm64/mm/pgd.c
@@ -41,7 +41,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
if (PGD_SIZE == PAGE_SIZE)
- free_page((unsigned long)pgd);
+ free_page(pgd);
else
kmem_cache_free(pgd_cache, pgd);
}
diff --git a/arch/c6x/include/asm/processor.h b/arch/c6x/include/asm/processor.h
index f2ef31b..b5b5a87 100644
--- a/arch/c6x/include/asm/processor.h
+++ b/arch/c6x/include/asm/processor.h
@@ -78,7 +78,7 @@ struct thread_struct {
((struct pt_regs *)(THREAD_START_SP + task_stack_page(task)) - 1)
#define alloc_kernel_stack() __get_free_page(GFP_KERNEL)
-#define free_kernel_stack(page) free_page((page))
+#define free_kernel_stack(page) free_page((void *)(page))
/* Forward declaration, a strange C thing */
diff --git a/arch/cris/include/asm/pgalloc.h b/arch/cris/include/asm/pgalloc.h
index 235ece4..cac8206 100644
--- a/arch/cris/include/asm/pgalloc.h
+++ b/arch/cris/include/asm/pgalloc.h
@@ -19,7 +19,7 @@ static inline pgd_t *pgd_alloc (struct mm_struct *mm)
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
- free_page((unsigned long)pgd);
+ free_page(pgd);
}
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
@@ -43,7 +43,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addres
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
diff --git a/arch/cris/mm/init.c b/arch/cris/mm/init.c
index 1e7fd45..dd87022 100644
--- a/arch/cris/mm/init.c
+++ b/arch/cris/mm/init.c
@@ -42,7 +42,7 @@ void free_init_pages(const char *what, unsigned long begin, unsigned long end)
for (addr = begin; addr < end; addr += PAGE_SIZE) {
ClearPageReserved(virt_to_page(addr));
init_page_count(virt_to_page(addr));
- free_page(addr);
+ free_page((void *)addr);
totalram_pages++;
}
diff --git a/arch/frv/include/asm/page.h b/arch/frv/include/asm/page.h
index 8c97068..870960c 100644
--- a/arch/frv/include/asm/page.h
+++ b/arch/frv/include/asm/page.h
@@ -9,7 +9,7 @@
#ifndef __ASSEMBLY__
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
-#define free_user_page(page, addr) free_page(addr)
+#define free_user_page(page, addr) free_page((void *)addr)
#define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE)
#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
diff --git a/arch/frv/include/asm/pgalloc.h b/arch/frv/include/asm/pgalloc.h
index 416d19a..1fc047c 100644
--- a/arch/frv/include/asm/pgalloc.h
+++ b/arch/frv/include/asm/pgalloc.h
@@ -40,7 +40,7 @@ extern pgtable_t pte_alloc_one(struct mm_struct *, unsigned long);
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
diff --git a/arch/hexagon/include/asm/pgalloc.h b/arch/hexagon/include/asm/pgalloc.h
index 77da3b0..48c04dc 100644
--- a/arch/hexagon/include/asm/pgalloc.h
+++ b/arch/hexagon/include/asm/pgalloc.h
@@ -56,7 +56,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
- free_page((unsigned long) pgd);
+ free_page(pgd);
}
static inline struct page *pte_alloc_one(struct mm_struct *mm,
@@ -90,7 +90,7 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte)
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index e70cade..36b3217 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -339,7 +339,7 @@ static void shutdown(struct tty_port *port)
free_irq(info->irq, info);
if (info->xmit.buf) {
- free_page((unsigned long) info->xmit.buf);
+ free_page(info->xmit.buf);
info->xmit.buf = NULL;
}
local_irq_restore(flags);
@@ -374,7 +374,7 @@ static int activate(struct tty_port *port, struct tty_struct *tty)
local_irq_save(flags);
if (state->xmit.buf)
- free_page(page);
+ free_page((void *)page);
else
state->xmit.buf = (unsigned char *) page;
diff --git a/arch/m32r/include/asm/pgalloc.h b/arch/m32r/include/asm/pgalloc.h
index 2d55a06..3923429 100644
--- a/arch/m32r/include/asm/pgalloc.h
+++ b/arch/m32r/include/asm/pgalloc.h
@@ -27,7 +27,7 @@ static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
- free_page((unsigned long)pgd);
+ free_page(pgd);
}
static __inline__ pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
@@ -54,7 +54,7 @@ static __inline__ pgtable_t pte_alloc_one(struct mm_struct *mm,
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
diff --git a/arch/m68k/include/asm/mcf_pgalloc.h b/arch/m68k/include/asm/mcf_pgalloc.h
index f9924fb..2e70a56 100644
--- a/arch/m68k/include/asm/mcf_pgalloc.h
+++ b/arch/m68k/include/asm/mcf_pgalloc.h
@@ -6,7 +6,7 @@
extern inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long) pte);
+ free_page(pte);
}
extern const char bad_pmd_string[];
@@ -86,7 +86,7 @@ extern inline void pte_free(struct mm_struct *mm, struct page *page)
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
- free_page((unsigned long) pgd);
+ free_page(pgd);
}
static inline pgd_t *pgd_alloc(struct mm_struct *mm)
diff --git a/arch/m68k/include/asm/motorola_pgalloc.h b/arch/m68k/include/asm/motorola_pgalloc.h
index 24bcba4..6e84224 100644
--- a/arch/m68k/include/asm/motorola_pgalloc.h
+++ b/arch/m68k/include/asm/motorola_pgalloc.h
@@ -24,7 +24,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long ad
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
cache_page(pte);
- free_page((unsigned long) pte);
+ free_page(pte);
}
static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h
index 5029f73..1a735f8 100644
--- a/arch/m68k/include/asm/page_mm.h
+++ b/arch/m68k/include/asm/page_mm.h
@@ -7,7 +7,7 @@
#include <asm/module.h>
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
-#define free_user_page(page, addr) free_page(addr)
+#define free_user_page(page, addr) free_page((void *)addr)
/*
* We don't need to check for alignment etc.
diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h
index ef20916..1f9ec40 100644
--- a/arch/m68k/include/asm/page_no.h
+++ b/arch/m68k/include/asm/page_no.h
@@ -7,7 +7,7 @@ extern unsigned long memory_start;
extern unsigned long memory_end;
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
-#define free_user_page(page, addr) free_page(addr)
+#define free_user_page(page, addr) free_page((void *)addr)
#define clear_page(page) memset((page), 0, PAGE_SIZE)
#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h
index 0931388..ab0fd5c 100644
--- a/arch/m68k/include/asm/sun3_pgalloc.h
+++ b/arch/m68k/include/asm/sun3_pgalloc.h
@@ -19,7 +19,7 @@ extern const char bad_pmd_string[];
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long) pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t page)
@@ -83,7 +83,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t page
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
- free_page((unsigned long) pgd);
+ free_page(pgd);
}
static inline pgd_t * pgd_alloc(struct mm_struct *mm)
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c
index 51bc9d2..d812b57 100644
--- a/arch/m68k/mm/memory.c
+++ b/arch/m68k/mm/memory.c
@@ -114,7 +114,7 @@ int free_pointer_table (pmd_t *ptable)
/* all tables in page are free, free page */
list_del(dp);
cache_page((void *)page);
- free_page (page);
+ free_page((void *)page);
return 1;
} else if (ptable_list.next != dp) {
/*
diff --git a/arch/metag/include/asm/pgalloc.h b/arch/metag/include/asm/pgalloc.h
index 3104df0..cf9e2fb 100644
--- a/arch/metag/include/asm/pgalloc.h
+++ b/arch/metag/include/asm/pgalloc.h
@@ -36,7 +36,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
- free_page((unsigned long)pgd);
+ free_page(pgd);
}
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
@@ -63,7 +63,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h
index 61436d6..5e3fc6c 100644
--- a/arch/microblaze/include/asm/pgalloc.h
+++ b/arch/microblaze/include/asm/pgalloc.h
@@ -93,7 +93,7 @@ static inline void free_pgd_fast(pgd_t *pgd)
static inline void free_pgd_slow(pgd_t *pgd)
{
- free_page((unsigned long)pgd);
+ free_page(pgd);
}
#define pgd_free(mm, pgd) free_pgd_fast(pgd)
@@ -155,7 +155,7 @@ static inline void pte_free_fast(pte_t *pte)
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free_slow(struct page *ptepage)
diff --git a/arch/mn10300/include/asm/pgalloc.h b/arch/mn10300/include/asm/pgalloc.h
index 0f25d5f..f07e2d1 100644
--- a/arch/mn10300/include/asm/pgalloc.h
+++ b/arch/mn10300/include/asm/pgalloc.h
@@ -41,7 +41,7 @@ extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long) pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, struct page *pte)
diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h
index 108906f..8ab6f6f 100644
--- a/arch/openrisc/include/asm/page.h
+++ b/arch/openrisc/include/asm/page.h
@@ -41,7 +41,7 @@
#ifndef __ASSEMBLY__
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
-#define free_user_page(page, addr) free_page(addr)
+#define free_user_page(page, addr) free_page((void *)addr)
#define clear_page(page) memset((page), 0, PAGE_SIZE)
#define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
diff --git a/arch/openrisc/include/asm/pgalloc.h b/arch/openrisc/include/asm/pgalloc.h
index 21484e5b..1f61391 100644
--- a/arch/openrisc/include/asm/pgalloc.h
+++ b/arch/openrisc/include/asm/pgalloc.h
@@ -68,7 +68,7 @@ extern inline pgd_t *pgd_alloc(struct mm_struct *mm)
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
- free_page((unsigned long)pgd);
+ free_page(pgd);
}
extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address);
@@ -90,7 +90,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, struct page *pte)
diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h
index f2fd327..daca63d 100644
--- a/arch/parisc/include/asm/pgalloc.h
+++ b/arch/parisc/include/asm/pgalloc.h
@@ -143,7 +143,7 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, struct page *pte)
diff --git a/arch/powerpc/include/asm/pgalloc-32.h b/arch/powerpc/include/asm/pgalloc-32.h
index 842846c..d25a3c3 100644
--- a/arch/powerpc/include/asm/pgalloc-32.h
+++ b/arch/powerpc/include/asm/pgalloc-32.h
@@ -39,7 +39,7 @@ extern pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addr);
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
@@ -51,7 +51,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
static inline void pgtable_free(void *table, unsigned index_size)
{
BUG_ON(index_size); /* 32-bit doesn't use this */
- free_page((unsigned long)table);
+ free_page(table);
}
#define check_pgt_cache() do { } while (0)
diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
index 4b0be20..c26021b 100644
--- a/arch/powerpc/include/asm/pgalloc-64.h
+++ b/arch/powerpc/include/asm/pgalloc-64.h
@@ -101,7 +101,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
@@ -113,7 +113,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
static inline void pgtable_free(void *table, unsigned index_size)
{
if (!index_size)
- free_page((unsigned long)table);
+ free_page(table);
else {
BUG_ON(index_size > MAX_PGTABLE_INDEX_SIZE);
kmem_cache_free(PGT_CACHE(index_size), table);
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 64891b0..3775664 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -1452,7 +1452,7 @@ static void kvmppc_core_vcpu_free_pr(struct kvm_vcpu *vcpu)
{
struct kvmppc_vcpu_book3s *vcpu_book3s = to_book3s(vcpu);
- free_page((unsigned long)vcpu->arch.shared & PAGE_MASK);
+ free_page((void *)((unsigned long)vcpu->arch.shared & PAGE_MASK));
kvm_vcpu_uninit(vcpu);
#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
kfree(vcpu->arch.shadow_vcpu);
diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c
index 32fdab5..29803fb 100644
--- a/arch/powerpc/kvm/e500.c
+++ b/arch/powerpc/kvm/e500.c
@@ -484,7 +484,7 @@ static void kvmppc_core_vcpu_free_e500(struct kvm_vcpu *vcpu)
{
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
- free_page((unsigned long)vcpu->arch.shared);
+ free_page(vcpu->arch.shared);
kvmppc_e500_tlb_uninit(vcpu_e500);
kvmppc_e500_id_table_free(vcpu_e500);
kvm_vcpu_uninit(vcpu);
diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c
index cda695d..e002a71 100644
--- a/arch/powerpc/kvm/e500mc.c
+++ b/arch/powerpc/kvm/e500mc.c
@@ -351,7 +351,7 @@ static void kvmppc_core_vcpu_free_e500mc(struct kvm_vcpu *vcpu)
{
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
- free_page((unsigned long)vcpu->arch.shared);
+ free_page(vcpu->arch.shared);
kvmppc_e500_tlb_uninit(vcpu_e500);
kvm_vcpu_uninit(vcpu);
kmem_cache_free(kvm_vcpu_cache, vcpu_e500);
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 9833fee..a466b84 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -479,7 +479,7 @@ static void hugepd_free_rcu_callback(struct rcu_head *head)
for (i = 0; i < batch->index; i++)
kmem_cache_free(hugepte_cache, batch->ptes[i]);
- free_page((unsigned long)batch);
+ free_page(batch);
}
static void hugepd_free(struct mmu_gather *tlb, void *hugepte)
diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
index fa9fb5b..6f962db 100644
--- a/arch/powerpc/mm/subpage-prot.c
+++ b/arch/powerpc/mm/subpage-prot.c
@@ -31,7 +31,7 @@ void subpage_prot_free(struct mm_struct *mm)
for (i = 0; i < 4; ++i) {
if (spt->low_prot[i]) {
- free_page((unsigned long)spt->low_prot[i]);
+ free_page(spt->low_prot[i]);
spt->low_prot[i] = NULL;
}
}
@@ -44,8 +44,8 @@ void subpage_prot_free(struct mm_struct *mm)
for (j = 0; j < SBP_L2_COUNT && addr < spt->maxaddr;
++j, addr += PAGE_SIZE)
if (p[j])
- free_page((unsigned long)p[j]);
- free_page((unsigned long)p);
+ free_page(p[j]);
+ free_page(p);
}
spt->maxaddr = 0;
}
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index be6212d..766c41d 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -175,10 +175,10 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i,
roundup(cprm->written - total + sz, 4) - cprm->written))
goto Eio;
out:
- free_page((unsigned long)buf);
+ free_page(buf);
return rc;
Eio:
- free_page((unsigned long)buf);
+ free_page(buf);
return -EIO;
}
diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
index fc44ad0..db1dbe6 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -150,7 +150,7 @@ static long cmm_alloc_pages(long nr)
__GFP_NORETRY | __GFP_NOMEMALLOC);
if (!npa) {
pr_info("%s: Can not allocate new page list\n", __func__);
- free_page(addr);
+ free_page((void *)addr);
break;
}
spin_lock(&cmm_lock);
@@ -162,13 +162,13 @@ static long cmm_alloc_pages(long nr)
pa = npa;
cmm_page_list = pa;
} else
- free_page((unsigned long) npa);
+ free_page(npa);
}
if ((rc = plpar_page_set_loaned(__pa(addr)))) {
pr_err("%s: Can not set page to loaned. rc=%ld\n", __func__, rc);
spin_unlock(&cmm_lock);
- free_page(addr);
+ free_page((void *)addr);
break;
}
@@ -205,12 +205,12 @@ static long cmm_free_pages(long nr)
if (pa->index == 0) {
pa = pa->next;
- free_page((unsigned long) cmm_page_list);
+ free_page(cmm_page_list);
cmm_page_list = pa;
}
plpar_page_set_active(__pa(addr));
- free_page(addr);
+ free_page((void *)addr);
loaned_pages--;
nr--;
totalram_pages++;
@@ -544,7 +544,7 @@ static int cmm_mem_going_offline(void *arg)
continue;
plpar_page_set_active(__pa(pa_curr->page[idx]));
- free_page(pa_curr->page[idx]);
+ free_page((void *)pa_curr->page[idx]);
freed++;
loaned_pages--;
totalram_pages++;
@@ -553,7 +553,7 @@ static int cmm_mem_going_offline(void *arg)
if (pa_curr == pa_last)
pa_curr = pa_last->next;
pa_last = pa_last->next;
- free_page((unsigned long)cmm_page_list);
+ free_page(cmm_page_list);
cmm_page_list = pa_last;
}
}
@@ -581,7 +581,7 @@ static int cmm_mem_going_offline(void *arg)
cmm_page_list = npa;
if (pa_last)
pa_last->next = npa;
- free_page((unsigned long) pa_curr);
+ free_page(pa_curr);
freed++;
pa_curr = npa;
}
diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c
index 9276779..26eac2a 100644
--- a/arch/powerpc/platforms/pseries/pseries_energy.c
+++ b/arch/powerpc/platforms/pseries/pseries_energy.c
@@ -131,7 +131,7 @@ static ssize_t get_best_energy_list(char *page, int activate)
rc = plpar_hcall9(H_BEST_ENERGY, retbuf, flags, 0, __pa(buf_page),
0, 0, 0, 0, 0, 0);
if (rc != H_SUCCESS) {
- free_page((unsigned long) buf_page);
+ free_page(buf_page);
return -EINVAL;
}
@@ -147,7 +147,7 @@ static ssize_t get_best_energy_list(char *page, int activate)
s += sprintf(s, "\n");
}
- free_page((unsigned long) buf_page);
+ free_page(buf_page);
return s-page;
}
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c
index 0b9b95f..4b610d6 100644
--- a/arch/s390/crypto/aes_s390.c
+++ b/arch/s390/crypto/aes_s390.c
@@ -943,7 +943,7 @@ static int __init aes_s390_init(void)
}
ret = crypto_register_alg(&ctr_aes_alg);
if (ret) {
- free_page((unsigned long) ctrblk);
+ free_page(ctrblk);
goto ctr_aes_err;
}
ctr_aes_alg_reg = 1;
@@ -968,7 +968,7 @@ static void __exit aes_s390_fini(void)
{
if (ctr_aes_alg_reg) {
crypto_unregister_alg(&ctr_aes_alg);
- free_page((unsigned long) ctrblk);
+ free_page(ctrblk);
}
if (xts_aes_alg_reg)
crypto_unregister_alg(&xts_aes_alg);
diff --git a/arch/s390/crypto/des_s390.c b/arch/s390/crypto/des_s390.c
index fba1c10..9f402dc 100644
--- a/arch/s390/crypto/des_s390.c
+++ b/arch/s390/crypto/des_s390.c
@@ -607,7 +607,7 @@ static void __exit des_s390_exit(void)
if (ctrblk) {
crypto_unregister_alg(&ctr_des_alg);
crypto_unregister_alg(&ctr_des3_alg);
- free_page((unsigned long) ctrblk);
+ free_page(ctrblk);
}
crypto_unregister_alg(&cbc_des3_alg);
crypto_unregister_alg(&ecb_des3_alg);
diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c
index b8045b9..d3835d2 100644
--- a/arch/s390/crypto/prng.c
+++ b/arch/s390/crypto/prng.c
@@ -150,7 +150,7 @@ static int generate_entropy(u8 *ebuf, size_t nbytes)
}
out:
- free_page((unsigned long)pg);
+ free_page(pg);
return ret;
}
diff --git a/arch/s390/hypfs/hypfs_sprp.c b/arch/s390/hypfs/hypfs_sprp.c
index c9e5c72..8d98c96 100644
--- a/arch/s390/hypfs/hypfs_sprp.c
+++ b/arch/s390/hypfs/hypfs_sprp.c
@@ -43,7 +43,7 @@ static unsigned long hypfs_sprp_diag304(void *data, unsigned long cmd)
static void hypfs_sprp_free(const void *data)
{
- free_page((unsigned long) data);
+ free_page(data);
}
static int hypfs_sprp_create(void **data_ptr, void **free_ptr, size_t *size)
@@ -58,7 +58,7 @@ static int hypfs_sprp_create(void **data_ptr, void **free_ptr, size_t *size)
if (rc != 1) {
*data_ptr = *free_ptr = NULL;
*size = 0;
- free_page((unsigned long) data);
+ free_page(data);
return -EIO;
}
*data_ptr = *free_ptr = data;
@@ -102,7 +102,7 @@ static int __hypfs_sprp_ioctl(void __user *user_area)
rc = copy_to_user(user_area, &diag304, sizeof(diag304)) ? -EFAULT : 0;
out:
- free_page((unsigned long) data);
+ free_page(data);
return rc;
}
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index b1f0a90..b1f6414 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -1240,14 +1240,14 @@ static int __init reipl_fcp_init(void)
reipl_fcp_kset = kset_create_and_add(IPL_FCP_STR, NULL,
&reipl_kset->kobj);
if (!reipl_fcp_kset) {
- free_page((unsigned long) reipl_block_fcp);
+ free_page(reipl_block_fcp);
return -ENOMEM;
}
rc = sysfs_create_group(&reipl_fcp_kset->kobj, &reipl_fcp_attr_group);
if (rc) {
kset_unregister(reipl_fcp_kset);
- free_page((unsigned long) reipl_block_fcp);
+ free_page(reipl_block_fcp);
return rc;
}
@@ -1474,7 +1474,7 @@ static int __init dump_ccw_init(void)
return -ENOMEM;
rc = sysfs_create_group(&dump_kset->kobj, &dump_ccw_attr_group);
if (rc) {
- free_page((unsigned long)dump_block_ccw);
+ free_page(dump_block_ccw);
return rc;
}
dump_block_ccw->hdr.len = IPL_PARM_BLK_CCW_LEN;
@@ -1498,7 +1498,7 @@ static int __init dump_fcp_init(void)
return -ENOMEM;
rc = sysfs_create_group(&dump_kset->kobj, &dump_fcp_attr_group);
if (rc) {
- free_page((unsigned long)dump_block_fcp);
+ free_page(dump_block_fcp);
return rc;
}
dump_block_fcp->hdr.len = IPL_PARM_BLK_FCP_LEN;
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 389db56..2021dc0 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -48,7 +48,7 @@ static void *alloc_dmainsn_page(void)
static void free_dmainsn_page(void *page)
{
- free_page((unsigned long)page);
+ free_page(page);
}
struct kprobe_insn_cache kprobe_dmainsn_slots = {
diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
index 3d8da1e..0dca133 100644
--- a/arch/s390/kernel/perf_cpum_sf.c
+++ b/arch/s390/kernel/perf_cpum_sf.c
@@ -132,7 +132,7 @@ static void free_sampling_buffer(struct sf_buffer *sfb)
if (is_link_entry(curr)) {
curr = get_next_sdbt(curr);
if (sdbt)
- free_page((unsigned long) sdbt);
+ free_page(sdbt);
/* If the origin is reached, sampling buffer is freed */
if (curr == sfb->sdbt)
@@ -142,7 +142,7 @@ static void free_sampling_buffer(struct sf_buffer *sfb)
} else {
/* Process SDB pointer */
if (*curr) {
- free_page(*curr);
+ free_page((void *)*curr);
curr++;
}
}
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index c837bca..2556124 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -807,7 +807,7 @@ static void __init setup_randomness(void)
vmms = (struct sysinfo_3_2_2 *) alloc_page(GFP_KERNEL);
if (vmms && stsi(vmms, 3, 2, 2) == 0 && vmms->count)
add_device_randomness(&vmms, vmms->count);
- free_page((unsigned long) vmms);
+ free_page(vmms);
}
/*
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 9062df5..216c8f5 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -210,7 +210,7 @@ static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu)
return 0;
out:
if (pcpu != &pcpu_devices[0]) {
- free_page(panic_stack);
+ free_page((void *)panic_stack);
free_pages(async_stack, ASYNC_ORDER);
free_pages((unsigned long) pcpu->lowcore, LC_ORDER);
}
@@ -226,7 +226,7 @@ static void pcpu_free_lowcore(struct pcpu *pcpu)
vdso_free_per_cpu(pcpu->lowcore);
if (pcpu == &pcpu_devices[0])
return;
- free_page(pcpu->lowcore->panic_stack-PANIC_FRAME_OFFSET);
+ free_page((void *)(pcpu->lowcore->panic_stack-PANIC_FRAME_OFFSET));
free_pages(pcpu->lowcore->async_stack-ASYNC_FRAME_OFFSET, ASYNC_ORDER);
free_pages((unsigned long) pcpu->lowcore, LC_ORDER);
}
diff --git a/arch/s390/kernel/suspend.c b/arch/s390/kernel/suspend.c
index 39e2f41..8c23212 100644
--- a/arch/s390/kernel/suspend.c
+++ b/arch/s390/kernel/suspend.c
@@ -65,7 +65,7 @@ void page_key_free(void)
while (page_key_data) {
pkd = page_key_data;
page_key_data = pkd->next;
- free_page((unsigned long) pkd);
+ free_page(pkd);
}
}
diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c
index 99babea..f6a4c52 100644
--- a/arch/s390/kernel/sysinfo.c
+++ b/arch/s390/kernel/sysinfo.c
@@ -271,7 +271,7 @@ static int sysinfo_show(struct seq_file *m, void *v)
stsi_2_2_2(m, info);
if (level >= 3)
stsi_3_2_2(m, info);
- free_page((unsigned long)info);
+ free_page(info);
return 0;
}
@@ -449,7 +449,7 @@ void s390_adjust_jiffies(void)
*/
capability = 42;
loops_per_jiffy = capability * (500000/HZ);
- free_page((unsigned long) info);
+ free_page(info);
}
/*
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 99f84ac31..1ce2c3a 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -1466,7 +1466,7 @@ static void __init stp_reset(void)
else if (stp_online) {
pr_warning("The real or virtual hardware system does "
"not provide an STP interface\n");
- free_page((unsigned long) stp_page);
+ free_page(stp_page);
stp_page = NULL;
stp_online = 0;
}
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index 59eddb0..2391d83 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -132,8 +132,8 @@ int vdso_alloc_per_cpu(struct _lowcore *lowcore)
return 0;
out:
- free_page(page_frame);
- free_page(page_table);
+ free_page((void *)page_frame);
+ free_page((void *)page_table);
free_pages(segment_table, SEGMENT_ORDER);
return -ENOMEM;
}
@@ -152,8 +152,8 @@ void vdso_free_per_cpu(struct _lowcore *lowcore)
page_table = *(unsigned long *) segment_table;
page_frame = *(unsigned long *) page_table;
- free_page(page_frame);
- free_page(page_table);
+ free_page((void *)page_frame);
+ free_page((void *)page_table);
free_pages(segment_table, SEGMENT_ORDER);
}
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 8465892..940dd42 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -1175,9 +1175,9 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
return 0;
out_err:
kfree(kvm->arch.crypto.crycb);
- free_page((unsigned long)kvm->arch.model.fac);
+ free_page(kvm->arch.model.fac);
debug_unregister(kvm->arch.dbf);
- free_page((unsigned long)(kvm->arch.sca));
+ free_page(kvm->arch.sca);
KVM_EVENT(3, "creation of vm failed: %d", rc);
return rc;
}
@@ -1202,7 +1202,7 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
if (vcpu->kvm->arch.use_cmma)
kvm_s390_vcpu_unsetup_cmma(vcpu);
- free_page((unsigned long)(vcpu->arch.sie_block));
+ free_page(vcpu->arch.sie_block);
kvm_vcpu_uninit(vcpu);
kmem_cache_free(kvm_vcpu_cache, vcpu);
@@ -1227,8 +1227,8 @@ static void kvm_free_vcpus(struct kvm *kvm)
void kvm_arch_destroy_vm(struct kvm *kvm)
{
kvm_free_vcpus(kvm);
- free_page((unsigned long)kvm->arch.model.fac);
- free_page((unsigned long)(kvm->arch.sca));
+ free_page(kvm->arch.model.fac);
+ free_page(kvm->arch.sca);
debug_unregister(kvm->arch.dbf);
kfree(kvm->arch.crypto.crycb);
if (!kvm_is_ucontrol(kvm))
@@ -1390,7 +1390,7 @@ static void kvm_s390_vcpu_crypto_setup(struct kvm_vcpu *vcpu)
void kvm_s390_vcpu_unsetup_cmma(struct kvm_vcpu *vcpu)
{
- free_page(vcpu->arch.sie_block->cbrlo);
+ free_page((void *)vcpu->arch.sie_block->cbrlo);
vcpu->arch.sie_block->cbrlo = 0;
}
@@ -1523,7 +1523,7 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
return vcpu;
out_free_sie_block:
- free_page((unsigned long)(vcpu->arch.sie_block));
+ free_page(vcpu->arch.sie_block);
out_free_cpu:
kmem_cache_free(kvm_vcpu_cache, vcpu);
out:
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index d76b51c..9ed1a25 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -564,14 +564,14 @@ static int handle_stsi(struct kvm_vcpu *vcpu)
rc = -EREMOTE;
}
trace_kvm_s390_handle_stsi(vcpu, fc, sel1, sel2, operand2);
- free_page(mem);
+ free_page((void *)mem);
kvm_s390_set_psw_cc(vcpu, 0);
vcpu->run->s.regs.gprs[0] = 0;
return rc;
out_no_data:
kvm_s390_set_psw_cc(vcpu, 3);
out:
- free_page(mem);
+ free_page((void *)mem);
return rc;
}
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index 79ddd58..b0ca6af 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -78,7 +78,7 @@ static long cmm_alloc_pages(long nr, long *counter,
npa = (struct cmm_page_array *)
__get_free_page(GFP_NOIO);
if (!npa) {
- free_page(addr);
+ free_page((void *)addr);
break;
}
spin_lock(&cmm_lock);
@@ -89,7 +89,7 @@ static long cmm_alloc_pages(long nr, long *counter,
pa = npa;
*list = pa;
} else
- free_page((unsigned long) npa);
+ free_page(npa);
}
diag10_range(addr >> PAGE_SHIFT, 1);
pa->pages[pa->index++] = addr;
@@ -113,10 +113,10 @@ static long cmm_free_pages(long nr, long *counter, struct cmm_page_array **list)
addr = pa->pages[--pa->index];
if (pa->index == 0) {
pa = pa->next;
- free_page((unsigned long) *list);
+ free_page(*list);
*list = pa;
}
- free_page(addr);
+ free_page((void *)addr);
(*counter)--;
nr--;
}
diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c
index 8a993a5..e20811c 100644
--- a/arch/s390/mm/maccess.c
+++ b/arch/s390/mm/maccess.c
@@ -151,7 +151,7 @@ int copy_to_user_real(void __user *dest, void *src, unsigned long count)
}
rc = 0;
out:
- free_page((unsigned long) buf);
+ free_page(buf);
return rc;
}
@@ -204,5 +204,5 @@ void *xlate_dev_mem_ptr(phys_addr_t addr)
void unxlate_dev_mem_ptr(phys_addr_t addr, void *buf)
{
if ((void *) addr != buf)
- free_page((unsigned long) buf);
+ free_page(buf);
}
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 54ef3bc..676989b 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -1094,7 +1094,7 @@ static void tlb_remove_table_rcu(struct rcu_head *head)
for (i = 0; i < batch->nr; i++)
__tlb_remove_table(batch->tables[i]);
- free_page((unsigned long)batch);
+ free_page(batch);
}
void tlb_table_flush(struct mmu_gather *tlb)
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c
index ff9b4eb..62f6aa2 100644
--- a/arch/s390/oprofile/hwsampler.c
+++ b/arch/s390/oprofile/hwsampler.c
@@ -264,7 +264,7 @@ static int allocate_sdbt(int cpu)
barrier();
if (oom_killer_was_active || !sdbt) {
if (sdbt)
- free_page((unsigned long)sdbt);
+ free_page(sdbt);
goto allocate_sdbt_error;
}
@@ -286,7 +286,7 @@ static int allocate_sdbt(int cpu)
barrier();
if (oom_killer_was_active || !sdb) {
if (sdb)
- free_page(sdb);
+ free_page((void *)sdb);
goto allocate_sdbt_error;
}
@@ -353,7 +353,7 @@ static int deallocate_sdbt(void)
if (is_link_entry(curr)) {
curr = get_next_sdbt(curr);
if (sdbt)
- free_page(sdbt);
+ free_page((void *)sdbt);
/* we are done if we reach the start */
if ((unsigned long) curr == start)
@@ -363,7 +363,7 @@ static int deallocate_sdbt(void)
} else {
/* process SDB pointer */
if (*curr) {
- free_page(*curr);
+ free_page((void *)*curr);
curr++;
}
}
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c
index 8b50cf7..83b3302 100644
--- a/arch/sh/boards/mach-hp6xx/pm.c
+++ b/arch/sh/boards/mach-hp6xx/pm.c
@@ -81,7 +81,7 @@ static void pm_enter(void)
asm volatile("ldc %0, vbr" : : "r" (vbr_old));
- free_page(vbr_new);
+ free_page((void *)vbr_new);
/* enable PLL1 */
frqcr = __raw_readw(FRQCR);
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index 3768682..7db91e1 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -143,7 +143,7 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
return 0;
out_free_dummy_page:
- free_page(iommu->dummy_page);
+ free_page((void *)iommu->dummy_page);
iommu->dummy_page = 0UL;
out_free_map:
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 3025bd5..6ef89c0 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2738,7 +2738,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm,
void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static void __pte_free(pgtable_t pte)
diff --git a/arch/tile/mm/elf.c b/arch/tile/mm/elf.c
index 6225cc9..cbc81ab 100644
--- a/arch/tile/mm/elf.c
+++ b/arch/tile/mm/elf.c
@@ -97,7 +97,7 @@ static int notify_exec(struct mm_struct *mm)
done_put:
fput(exe_file);
done_free:
- free_page((unsigned long)buf);
+ free_page(buf);
return ret;
}
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 29880c9..5992763 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -334,7 +334,7 @@ static int mem_config(char *str, char **error_out)
unplug_index = UNPLUGGED_PER_PAGE;
}
- free_page((unsigned long) addr);
+ free_page(addr);
unplugged_pages_count--;
}
else {
diff --git a/arch/um/include/asm/pgalloc.h b/arch/um/include/asm/pgalloc.h
index bf90b2a..35acfd4 100644
--- a/arch/um/include/asm/pgalloc.h
+++ b/arch/um/include/asm/pgalloc.h
@@ -30,7 +30,7 @@ extern pgtable_t pte_alloc_one(struct mm_struct *, unsigned long);
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long) pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
@@ -49,7 +49,7 @@ do { \
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
{
- free_page((unsigned long)pmd);
+ free_page(pmd);
}
#define __pmd_free_tlb(tlb,x, address) tlb_remove_page((tlb),virt_to_page(x))
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index b2a2dff..8936388 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -197,7 +197,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
- free_page((unsigned long) pgd);
+ free_page(pgd);
}
pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c
index 9591a66..ef2762b 100644
--- a/arch/um/kernel/skas/mmu.c
+++ b/arch/um/kernel/skas/mmu.c
@@ -85,7 +85,7 @@ int init_new_context(struct task_struct *task, struct mm_struct *mm)
out_free:
if (to_mm->id.stack != 0)
- free_page(to_mm->id.stack);
+ free_page((void *)to_mm->id.stack);
out:
return ret;
}
@@ -153,6 +153,6 @@ void destroy_context(struct mm_struct *mm)
}
os_kill_ptraced_process(mmu->id.u.pid, 1);
- free_page(mmu->id.stack);
+ free_page((void *)mmu->id.stack);
free_ldt(mmu);
}
diff --git a/arch/unicore32/include/asm/pgalloc.h b/arch/unicore32/include/asm/pgalloc.h
index 2e02d13..3287878 100644
--- a/arch/unicore32/include/asm/pgalloc.h
+++ b/arch/unicore32/include/asm/pgalloc.h
@@ -70,7 +70,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr)
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
if (pte)
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
index bf7f8b5..061eb29 100644
--- a/arch/x86/include/asm/pgalloc.h
+++ b/arch/x86/include/asm/pgalloc.h
@@ -42,7 +42,7 @@ extern pgtable_t pte_alloc_one(struct mm_struct *, unsigned long);
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
BUG_ON((unsigned long)pte & (PAGE_SIZE-1));
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, struct page *pte)
@@ -95,7 +95,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
{
BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
pgtable_pmd_page_dtor(virt_to_page(pmd));
- free_page((unsigned long)pmd);
+ free_page(pmd);
}
extern void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd);
@@ -131,7 +131,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
static inline void pud_free(struct mm_struct *mm, pud_t *pud)
{
BUG_ON((unsigned long)pud & (PAGE_SIZE-1));
- free_page((unsigned long)pud);
+ free_page(pud);
}
extern void ___pud_free_tlb(struct mmu_gather *tlb, pud_t *pud);
diff --git a/arch/x86/kernel/cpu/perf_event_intel_pt.c b/arch/x86/kernel/cpu/perf_event_intel_pt.c
index 868e119..79b7a3c 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_pt.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_pt.c
@@ -373,7 +373,7 @@ static struct topa *topa_alloc(int cpu, gfp_t gfp)
*/
static void topa_free(struct topa *topa)
{
- free_page((unsigned long)topa);
+ free_page(topa);
}
/**
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index 6acc9dd..5208c58 100644
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -95,7 +95,7 @@ static void free_ldt_struct(struct ldt_struct *ldt)
if (ldt->size * LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(ldt->entries);
else
- free_page((unsigned long)ldt->entries);
+ free_page(ldt->entries);
kfree(ldt);
}
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
index 469b23d..7c820f91 100644
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
@@ -70,13 +70,13 @@ static void load_segments(void)
static void machine_kexec_free_page_tables(struct kimage *image)
{
- free_page((unsigned long)image->arch.pgd);
+ free_page(image->arch.pgd);
#ifdef CONFIG_X86_PAE
- free_page((unsigned long)image->arch.pmd0);
- free_page((unsigned long)image->arch.pmd1);
+ free_page(image->arch.pmd0);
+ free_page(image->arch.pmd1);
#endif
- free_page((unsigned long)image->arch.pte0);
- free_page((unsigned long)image->arch.pte1);
+ free_page(image->arch.pte0);
+ free_page(image->arch.pte1);
}
static int machine_kexec_alloc_page_tables(struct kimage *image)
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 819ab3f..1809987 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -36,9 +36,9 @@ static struct kexec_file_ops *kexec_file_loaders[] = {
static void free_transition_pgtable(struct kimage *image)
{
- free_page((unsigned long)image->arch.pud);
- free_page((unsigned long)image->arch.pmd);
- free_page((unsigned long)image->arch.pte);
+ free_page(image->arch.pud);
+ free_page(image->arch.pmd);
+ free_page(image->arch.pte);
}
static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 4d30b86..406e746 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1551,7 +1551,7 @@ void kvm_free_lapic(struct kvm_vcpu *vcpu)
static_key_slow_dec_deferred(&apic_sw_disabled);
if (apic->regs)
- free_page((unsigned long)apic->regs);
+ free_page(apic->regs);
kfree(apic);
}
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index e7c2c14..fb86efb 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -703,7 +703,7 @@ static int mmu_topup_memory_cache_page(struct kvm_mmu_memory_cache *cache,
static void mmu_free_memory_cache_page(struct kvm_mmu_memory_cache *mc)
{
while (mc->nobjs)
- free_page((unsigned long)mc->objects[--mc->nobjs]);
+ free_page(mc->objects[--mc->nobjs]);
}
static int mmu_topup_memory_caches(struct kvm_vcpu *vcpu)
@@ -1687,9 +1687,9 @@ static void kvm_mmu_free_page(struct kvm_mmu_page *sp)
MMU_WARN_ON(!is_empty_shadow_page(sp->spt));
hlist_del(&sp->hash_link);
list_del(&sp->link);
- free_page((unsigned long)sp->spt);
+ free_page(sp->spt);
if (!sp->role.direct)
- free_page((unsigned long)sp->gfns);
+ free_page(sp->gfns);
kmem_cache_free(mmu_page_header_cache, sp);
}
@@ -4451,9 +4451,9 @@ EXPORT_SYMBOL_GPL(kvm_disable_tdp);
static void free_mmu_pages(struct kvm_vcpu *vcpu)
{
- free_page((unsigned long)vcpu->arch.mmu.pae_root);
+ free_page(vcpu->arch.mmu.pae_root);
if (vcpu->arch.mmu.lm_root != NULL)
- free_page((unsigned long)vcpu->arch.mmu.lm_root);
+ free_page(vcpu->arch.mmu.lm_root);
}
static int alloc_mmu_pages(struct kvm_vcpu *vcpu)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index af823a3..f70ed2f 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6276,40 +6276,40 @@ static __init int hardware_setup(void)
return alloc_kvm_area();
out8:
- free_page((unsigned long)vmx_vmwrite_bitmap);
+ free_page(vmx_vmwrite_bitmap);
out7:
- free_page((unsigned long)vmx_vmread_bitmap);
+ free_page(vmx_vmread_bitmap);
out6:
if (nested)
- free_page((unsigned long)vmx_msr_bitmap_nested);
+ free_page(vmx_msr_bitmap_nested);
out5:
- free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic);
+ free_page(vmx_msr_bitmap_longmode_x2apic);
out4:
- free_page((unsigned long)vmx_msr_bitmap_longmode);
+ free_page(vmx_msr_bitmap_longmode);
out3:
- free_page((unsigned long)vmx_msr_bitmap_legacy_x2apic);
+ free_page(vmx_msr_bitmap_legacy_x2apic);
out2:
- free_page((unsigned long)vmx_msr_bitmap_legacy);
+ free_page(vmx_msr_bitmap_legacy);
out1:
- free_page((unsigned long)vmx_io_bitmap_b);
+ free_page(vmx_io_bitmap_b);
out:
- free_page((unsigned long)vmx_io_bitmap_a);
+ free_page(vmx_io_bitmap_a);
return r;
}
static __exit void hardware_unsetup(void)
{
- free_page((unsigned long)vmx_msr_bitmap_legacy_x2apic);
- free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic);
- free_page((unsigned long)vmx_msr_bitmap_legacy);
- free_page((unsigned long)vmx_msr_bitmap_longmode);
- free_page((unsigned long)vmx_io_bitmap_b);
- free_page((unsigned long)vmx_io_bitmap_a);
- free_page((unsigned long)vmx_vmwrite_bitmap);
- free_page((unsigned long)vmx_vmread_bitmap);
+ free_page(vmx_msr_bitmap_legacy_x2apic);
+ free_page(vmx_msr_bitmap_longmode_x2apic);
+ free_page(vmx_msr_bitmap_legacy);
+ free_page(vmx_msr_bitmap_longmode);
+ free_page(vmx_io_bitmap_b);
+ free_page(vmx_io_bitmap_a);
+ free_page(vmx_vmwrite_bitmap);
+ free_page(vmx_vmread_bitmap);
if (nested)
- free_page((unsigned long)vmx_msr_bitmap_nested);
+ free_page(vmx_msr_bitmap_nested);
free_kvm_area();
}
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index eed3228..6b5980f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7589,7 +7589,7 @@ fail_free_lapic:
fail_mmu_destroy:
kvm_mmu_destroy(vcpu);
fail_free_pio_data:
- free_page((unsigned long)vcpu->arch.pio_data);
+ free_page(vcpu->arch.pio_data);
fail:
return r;
}
@@ -7604,7 +7604,7 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
idx = srcu_read_lock(&vcpu->kvm->srcu);
kvm_mmu_destroy(vcpu);
srcu_read_unlock(&vcpu->kvm->srcu, idx);
- free_page((unsigned long)vcpu->arch.pio_data);
+ free_page(vcpu->arch.pio_data);
if (!lapic_in_kernel(vcpu))
static_key_slow_dec(&kvm_no_apic_vcpu);
}
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index a3137a4..5aa4ca6 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -725,7 +725,7 @@ static bool try_to_free_pte_page(pte_t *pte)
if (!pte_none(pte[i]))
return false;
- free_page((unsigned long)pte);
+ free_page(pte);
return true;
}
@@ -737,7 +737,7 @@ static bool try_to_free_pmd_page(pmd_t *pmd)
if (!pmd_none(pmd[i]))
return false;
- free_page((unsigned long)pmd);
+ free_page(pmd);
return true;
}
@@ -749,7 +749,7 @@ static bool try_to_free_pud_page(pud_t *pud)
if (!pud_none(pud[i]))
return false;
- free_page((unsigned long)pud);
+ free_page(pud);
return true;
}
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index fb0a9dd..8e51a6c 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -198,7 +198,7 @@ static void free_pmds(struct mm_struct *mm, pmd_t *pmds[])
for(i = 0; i < PREALLOCATED_PMDS; i++)
if (pmds[i]) {
pgtable_pmd_page_dtor(virt_to_page(pmds[i]));
- free_page((unsigned long)pmds[i]);
+ free_page(pmds[i]);
mm_dec_nr_pmds(mm);
}
}
@@ -213,7 +213,7 @@ static int preallocate_pmds(struct mm_struct *mm, pmd_t *pmds[])
if (!pmd)
failed = true;
if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) {
- free_page((unsigned long)pmd);
+ free_page(pmd);
pmd = NULL;
failed = true;
}
@@ -335,7 +335,7 @@ static inline pgd_t *_pgd_alloc(void)
static inline void _pgd_free(pgd_t *pgd)
{
if (!SHARED_KERNEL_PMD)
- free_page((unsigned long)pgd);
+ free_page(pgd);
else
kmem_cache_free(pgd_cache, pgd);
}
@@ -347,7 +347,7 @@ static inline pgd_t *_pgd_alloc(void)
static inline void _pgd_free(pgd_t *pgd)
{
- free_page((unsigned long)pgd);
+ free_page(pgd);
}
#endif /* CONFIG_X86_PAE */
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index 9b83b90..7958c26 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -423,7 +423,7 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
printk(KERN_INFO "PCI: Using BIOS Interrupt Routing Table\n");
}
}
- free_page(page);
+ free_page((void *)page);
return rt;
}
EXPORT_SYMBOL(pcibios_get_irq_routing_table);
diff --git a/arch/x86/um/ldt.c b/arch/x86/um/ldt.c
index 836a1eb..42522ff 100644
--- a/arch/x86/um/ldt.c
+++ b/arch/x86/um/ldt.c
@@ -364,7 +364,7 @@ void free_ldt(struct mm_context *mm)
if (mm->arch.ldt.entry_count > LDT_DIRECT_ENTRIES) {
i = mm->arch.ldt.entry_count / LDT_ENTRIES_PER_PAGE;
while (i-- > 0)
- free_page((long) mm->arch.ldt.u.pages[i]);
+ free_page(mm->arch.ldt.u.pages[i]);
}
mm->arch.ldt.entry_count = 0;
}
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index ac161db..bb7b2e5 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1547,7 +1547,7 @@ static void xen_pgd_free(struct mm_struct *mm, pgd_t *pgd)
pgd_t *user_pgd = xen_get_user_pgd(pgd);
if (user_pgd)
- free_page((unsigned long)user_pgd);
+ free_page(user_pgd);
#endif
}
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index cab9f76..b72eab3 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -192,7 +192,7 @@ static void __ref free_p2m_page(void *p)
return;
}
- free_page((unsigned long)p);
+ free_page(p);
}
/*
diff --git a/arch/xtensa/include/asm/pgalloc.h b/arch/xtensa/include/asm/pgalloc.h
index d38eb92..022b9b3 100644
--- a/arch/xtensa/include/asm/pgalloc.h
+++ b/arch/xtensa/include/asm/pgalloc.h
@@ -35,7 +35,7 @@ pgd_alloc(struct mm_struct *mm)
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
- free_page((unsigned long)pgd);
+ free_page(pgd);
}
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
@@ -71,7 +71,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- free_page((unsigned long)pte);
+ free_page(pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
diff --git a/block/partitions/check.c b/block/partitions/check.c
index 16118d1..dc43d02b 100644
--- a/block/partitions/check.c
+++ b/block/partitions/check.c
@@ -176,7 +176,7 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
if (res > 0) {
printk(KERN_INFO "%s", state->pp_buf);
- free_page((unsigned long)state->pp_buf);
+ free_page(state->pp_buf);
return state;
}
if (state->access_beyond_eod)
@@ -191,7 +191,7 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
printk(KERN_INFO "%s", state->pp_buf);
}
- free_page((unsigned long)state->pp_buf);
+ free_page(state->pp_buf);
free_partitions(state);
return ERR_PTR(res);
}
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c
index 8cc1622..d46ebfa 100644
--- a/crypto/blkcipher.c
+++ b/crypto/blkcipher.c
@@ -138,7 +138,7 @@ err:
if (walk->buffer != walk->page)
kfree(walk->buffer);
if (walk->page)
- free_page((unsigned long)walk->page);
+ free_page(walk->page);
return err;
}
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 46a4a75..5cc0a85 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -264,7 +264,7 @@ static int testmgr_alloc_buf(char *buf[XBUFSIZE])
err_free_buf:
while (i-- > 0)
- free_page((unsigned long)buf[i]);
+ free_page(buf[i]);
return -ENOMEM;
}
@@ -274,7 +274,7 @@ static void testmgr_free_buf(char *buf[XBUFSIZE])
int i;
for (i = 0; i < XBUFSIZE; i++)
- free_page((unsigned long)buf[i]);
+ free_page(buf[i]);
}
static void sg_init_aead(struct scatterlist *sg, char *xbuf[XBUFSIZE],
@@ -2228,7 +2228,7 @@ static int __init tcrypt_mod_init(void)
err_free_tv:
for (i = 0; i < TVMEMSIZE && tvmem[i]; i++)
- free_page((unsigned long)tvmem[i]);
+ free_page(tvmem[i]);
return err;
}
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index ae8c57fd..dc8d8f7 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -175,7 +175,7 @@ static int testmgr_alloc_buf(char *buf[XBUFSIZE])
err_free_buf:
while (i-- > 0)
- free_page((unsigned long)buf[i]);
+ free_page(buf[i]);
return -ENOMEM;
}
@@ -185,7 +185,7 @@ static void testmgr_free_buf(char *buf[XBUFSIZE])
int i;
for (i = 0; i < XBUFSIZE; i++)
- free_page((unsigned long)buf[i]);
+ free_page(buf[i]);
}
static int wait_async_op(struct tcrypt_result *tr, int ret)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 3dd9c46..1d074de 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -202,7 +202,7 @@ static void ghes_estatus_pool_free_chunk_page(struct gen_pool *pool,
struct gen_pool_chunk *chunk,
void *data)
{
- free_page(chunk->start_addr);
+ free_page((void *)chunk->start_addr);
}
static void ghes_estatus_pool_exit(void)
diff --git a/drivers/acpi/nvs.c b/drivers/acpi/nvs.c
index 85287b8..36bf798 100644
--- a/drivers/acpi/nvs.c
+++ b/drivers/acpi/nvs.c
@@ -132,7 +132,7 @@ void suspend_nvs_free(void)
list_for_each_entry(entry, &nvs_list, node)
if (entry->data) {
- free_page((unsigned long)entry->data);
+ free_page(entry->data);
entry->data = NULL;
if (entry->kaddr) {
if (entry->unmap) {
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 6339efd..20420c3 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -909,7 +909,7 @@ static int start_rx(struct atm_dev *dev)
if (!eni_dev->rx_map) {
printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n",
dev->number);
- free_page((unsigned long) eni_dev->free_list);
+ free_page(eni_dev->free_list);
return -ENOMEM;
}
eni_dev->rx_mult = DEFAULT_RX_MULT;
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index ce43ae3..cf0a9f5 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -1459,7 +1459,7 @@ static int vcc_table_allocate(struct lanai_dev *lanai)
static inline void vcc_table_deallocate(const struct lanai_dev *lanai)
{
#ifdef VCCTABLE_GETFREEPAGE
- free_page((unsigned long) lanai->vccs);
+ free_page(lanai->vccs);
#else
vfree(lanai->vccs);
#endif
diff --git a/drivers/auxdisplay/cfag12864b.c b/drivers/auxdisplay/cfag12864b.c
index 41ce4bd..412c1bf 100644
--- a/drivers/auxdisplay/cfag12864b.c
+++ b/drivers/auxdisplay/cfag12864b.c
@@ -371,7 +371,7 @@ cachealloced:
kfree(cfag12864b_cache);
bufferalloced:
- free_page((unsigned long) cfag12864b_buffer);
+ free_page(cfag12864b_buffer);
none:
return ret;
@@ -383,7 +383,7 @@ static void __exit cfag12864b_exit(void)
cfag12864b_off();
destroy_workqueue(cfag12864b_workqueue);
kfree(cfag12864b_cache);
- free_page((unsigned long) cfag12864b_buffer);
+ free_page(cfag12864b_buffer);
}
module_init(cfag12864b_init);
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index ad80c85..544612b 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -1821,6 +1821,6 @@ aoecmd_exit(void)
kfree(kts);
kfree(ktiowq);
- free_page((unsigned long) page_address(empty_page));
+ free_page(page_address(empty_page));
empty_page = NULL;
}
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 0422c47..a055899 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -538,7 +538,7 @@ cciss_proc_write(struct file *file, const char __user *buf,
safely possible. (only 1 module use count, lock issues.) */
out:
- free_page((unsigned long)buffer);
+ free_page(buffer);
return err;
}
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74d97f4..c5f9c21 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2498,8 +2498,8 @@ static int drbd_alloc_socket(struct drbd_socket *socket)
static void drbd_free_socket(struct drbd_socket *socket)
{
- free_page((unsigned long) socket->sbuf);
- free_page((unsigned long) socket->rbuf);
+ free_page(socket->sbuf);
+ free_page(socket->rbuf);
}
void conn_free_crypto(struct drbd_connection *connection)
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c
index 3661a51..3835c1b 100644
--- a/drivers/char/agp/amd-k7-agp.c
+++ b/drivers/char/agp/amd-k7-agp.c
@@ -55,7 +55,7 @@ static int amd_create_page_map(struct amd_page_map *page_map)
static void amd_free_page_map(struct amd_page_map *page_map)
{
set_memory_wb((unsigned long)page_map->real, 1);
- free_page((unsigned long) page_map->real);
+ free_page(page_map->real);
}
static void amd_free_gatt_pages(void)
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c
index 75a9786..95651e2 100644
--- a/drivers/char/agp/ati-agp.c
+++ b/drivers/char/agp/ati-agp.c
@@ -77,7 +77,7 @@ static void ati_free_page_map(struct ati_page_map *page_map)
{
unmap_page_from_agp(virt_to_page(page_map->real));
set_memory_wb((unsigned long)page_map->real, 1);
- free_page((unsigned long) page_map->real);
+ free_page(page_map->real);
}
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c
index 533cb6d..1416595 100644
--- a/drivers/char/agp/efficeon-agp.c
+++ b/drivers/char/agp/efficeon-agp.c
@@ -164,7 +164,7 @@ static int efficeon_free_gatt_table(struct agp_bridge_data *bridge)
if (page) {
efficeon_private.l1_table[index] = 0;
ClearPageReserved(virt_to_page((char *)page));
- free_page(page);
+ free_page((void *)page);
freed++;
}
printk(KERN_DEBUG PFX "efficeon_free_gatt_table(%p, %02x, %08x)\n",
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 9b163b4..96d2e55 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -66,7 +66,7 @@ static int serverworks_create_page_map(struct serverworks_page_map *page_map)
static void serverworks_free_page_map(struct serverworks_page_map *page_map)
{
set_memory_wb((unsigned long)page_map->real, 1);
- free_page((unsigned long) page_map->real);
+ free_page(page_map->real);
}
static void serverworks_free_gatt_pages(void)
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 6b1721f..63f7056 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -445,7 +445,7 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
read += sz;
p += sz;
}
- free_page((unsigned long)kbuf);
+ free_page(kbuf);
}
*ppos = p;
return read ? read : err;
@@ -546,7 +546,7 @@ static ssize_t write_kmem(struct file *file, const char __user *buf,
virtr += sz;
p += sz;
}
- free_page((unsigned long)kbuf);
+ free_page(kbuf);
}
*ppos = p;
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 45df4bf..6b79755 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -1337,7 +1337,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty)
del_timer_sync(&info->tx_timer);
if (info->tx_buf) {
- free_page((unsigned long) info->tx_buf);
+ free_page(info->tx_buf);
info->tx_buf = NULL;
}
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
index 3e6a226..35cf117 100644
--- a/drivers/char/tpm/tpm_ibmvtpm.c
+++ b/drivers/char/tpm/tpm_ibmvtpm.c
@@ -288,7 +288,7 @@ static int tpm_ibmvtpm_remove(struct vio_dev *vdev)
dma_unmap_single(ibmvtpm->dev, ibmvtpm->crq_dma_handle,
CRQ_RES_BUF_SIZE, DMA_BIDIRECTIONAL);
- free_page((unsigned long)ibmvtpm->crq_queue.crq_addr);
+ free_page(ibmvtpm->crq_queue.crq_addr);
if (ibmvtpm->rtce_buf) {
dma_unmap_single(ibmvtpm->dev, ibmvtpm->rtce_dma_handle,
@@ -652,7 +652,7 @@ reg_crq_cleanup:
cleanup:
if (ibmvtpm) {
if (crq_q->crq_addr)
- free_page((unsigned long)crq_q->crq_addr);
+ free_page(crq_q->crq_addr);
kfree(ibmvtpm);
}
diff --git a/drivers/char/tpm/xen-tpmfront.c b/drivers/char/tpm/xen-tpmfront.c
index 3111f27..4ac4830 100644
--- a/drivers/char/tpm/xen-tpmfront.c
+++ b/drivers/char/tpm/xen-tpmfront.c
@@ -275,7 +275,7 @@ static void ring_free(struct tpm_private *priv)
gnttab_end_foreign_access(priv->ring_ref, 0,
(unsigned long)priv->shr);
else
- free_page((unsigned long)priv->shr);
+ free_page(priv->shr);
if (priv->chip && priv->chip->vendor.irq)
unbind_from_irqhandler(priv->chip->vendor.irq, priv);
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
index c07dfe5..7b09193 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
@@ -411,13 +411,13 @@ hwicap_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
/* If we didn't read correctly, then bail out. */
if (status) {
- free_page((unsigned long)kbuf);
+ free_page(kbuf);
goto error;
}
/* If we fail to return the data to the user, then bail out. */
if (copy_to_user(buf, kbuf, bytes_to_read)) {
- free_page((unsigned long)kbuf);
+ free_page(kbuf);
status = -EFAULT;
goto error;
}
@@ -425,7 +425,7 @@ hwicap_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
kbuf,
bytes_remaining);
drvdata->read_buffer_in_use = bytes_remaining;
- free_page((unsigned long)kbuf);
+ free_page(kbuf);
}
status = bytes_to_read;
error:
@@ -478,13 +478,13 @@ hwicap_write(struct file *file, const char __user *buf,
(((char *)kbuf) + drvdata->write_buffer_in_use),
buf + written,
len - (drvdata->write_buffer_in_use))) {
- free_page((unsigned long)kbuf);
+ free_page(kbuf);
status = -EFAULT;
goto error;
}
} else {
if (copy_from_user(kbuf, buf + written, len)) {
- free_page((unsigned long)kbuf);
+ free_page(kbuf);
status = -EFAULT;
goto error;
}
@@ -494,7 +494,7 @@ hwicap_write(struct file *file, const char __user *buf,
kbuf, len >> 2);
if (status) {
- free_page((unsigned long)kbuf);
+ free_page(kbuf);
status = -EFAULT;
goto error;
}
@@ -515,7 +515,7 @@ hwicap_write(struct file *file, const char __user *buf,
}
}
- free_page((unsigned long)kbuf);
+ free_page(kbuf);
status = written;
error:
mutex_unlock(&drvdata->sem);
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index fb16d81..bf75457 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -686,8 +686,8 @@ err_map_out:
DMA_TO_DEVICE);
err_map_in:
err_alloc:
- free_page((unsigned long)dd->buf_out);
- free_page((unsigned long)dd->buf_in);
+ free_page(dd->buf_out);
+ free_page(dd->buf_in);
if (err)
pr_err("error: %d\n", err);
return err;
@@ -699,8 +699,8 @@ static void atmel_aes_buff_cleanup(struct atmel_aes_dev *dd)
DMA_FROM_DEVICE);
dma_unmap_single(dd->dev, dd->dma_addr_in, dd->buflen,
DMA_TO_DEVICE);
- free_page((unsigned long)dd->buf_out);
- free_page((unsigned long)dd->buf_in);
+ free_page(dd->buf_out);
+ free_page(dd->buf_in);
}
static int atmel_aes_crypt(struct ablkcipher_request *req, unsigned long mode)
diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c
index 2c7a628..0219027e 100644
--- a/drivers/crypto/atmel-tdes.c
+++ b/drivers/crypto/atmel-tdes.c
@@ -381,8 +381,8 @@ err_map_out:
DMA_TO_DEVICE);
err_map_in:
err_alloc:
- free_page((unsigned long)dd->buf_out);
- free_page((unsigned long)dd->buf_in);
+ free_page(dd->buf_out);
+ free_page(dd->buf_in);
if (err)
pr_err("error: %d\n", err);
return err;
@@ -394,8 +394,8 @@ static void atmel_tdes_buff_cleanup(struct atmel_tdes_dev *dd)
DMA_FROM_DEVICE);
dma_unmap_single(dd->dev, dd->dma_addr_in, dd->buflen,
DMA_TO_DEVICE);
- free_page((unsigned long)dd->buf_out);
- free_page((unsigned long)dd->buf_in);
+ free_page(dd->buf_out);
+ free_page(dd->buf_in);
}
static int atmel_tdes_crypt_pdc(struct crypto_tfm *tfm, dma_addr_t dma_addr_in,
diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c
index 046c1c4..ce459cb 100644
--- a/drivers/crypto/nx/nx-842.c
+++ b/drivers/crypto/nx/nx-842.c
@@ -121,8 +121,8 @@ int nx842_crypto_init(struct crypto_tfm *tfm, struct nx842_driver *driver)
ctx->dbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
if (!ctx->wmem || !ctx->sbounce || !ctx->dbounce) {
kfree(ctx->wmem);
- free_page((unsigned long)ctx->sbounce);
- free_page((unsigned long)ctx->dbounce);
+ free_page(ctx->sbounce);
+ free_page(ctx->dbounce);
return -ENOMEM;
}
@@ -135,8 +135,8 @@ void nx842_crypto_exit(struct crypto_tfm *tfm)
struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
kfree(ctx->wmem);
- free_page((unsigned long)ctx->sbounce);
- free_page((unsigned long)ctx->dbounce);
+ free_page(ctx->sbounce);
+ free_page(ctx->dbounce);
}
EXPORT_SYMBOL_GPL(nx842_crypto_exit);
diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c
index 2b5a198..3943f14 100644
--- a/drivers/dma/nbpfaxi.c
+++ b/drivers/dma/nbpfaxi.c
@@ -1065,7 +1065,7 @@ static void nbpf_free_chan_resources(struct dma_chan *dchan)
i++, ldesc++)
dma_unmap_single(dchan->device->dev, ldesc->hwdesc_dma_addr,
sizeof(*ldesc->hwdesc), DMA_TO_DEVICE);
- free_page((unsigned long)dpage);
+ free_page(dpage);
}
}
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 7820d07..f632f53 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -995,7 +995,7 @@ static void rcar_dmac_free_chan_resources(struct dma_chan *chan)
list_for_each_entry_safe(page, _page, &rchan->desc.pages, node) {
list_del(&page->node);
- free_page((unsigned long)page);
+ free_page(page);
}
pm_runtime_put(chan->device->dev);
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index 21a123c..9f5decc 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -316,7 +316,7 @@ int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state)
spin_unlock_irqrestore(&edev->lock, flags);
kobject_uevent_env(&edev->dev.kobj, KOBJ_CHANGE, envp);
- free_page((unsigned long)prop_buf);
+ free_page(prop_buf);
} else {
/* Unlock early before uevent */
spin_unlock_irqrestore(&edev->lock, flags);
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index c2f5117..f7303dd 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -3016,7 +3016,7 @@ static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card,
return &ctx->base;
out_with_header:
- free_page((unsigned long)ctx->header);
+ free_page(ctx->header);
out:
spin_lock_irq(&ohci->lock);
@@ -3120,7 +3120,7 @@ static void ohci_free_iso_context(struct fw_iso_context *base)
ohci_stop_iso(base);
context_release(&ctx->context);
- free_page((unsigned long)ctx->header);
+ free_page(ctx->header);
spin_lock_irqsave(&ohci->lock, flags);
diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c
index d0cbd5e..869282d 100644
--- a/drivers/gpu/drm/via/via_dmablit.c
+++ b/drivers/gpu/drm/via/via_dmablit.c
@@ -180,7 +180,7 @@ via_free_sg_info(struct pci_dev *pdev, drm_via_sg_info_t *vsg)
case dr_via_desc_pages_alloc:
for (i = 0; i < vsg->num_desc_pages; ++i) {
if (vsg->desc_pages[i] != NULL)
- free_page((unsigned long)vsg->desc_pages[i]);
+ free_page(vsg->desc_pages[i]);
}
kfree(vsg->desc_pages);
case dr_via_pages_locked:
diff --git a/drivers/hsi/clients/cmt_speech.c b/drivers/hsi/clients/cmt_speech.c
index 95638df..7fa47a8 100644
--- a/drivers/hsi/clients/cmt_speech.c
+++ b/drivers/hsi/clients/cmt_speech.c
@@ -1321,7 +1321,7 @@ static int cs_char_open(struct inode *unused, struct file *file)
return 0;
out3:
- free_page(p);
+ free_page((void *)p);
out2:
spin_lock_bh(&cs_char_data.lock);
cs_char_data.opened = 0;
@@ -1352,7 +1352,7 @@ static int cs_char_release(struct inode *unused, struct file *file)
cs_hsi_stop(csdata->hi);
spin_lock_bh(&csdata->lock);
csdata->hi = NULL;
- free_page(csdata->mmap_base);
+ free_page((void *)csdata->mmap_base);
cs_free_char_queue(&csdata->chardev_queue);
cs_free_char_queue(&csdata->dataind_queue);
csdata->opened = 0;
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index 6341be8..0d7ae9e 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -467,11 +467,11 @@ static void hv_synic_free_cpu(int cpu)
kfree(hv_context.event_dpc[cpu]);
kfree(hv_context.clk_evt[cpu]);
if (hv_context.synic_event_page[cpu])
- free_page((unsigned long)hv_context.synic_event_page[cpu]);
+ free_page(hv_context.synic_event_page[cpu]);
if (hv_context.synic_message_page[cpu])
- free_page((unsigned long)hv_context.synic_message_page[cpu]);
+ free_page(hv_context.synic_message_page[cpu]);
if (hv_context.post_msg_page[cpu])
- free_page((unsigned long)hv_context.post_msg_page[cpu]);
+ free_page(hv_context.post_msg_page[cpu]);
}
void hv_synic_free(void)
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index 97c0700..0002937 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -354,7 +354,7 @@ static ssize_t ide_settings_proc_write(struct file *file, const char __user *buf
return -ENOMEM;
if (copy_from_user(buf, buffer, count)) {
- free_page((unsigned long)buf);
+ free_page(buf);
return -EFAULT;
}
@@ -424,10 +424,10 @@ static ssize_t ide_settings_proc_write(struct file *file, const char __user *buf
mutex_unlock(&ide_setting_mtx);
}
} while (!for_real++);
- free_page((unsigned long)buf);
+ free_page(buf);
return count;
parse_error:
- free_page((unsigned long)buf);
+ free_page(buf);
printk("%s(): parse error\n", __func__);
return -EINVAL;
}
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 179e813..7601ee0 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -157,7 +157,7 @@ static int alloc_name(char *name)
}
i = find_first_zero_bit(inuse, PAGE_SIZE * 8);
- free_page((unsigned long) inuse);
+ free_page(inuse);
snprintf(buf, sizeof buf, name, i);
if (__ib_device_get_by_name(buf))
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index 38acb3c..a81e139 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -235,8 +235,8 @@ out:
up_write(¤t->mm->mmap_sem);
if (vma_list)
- free_page((unsigned long) vma_list);
- free_page((unsigned long) page_list);
+ free_page(vma_list);
+ free_page(page_list);
return ret < 0 ? ERR_PTR(ret) : umem;
}
diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c
index 40becdb..8b14a3f 100644
--- a/drivers/infiniband/core/umem_odp.c
+++ b/drivers/infiniband/core/umem_odp.c
@@ -613,7 +613,7 @@ int ib_umem_odp_map_dma_pages(struct ib_umem *umem, u64 user_virt, u64 bcnt,
out_put_task:
put_task_struct(owning_process);
out_no_task:
- free_page((unsigned long)local_page_list);
+ free_page(local_page_list);
return ret;
}
EXPORT_SYMBOL(ib_umem_odp_map_dma_pages);
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index c34725c..a80b709 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -687,7 +687,7 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
err = iwch_write_pbl(mhp, pages, i, n);
pbl_done:
- free_page((unsigned long) pages);
+ free_page(pages);
if (err)
goto err_pbl;
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index 58fce174..870ac06 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -882,7 +882,7 @@ err1:
static void c4iw_rdev_close(struct c4iw_rdev *rdev)
{
kfree(rdev->wr_log);
- free_page((unsigned long)rdev->status_page);
+ free_page(rdev->status_page);
c4iw_pblpool_destroy(rdev);
c4iw_rqtpool_destroy(rdev);
c4iw_destroy_resource(&rdev->resource);
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
index e1629ab..9720caa 100644
--- a/drivers/infiniband/hw/cxgb4/mem.c
+++ b/drivers/infiniband/hw/cxgb4/mem.c
@@ -773,7 +773,7 @@ struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
mhp->attr.pbl_addr + (n << 3), i);
pbl_done:
- free_page((unsigned long) pages);
+ free_page(pages);
if (err)
goto err_pbl;
diff --git a/drivers/infiniband/hw/mlx4/mr.c b/drivers/infiniband/hw/mlx4/mr.c
index 4d1e1c6..227c99bb 100644
--- a/drivers/infiniband/hw/mlx4/mr.c
+++ b/drivers/infiniband/hw/mlx4/mr.c
@@ -126,7 +126,7 @@ int mlx4_ib_umem_write_mtt(struct mlx4_ib_dev *dev, struct mlx4_mtt *mtt,
err = mlx4_write_mtt(dev->dev, mtt, n, i, pages);
out:
- free_page((unsigned long) pages);
+ free_page(pages);
return err;
}
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 6000f7a..ffa411a 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -966,7 +966,7 @@ int mlx5_ib_update_mtt(struct mlx5_ib_mr *mr, u64 start_page_index, int npages,
free_pas:
if (!use_emergency_buf)
- free_page((unsigned long)pas);
+ free_page(pas);
else
mutex_unlock(&mlx5_ib_update_mtt_emergency_buffer_mutex);
diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
index aa8391e..899add65 100644
--- a/drivers/infiniband/hw/mlx5/odp.c
+++ b/drivers/infiniband/hw/mlx5/odp.c
@@ -588,7 +588,7 @@ resolve_page_fault:
mlx5_ib_dbg(dev, "PAGE FAULT completed. QP 0x%x resume_with_error=%d, flags: 0x%x\n",
qp->mqp.qpn, resume_with_error, pfault->mpfault.flags);
- free_page((unsigned long)buffer);
+ free_page(buffer);
}
static int pages_in_range(u64 address, u32 length)
diff --git a/drivers/infiniband/hw/mthca/mthca_allocator.c b/drivers/infiniband/hw/mthca/mthca_allocator.c
index b4e0cf4..d15552a 100644
--- a/drivers/infiniband/hw/mthca/mthca_allocator.c
+++ b/drivers/infiniband/hw/mthca/mthca_allocator.c
@@ -147,7 +147,7 @@ void mthca_array_clear(struct mthca_array *array, int index)
int p = (index * sizeof (void *)) >> PAGE_SHIFT;
if (--array->page_list[p].used == 0) {
- free_page((unsigned long) array->page_list[p].page);
+ free_page(array->page_list[p].page);
array->page_list[p].page = NULL;
} else
array->page_list[p].page[index & MTHCA_ARRAY_MASK] = NULL;
@@ -179,7 +179,7 @@ void mthca_array_cleanup(struct mthca_array *array, int nent)
int i;
for (i = 0; i < (nent * sizeof (void *) + PAGE_SIZE - 1) / PAGE_SIZE; ++i)
- free_page((unsigned long) array->page_list[i].page);
+ free_page(array->page_list[i].page);
kfree(array->page_list);
}
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index dc2d48c..e95980e 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -1058,7 +1058,7 @@ static struct ib_mr *mthca_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
if (i)
err = mthca_write_mtt(dev, mr->mtt, n, pages, i);
mtt_done:
- free_page((unsigned long) pages);
+ free_page(pages);
if (err)
goto err_mtt;
diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c
index 40f85bb..6ff0112 100644
--- a/drivers/infiniband/hw/qib/qib_qp.c
+++ b/drivers/infiniband/hw/qib/qib_qp.c
@@ -110,7 +110,7 @@ static void get_map_page(struct qib_qpn_table *qpt, struct qpn_map *map)
spin_lock(&qpt->lock);
if (map->page)
- free_page(page);
+ free_page((void *)page);
else
map->page = (void *)page;
spin_unlock(&qpt->lock);
@@ -1252,7 +1252,7 @@ void qib_free_qpn_table(struct qib_qpn_table *qpt)
for (i = 0; i < ARRAY_SIZE(qpt->map); i++)
if (qpt->map[i].page)
- free_page((unsigned long) qpt->map[i].page);
+ free_page(qpt->map[i].page);
}
/**
diff --git a/drivers/infiniband/hw/usnic/usnic_uiom.c b/drivers/infiniband/hw/usnic/usnic_uiom.c
index 645a5f6..daaaf3d 100644
--- a/drivers/infiniband/hw/usnic/usnic_uiom.c
+++ b/drivers/infiniband/hw/usnic/usnic_uiom.c
@@ -190,7 +190,7 @@ out:
current->mm->locked_vm = locked;
up_write(¤t->mm->mmap_sem);
- free_page((unsigned long) page_list);
+ free_page(page_list);
return ret;
}
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c
index 0a9ad2cf..d70a619 100644
--- a/drivers/input/misc/xen-kbdfront.c
+++ b/drivers/input/misc/xen-kbdfront.c
@@ -226,7 +226,7 @@ static int xenkbd_remove(struct xenbus_device *dev)
input_unregister_device(info->kbd);
if (info->ptr)
input_unregister_device(info->ptr);
- free_page((unsigned long)info->page);
+ free_page(info->page);
kfree(info);
return 0;
}
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 8b2be1e..3102804 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1466,7 +1466,7 @@ static int alloc_new_range(struct dma_ops_domain *dma_dom,
out_free:
update_domain(&dma_dom->domain);
- free_page((unsigned long)dma_dom->aperture[index]->bitmap);
+ free_page(dma_dom->aperture[index]->bitmap);
kfree(dma_dom->aperture[index]);
dma_dom->aperture[index] = NULL;
@@ -1642,9 +1642,9 @@ static void domain_id_free(int id)
}
#define DEFINE_FREE_PT_FN(LVL, FN) \
-static void free_pt_##LVL (unsigned long __pt) \
+static void free_pt_##LVL (void *__pt) \
{ \
- unsigned long p; \
+ void *p; \
u64 *pt; \
int i; \
\
@@ -1660,10 +1660,10 @@ static void free_pt_##LVL (unsigned long __pt) \
PM_PTE_LEVEL(pt[i]) == 7) \
continue; \
\
- p = (unsigned long)IOMMU_PTE_PAGE(pt[i]); \
+ p = IOMMU_PTE_PAGE(pt[i]); \
FN(p); \
} \
- free_page((unsigned long)pt); \
+ free_page(pt); \
}
DEFINE_FREE_PT_FN(l2, free_page)
@@ -1674,7 +1674,7 @@ DEFINE_FREE_PT_FN(l6, free_pt_l5)
static void free_pagetable(struct protection_domain *domain)
{
- unsigned long root = (unsigned long)domain->pt_root;
+ void *root = domain->pt_root;
switch (domain->mode) {
case PAGE_MODE_NONE:
@@ -1713,7 +1713,7 @@ static void free_gcr3_tbl_level1(u64 *tbl)
ptr = __va(tbl[i] & PAGE_MASK);
- free_page((unsigned long)ptr);
+ free_page(ptr);
}
}
@@ -1741,7 +1741,7 @@ static void free_gcr3_table(struct protection_domain *domain)
else
BUG_ON(domain->glx != 0);
- free_page((unsigned long)domain->gcr3_tbl);
+ free_page(domain->gcr3_tbl);
}
/*
@@ -1762,7 +1762,7 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom)
for (i = 0; i < APERTURE_MAX_RANGES; ++i) {
if (!dom->aperture[i])
continue;
- free_page((unsigned long)dom->aperture[i]->bitmap);
+ free_page(dom->aperture[i]->bitmap);
kfree(dom->aperture[i]);
}
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c
index d21d4ed..a347fc3 100644
--- a/drivers/iommu/amd_iommu_v2.c
+++ b/drivers/iommu/amd_iommu_v2.c
@@ -309,7 +309,7 @@ static void free_pasid_states_level1(struct pasid_state **tbl)
if (tbl[i] == NULL)
continue;
- free_page((unsigned long)tbl[i]);
+ free_page(tbl[i]);
}
}
@@ -359,7 +359,7 @@ static void free_pasid_states(struct device_state *dev_state)
else
BUG_ON(dev_state->pasid_levels != 0);
- free_page((unsigned long)dev_state->states);
+ free_page(dev_state->states);
}
static struct pasid_state *mn_to_state(struct mmu_notifier *mn)
@@ -823,7 +823,7 @@ out_free_domain:
iommu_domain_free(dev_state->domain);
out_free_states:
- free_page((unsigned long)dev_state->states);
+ free_page(dev_state->states);
out_free_dev_state:
kfree(dev_state);
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 80e3c17..37f4c82 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -1097,7 +1097,7 @@ static void free_iommu(struct intel_iommu *iommu)
}
if (iommu->qi) {
- free_page((unsigned long)iommu->qi->desc);
+ free_page(iommu->qi->desc);
kfree(iommu->qi->desc_status);
kfree(iommu->qi);
}
@@ -1433,7 +1433,7 @@ int dmar_enable_qi(struct intel_iommu *iommu)
qi->desc_status = kzalloc(QI_LENGTH * sizeof(int), GFP_ATOMIC);
if (!qi->desc_status) {
- free_page((unsigned long) qi->desc);
+ free_page(qi->desc);
kfree(qi);
iommu->qi = NULL;
return -ENOMEM;
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index ac73876..1330044 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -655,7 +655,7 @@ static inline void *alloc_pgtable_page(int node)
static inline void free_pgtable_page(void *vaddr)
{
- free_page((unsigned long)vaddr);
+ free_page(vaddr);
}
static inline void *alloc_domain_mem(void)
diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index e321fa5..b8bcc57 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -260,8 +260,7 @@ static void msm_iommu_domain_free(struct iommu_domain *domain)
for (i = 0; i < NUM_FL_PTE; i++)
if ((fl_table[i] & 0x03) == FL_TYPE_TABLE)
- free_page((unsigned long) __va(((fl_table[i]) &
- FL_BASE_MASK)));
+ free_page(__va(((fl_table[i]) & FL_BASE_MASK)));
free_pages((unsigned long)priv->pgtable, get_order(SZ_16K));
priv->pgtable = NULL;
@@ -536,7 +535,7 @@ static size_t msm_iommu_unmap(struct iommu_domain *domain, unsigned long va,
if (sl_table[i])
used = 1;
if (!used) {
- free_page((unsigned long)sl_table);
+ free_page(sl_table);
*fl_pte = 0;
}
}
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index ebf0adb..eca78ef 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -867,11 +867,11 @@ static void rk_iommu_domain_free(struct iommu_domain *domain)
if (rk_dte_is_pt_valid(dte)) {
phys_addr_t pt_phys = rk_dte_pt_address(dte);
u32 *page_table = phys_to_virt(pt_phys);
- free_page((unsigned long)page_table);
+ free_page(page_table);
}
}
- free_page((unsigned long)rk_domain->dt);
+ free_page(rk_domain->dt);
kfree(rk_domain);
}
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index e23d1d1..2513a68 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -808,7 +808,7 @@ static void its_free_tables(struct its_node *its)
for (i = 0; i < GITS_BASER_NR_REGS; i++) {
if (its->tables[i]) {
- free_page((unsigned long)its->tables[i]);
+ free_page(its->tables[i]);
its->tables[i] = NULL;
}
}
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index 30c6068..328e249 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -275,7 +275,7 @@ static int initialize(struct file *file, const unsigned long __user *input)
free_regs:
/* FIXME: This should be in free_vcpu */
- free_page(lg->cpus[0].regs_page);
+ free_page((void *)lg->cpus[0].regs_page);
free_lg:
kfree(lg);
unlock:
@@ -377,7 +377,7 @@ static int close(struct inode *inode, struct file *file)
/* Cancels the hrtimer set via LHCALL_SET_CLOCKEVENT. */
hrtimer_cancel(&lg->cpus[i].hrt);
/* We can free up the register page we allocated. */
- free_page(lg->cpus[i].regs_page);
+ free_page((void *)lg->cpus[i].regs_page);
/*
* Now all the memory cleanups are done, it's safe to release
* the Launcher's memory management structure.
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
index e3abebc9..012b10a 100644
--- a/drivers/lguest/page_tables.c
+++ b/drivers/lguest/page_tables.c
@@ -595,7 +595,7 @@ static void release_pmd(pmd_t *spmd)
for (i = 0; i < PTRS_PER_PTE; i++)
release_pte(ptepage[i]);
/* Now we can free the page of PTEs */
- free_page((long)ptepage);
+ free_page(ptepage);
/* And zero out the PMD entry so we never release it twice. */
set_pmd(spmd, __pmd(0));
}
@@ -612,7 +612,7 @@ static void release_pgd(pgd_t *spgd)
release_pmd(&pmdpage[i]);
/* Now we can free the page of PMDs */
- free_page((long)pmdpage);
+ free_page(pmdpage);
/* And zero out the PGD entry so we never release it twice. */
set_pgd(spgd, __pgd(0));
}
@@ -639,7 +639,7 @@ static void release_pgd(pgd_t *spgd)
for (i = 0; i < PTRS_PER_PTE; i++)
release_pte(ptepage[i]);
/* Now we can free the page of PTEs */
- free_page((long)ptepage);
+ free_page(ptepage);
/* And zero out the PGD entry so we never release it twice. */
*spgd = __pgd(0);
}
@@ -1133,7 +1133,7 @@ void free_guest_pagetable(struct lguest *lg)
release_all_pagetables(lg);
/* Now free the top levels: free_page() can handle 0 just fine. */
for (i = 0; i < ARRAY_SIZE(lg->pgdirs); i++)
- free_page((long)lg->pgdirs[i].pgdir);
+ free_page(lg->pgdirs[i].pgdir);
}
/*H:481
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index 048901a..ff85b7b 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -509,7 +509,7 @@ static int rackmeter_probe(struct macio_dev* mdev,
sizeof(struct rackmeter_dma),
rm->dma_buf_v, rm->dma_buf_p);
bail_free_samples:
- free_page((unsigned long)rm->ubuf);
+ free_page(rm->ubuf);
bail_release:
#if 0
macio_release_resources(mdev);
@@ -549,7 +549,7 @@ static int rackmeter_remove(struct macio_dev* mdev)
rm->dma_buf_v, rm->dma_buf_p);
/* Free samples */
- free_page((unsigned long)rm->ubuf);
+ free_page(rm->ubuf);
#if 0
/* Release resources */
diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
index e7e4428..ce4f862 100644
--- a/drivers/media/pci/pt1/pt1.c
+++ b/drivers/media/pci/pt1/pt1.c
@@ -624,7 +624,7 @@ static void pt1_free_adapter(struct pt1_adapter *adap)
dvb_dmxdev_release(&adap->dmxdev);
dvb_dmx_release(&adap->demux);
dvb_unregister_adapter(&adap->adap);
- free_page((unsigned long)adap->buf);
+ free_page(adap->buf);
kfree(adap);
}
@@ -696,7 +696,7 @@ err_dmx_release:
err_unregister_adapter:
dvb_unregister_adapter(dvb_adap);
err_free_page:
- free_page((unsigned long)buf);
+ free_page(buf);
err_kfree:
kfree(adap);
err:
diff --git a/drivers/media/pci/saa7134/saa7134-go7007.c b/drivers/media/pci/saa7134/saa7134-go7007.c
index 8a2abb3..083297d 100644
--- a/drivers/media/pci/saa7134/saa7134-go7007.c
+++ b/drivers/media/pci/saa7134/saa7134-go7007.c
@@ -475,9 +475,9 @@ static int saa7134_go7007_init(struct saa7134_dev *dev)
allocfail:
if (saa->top)
- free_page((unsigned long)saa->top);
+ free_page(saa->top);
if (saa->bottom)
- free_page((unsigned long)saa->bottom);
+ free_page(saa->bottom);
kfree(saa);
kfree(go);
return -ENOMEM;
@@ -497,8 +497,8 @@ static int saa7134_go7007_fini(struct saa7134_dev *dev)
saa = go->hpi_context;
go->status = STATUS_SHUTDOWN;
- free_page((unsigned long)saa->top);
- free_page((unsigned long)saa->bottom);
+ free_page(saa->top);
+ free_page(saa->bottom);
v4l2_device_unregister_subdev(&saa->sd);
kfree(saa);
video_unregister_device(&go->vdev);
diff --git a/drivers/media/pci/ttpci/av7110_ca.c b/drivers/media/pci/ttpci/av7110_ca.c
index a6079b9..ed9c8380 100644
--- a/drivers/media/pci/ttpci/av7110_ca.c
+++ b/drivers/media/pci/ttpci/av7110_ca.c
@@ -182,7 +182,7 @@ static ssize_t ci_ll_write(struct dvb_ringbuffer *cibuf, struct file *file,
res = dvb_ringbuffer_write(cibuf, page, count);
out:
- free_page((unsigned long)page);
+ free_page(page);
return res;
}
diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
index 80caa70..c19037f 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -418,13 +418,13 @@ static void jpg_fbuffer_free(struct zoran_fh *fh)
if (!frag_tab)
break;
ClearPageReserved(virt_to_page(bus_to_virt(le32_to_cpu(frag_tab))));
- free_page((unsigned long)bus_to_virt(le32_to_cpu(frag_tab)));
+ free_page(bus_to_virt(le32_to_cpu(frag_tab)));
buffer->jpg.frag_tab[2 * j] = 0;
buffer->jpg.frag_tab[2 * j + 1] = 0;
}
}
- free_page((unsigned long)buffer->jpg.frag_tab);
+ free_page(buffer->jpg.frag_tab);
buffer->jpg.frag_tab = NULL;
}
diff --git a/drivers/misc/cxl/context.c b/drivers/misc/cxl/context.c
index 2faa127..a7d7efb 100644
--- a/drivers/misc/cxl/context.c
+++ b/drivers/misc/cxl/context.c
@@ -268,7 +268,7 @@ static void reclaim_ctx(struct rcu_head *rcu)
{
struct cxl_context *ctx = container_of(rcu, struct cxl_context, rcu);
- free_page((u64)ctx->sstp);
+ free_page(ctx->sstp);
if (ctx->ff_page)
__free_page(ctx->ff_page);
ctx->sstp = NULL;
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index 85761d7..2750bff 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -798,7 +798,7 @@ ssize_t cxl_afu_read_err_buffer(struct cxl_afu *afu, char *buf,
memcpy_fromio(tbuf, ebuf + aligned_start, aligned_length);
memcpy(buf, tbuf + (off & 0x7), count);
- free_page((unsigned long)tbuf);
+ free_page(tbuf);
return count;
}
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c
index e8b9331..6694cca 100644
--- a/drivers/misc/ibmasm/ibmasmfs.c
+++ b/drivers/misc/ibmasm/ibmasmfs.c
@@ -534,7 +534,7 @@ static ssize_t remote_settings_file_read(struct file *file, char __user *buf, si
retval = len;
exit:
- free_page((unsigned long)page);
+ free_page(page);
return retval;
}
diff --git a/drivers/misc/lkdtm.c b/drivers/misc/lkdtm.c
index 11fdadc..0446145 100644
--- a/drivers/misc/lkdtm.c
+++ b/drivers/misc/lkdtm.c
@@ -631,7 +631,7 @@ static ssize_t do_register_entry(enum cname which, struct file *f,
if (!buf)
return -ENOMEM;
if (copy_from_user(buf, user_buf, count)) {
- free_page((unsigned long) buf);
+ free_page(buf);
return -EFAULT;
}
/* NULL-terminate and remove enter */
@@ -639,7 +639,7 @@ static ssize_t do_register_entry(enum cname which, struct file *f,
strim(buf);
cptype = parse_cp_type(buf, count);
- free_page((unsigned long) buf);
+ free_page(buf);
if (cptype == CT_NONE)
return -EINVAL;
@@ -671,7 +671,7 @@ static ssize_t lkdtm_debugfs_read(struct file *f, char __user *user_buf,
out = simple_read_from_buffer(user_buf, count, off,
buf, n);
- free_page((unsigned long) buf);
+ free_page(buf);
return out;
}
@@ -746,7 +746,7 @@ static ssize_t direct_entry(struct file *f, const char __user *user_buf,
if (!buf)
return -ENOMEM;
if (copy_from_user(buf, user_buf, count)) {
- free_page((unsigned long) buf);
+ free_page(buf);
return -EFAULT;
}
/* NULL-terminate and remove enter */
@@ -754,7 +754,7 @@ static ssize_t direct_entry(struct file *f, const char __user *user_buf,
strim(buf);
type = parse_cp_type(buf, count);
- free_page((unsigned long) buf);
+ free_page(buf);
if (type == CT_NONE)
return -EINVAL;
diff --git a/drivers/net/ethernet/i825xx/82596.c b/drivers/net/ethernet/i825xx/82596.c
index 7ce6379..b276776 100644
--- a/drivers/net/ethernet/i825xx/82596.c
+++ b/drivers/net/ethernet/i825xx/82596.c
@@ -1230,7 +1230,7 @@ out2:
kernel_set_cachemode((void *)(dev->mem_start), 4096,
IOMAP_FULL_CACHING);
#endif
- free_page ((u32)(dev->mem_start));
+ free_page ((void *)(dev->mem_start));
out1:
out:
free_netdev(dev);
@@ -1541,7 +1541,7 @@ void __exit cleanup_module(void)
kernel_set_cachemode((void *)(dev_82596->mem_start), 4096,
IOMAP_FULL_CACHING);
#endif
- free_page ((u32)(dev_82596->mem_start));
+ free_page ((void *)(dev_82596->mem_start));
free_netdev(dev_82596);
}
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 2a0dc12..2d9d8e7 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -385,7 +385,7 @@ static void ehea_update_stats(struct work_struct *work)
stats->rx_errors = cb2->rxuerr;
out_herr:
- free_page((unsigned long)cb2);
+ free_page(cb2);
resched:
schedule_delayed_work(&port->stats_work,
round_jiffies_relative(msecs_to_jiffies(1000)));
@@ -1074,7 +1074,7 @@ int ehea_sense_port_attr(struct ehea_port *port)
out_free:
if (ret || netif_msg_probe(port))
ehea_dump(cb0, sizeof(*cb0), "ehea_sense_port_attr");
- free_page((unsigned long)cb0);
+ free_page(cb0);
out:
return ret;
}
@@ -1153,7 +1153,7 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed)
if (!prop_carrier_state || (port->phy_link == EHEA_PHY_LINK_UP))
netif_carrier_on(port->netdev);
- free_page((unsigned long)cb4);
+ free_page(cb4);
out:
return ret;
}
@@ -1410,7 +1410,7 @@ static int ehea_configure_port(struct ehea_port *port)
ret = 0;
out_free:
- free_page((unsigned long)cb0);
+ free_page(cb0);
out:
return ret;
}
@@ -1795,7 +1795,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
out_upregs:
ehea_update_bcmc_registrations();
out_free:
- free_page((unsigned long)cb0);
+ free_page(cb0);
out:
return ret;
}
@@ -1838,7 +1838,7 @@ static void ehea_promiscuous(struct net_device *dev, int enable)
port->promisc = enable;
out:
- free_page((unsigned long)cb7);
+ free_page(cb7);
}
static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr,
@@ -2156,7 +2156,7 @@ static int ehea_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
err = -EINVAL;
}
out:
- free_page((unsigned long)cb1);
+ free_page(cb1);
return err;
}
@@ -2194,7 +2194,7 @@ static int ehea_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
err = -EINVAL;
}
out:
- free_page((unsigned long)cb1);
+ free_page(cb1);
return err;
}
@@ -2269,7 +2269,7 @@ static int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp)
ret = 0;
out:
- free_page((unsigned long)cb0);
+ free_page(cb0);
return ret;
}
@@ -2604,7 +2604,7 @@ static int ehea_stop_qps(struct net_device *dev)
ret = 0;
out:
- free_page((unsigned long)cb0);
+ free_page(cb0);
return ret;
}
@@ -2707,7 +2707,7 @@ static int ehea_restart_qps(struct net_device *dev)
ehea_refill_rq3(pr, 0);
}
out:
- free_page((unsigned long)cb0);
+ free_page(cb0);
return ret;
}
@@ -2856,7 +2856,7 @@ static int ehea_sense_adapter_attr(struct ehea_adapter *adapter)
ret = 0;
out_herr:
- free_page((unsigned long)cb);
+ free_page(cb);
out:
return ret;
}
@@ -2898,7 +2898,7 @@ static int ehea_get_jumboframe_status(struct ehea_port *port, int *jumbo)
} else
ret = -EINVAL;
- free_page((unsigned long)cb4);
+ free_page(cb4);
}
out:
return ret;
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
index a0820f7..3ca48a5 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
@@ -96,7 +96,7 @@ out_nomem:
for (i = 0; i < nr_of_pages; i += pages_per_kpage) {
if (!(queue->queue_pages)[i])
break;
- free_page((unsigned long)(queue->queue_pages)[i]);
+ free_page((queue->queue_pages)[i]);
}
return -ENOMEM;
}
@@ -114,7 +114,7 @@ static void hw_queue_dtor(struct hw_queue *queue)
nr_pages = queue->queue_length / queue->pagesize;
for (i = 0; i < nr_pages; i += pages_per_kpage)
- free_page((unsigned long)(queue->queue_pages)[i]);
+ free_page((queue->queue_pages)[i]);
kfree(queue->queue_pages);
}
@@ -930,7 +930,7 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr)
mr->adapter = adapter;
ret = 0;
out:
- free_page((unsigned long)pt);
+ free_page(pt);
return ret;
}
@@ -1016,7 +1016,7 @@ u64 ehea_error_data(struct ehea_adapter *adapter, u64 res_handle,
} else
pr_err("Error data could not be fetched: %llX\n", res_handle);
- free_page((unsigned long)rblock);
+ free_page(rblock);
out:
return type;
}
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index 7af870a..cf7dd33 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -475,7 +475,7 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter)
DMA_BIDIRECTIONAL);
adapter->buffer_list_dma = DMA_ERROR_CODE;
}
- free_page((unsigned long)adapter->buffer_list_addr);
+ free_page(adapter->buffer_list_addr);
adapter->buffer_list_addr = NULL;
}
@@ -485,7 +485,7 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter)
DMA_BIDIRECTIONAL);
adapter->filter_list_dma = DMA_ERROR_CODE;
}
- free_page((unsigned long)adapter->filter_list_addr);
+ free_page(adapter->filter_list_addr);
adapter->filter_list_addr = NULL;
}
diff --git a/drivers/net/ethernet/seeq/sgiseeq.c b/drivers/net/ethernet/seeq/sgiseeq.c
index ca73366..db3a0d9 100644
--- a/drivers/net/ethernet/seeq/sgiseeq.c
+++ b/drivers/net/ethernet/seeq/sgiseeq.c
@@ -800,7 +800,7 @@ static int sgiseeq_probe(struct platform_device *pdev)
return 0;
err_out_free_page:
- free_page((unsigned long) sp->srings);
+ free_page(sp->srings);
err_out_free_dev:
free_netdev(dev);
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index 41fb6b6..36c786b 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -119,7 +119,7 @@ int efx_mcdi_init(struct efx_nic *efx)
return 0;
fail2:
#ifdef CONFIG_SFC_MCDI_LOGGING
- free_page((unsigned long)mcdi->logging_buffer);
+ free_page(mcdi->logging_buffer);
fail1:
#endif
kfree(efx->mcdi);
@@ -139,7 +139,7 @@ void efx_mcdi_fini(struct efx_nic *efx)
efx_mcdi_drv_attach(efx, false, NULL);
#ifdef CONFIG_SFC_MCDI_LOGGING
- free_page((unsigned long)efx->mcdi->iface.logging_buffer);
+ free_page(efx->mcdi->iface.logging_buffer);
#endif
kfree(efx->mcdi);
diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
index 7a254da..d3b1416 100644
--- a/drivers/net/ethernet/sgi/ioc3-eth.c
+++ b/drivers/net/ethernet/sgi/ioc3-eth.c
@@ -887,7 +887,7 @@ static void ioc3_free_rings(struct ioc3_private *ip)
n_entry = (n_entry + 1) & 511;
}
- free_page((unsigned long)ip->rxr);
+ free_page(ip->rxr);
ip->rxr = NULL;
}
}
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
index 13214a6..c1b3142 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
@@ -1430,7 +1430,7 @@ static struct iw_statistics *gelic_wl_get_wireless_stats(
is->qual.updated = IW_QUAL_ALL_INVALID;
kfree(cmd);
- free_page((unsigned long)buf);
+ free_page(buf);
pr_debug("%s: ->\n", __func__);
return is;
}
@@ -1498,7 +1498,7 @@ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan,
}
kfree(cmd);
out:
- free_page((unsigned long)buf);
+ free_page(buf);
mutex_unlock(&wl->scan_lock);
pr_debug("%s: ->\n", __func__);
return ret;
@@ -1642,7 +1642,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
wireless_send_event(port_to_netdev(wl_port(wl)), SIOCGIWSCAN, &data,
NULL);
out:
- free_page((unsigned long)buf);
+ free_page(buf);
complete(&wl->scan_done);
mutex_unlock(&wl->scan_lock);
pr_debug("%s:end\n", __func__);
@@ -1817,7 +1817,7 @@ static int gelic_wl_do_wep_setup(struct gelic_wl_info *wl)
kfree(cmd);
out:
- free_page((unsigned long)wep);
+ free_page(wep);
pr_debug("%s: ->\n", __func__);
return ret;
}
@@ -1916,7 +1916,7 @@ static int gelic_wl_do_wpa_setup(struct gelic_wl_info *wl)
else if (cmd->status || cmd->cmd_status)
ret = -ENXIO;
kfree(cmd);
- free_page((unsigned long)wpa);
+ free_page(wpa);
pr_debug("%s: --> %d\n", __func__, ret);
return ret;
}
@@ -2027,7 +2027,7 @@ static int gelic_wl_associate_bss(struct gelic_wl_info *wl,
pr_info("%s: connected\n", __func__);
}
out:
- free_page((unsigned long)common);
+ free_page(common);
pr_debug("%s: ->\n", __func__);
return ret;
}
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index f64b25c..a8493be 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1093,7 +1093,7 @@ static int kaweth_probe(
/* Device will now disappear for a moment... */
dev_info(dev, "Firmware loaded. I'll be back...\n");
err_fw:
- free_page((unsigned long)kaweth->firmware_buf);
+ free_page(kaweth->firmware_buf);
free_netdev(netdev);
return -EIO;
}
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c
index 2f0bd69..514381b 100644
--- a/drivers/net/wan/z85230.c
+++ b/drivers/net/wan/z85230.c
@@ -887,7 +887,7 @@ int z8530_sync_dma_open(struct net_device *dev, struct z8530_channel *c)
c->tx_dma_buf[0]=(void *)get_zeroed_page(GFP_KERNEL|GFP_DMA);
if(c->tx_dma_buf[0]==NULL)
{
- free_page((unsigned long)c->rx_buf[0]);
+ free_page(c->rx_buf[0]);
c->rx_buf[0]=NULL;
return -ENOBUFS;
}
@@ -1020,12 +1020,12 @@ int z8530_sync_dma_close(struct net_device *dev, struct z8530_channel *c)
if(c->rx_buf[0])
{
- free_page((unsigned long)c->rx_buf[0]);
+ free_page(c->rx_buf[0]);
c->rx_buf[0]=NULL;
}
if(c->tx_dma_buf[0])
{
- free_page((unsigned long)c->tx_dma_buf[0]);
+ free_page(c->tx_dma_buf[0]);
c->tx_dma_buf[0]=NULL;
}
chk=read_zsreg(c,R0);
@@ -1189,7 +1189,7 @@ int z8530_sync_txdma_close(struct net_device *dev, struct z8530_channel *c)
if(c->tx_dma_buf[0])
{
- free_page((unsigned long)c->tx_dma_buf[0]);
+ free_page(c->tx_dma_buf[0]);
c->tx_dma_buf[0]=NULL;
}
chk=read_zsreg(c,R0);
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c
index b4bcd94..260de71 100644
--- a/drivers/net/wireless/b43/debugfs.c
+++ b/drivers/net/wireless/b43/debugfs.c
@@ -605,7 +605,7 @@ static ssize_t b43_debugfs_write(struct file *file,
goto out_freepage;
out_freepage:
- free_page((unsigned long)buf);
+ free_page(buf);
out_unlock:
mutex_unlock(&dev->wl->mutex);
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c
index 090910e..947a823 100644
--- a/drivers/net/wireless/b43legacy/debugfs.c
+++ b/drivers/net/wireless/b43legacy/debugfs.c
@@ -312,7 +312,7 @@ static ssize_t b43legacy_debugfs_write(struct file *file,
goto out_freepage;
out_freepage:
- free_page((unsigned long)buf);
+ free_page(buf);
out_unlock:
mutex_unlock(&dev->wl->mutex);
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 26cbf1d..f79c11f 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -47,7 +47,7 @@ static ssize_t lbs_dev_info(struct file *file, char __user *userbuf,
res = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
- free_page(addr);
+ free_page((void *)addr);
return res;
}
@@ -88,7 +88,7 @@ static ssize_t lbs_sleepparams_write(struct file *file,
ret = -EINVAL;
out_unlock:
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -116,7 +116,7 @@ static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf,
ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
out_unlock:
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -162,7 +162,7 @@ static ssize_t lbs_host_sleep_write(struct file *file,
ret = count;
out_unlock:
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -181,7 +181,7 @@ static ssize_t lbs_host_sleep_read(struct file *file, char __user *userbuf,
ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -268,7 +268,7 @@ static ssize_t lbs_threshold_read(uint16_t tlv_type, uint16_t event_mask,
kfree(subscribed);
out_page:
- free_page((unsigned long)buf);
+ free_page(buf);
return ret;
}
@@ -343,7 +343,7 @@ static ssize_t lbs_threshold_write(uint16_t tlv_type, uint16_t event_mask,
out_events:
kfree(events);
out_page:
- free_page((unsigned long)buf);
+ free_page(buf);
return ret;
}
@@ -463,7 +463,7 @@ static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf,
priv->mac_offset, val);
ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
}
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -486,7 +486,7 @@ static ssize_t lbs_rdmac_write(struct file *file,
priv->mac_offset = simple_strtoul(buf, NULL, 16);
res = count;
out_unlock:
- free_page(addr);
+ free_page((void *)addr);
return res;
}
@@ -520,7 +520,7 @@ static ssize_t lbs_wrmac_write(struct file *file,
if (!res)
res = count;
out_unlock:
- free_page(addr);
+ free_page((void *)addr);
return res;
}
@@ -544,7 +544,7 @@ static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf,
priv->bbp_offset, val);
ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
}
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -568,7 +568,7 @@ static ssize_t lbs_rdbbp_write(struct file *file,
priv->bbp_offset = simple_strtoul(buf, NULL, 16);
res = count;
out_unlock:
- free_page(addr);
+ free_page((void *)addr);
return res;
}
@@ -602,7 +602,7 @@ static ssize_t lbs_wrbbp_write(struct file *file,
if (!res)
res = count;
out_unlock:
- free_page(addr);
+ free_page((void *)addr);
return res;
}
@@ -626,7 +626,7 @@ static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf,
priv->rf_offset, val);
ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
}
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -650,7 +650,7 @@ static ssize_t lbs_rdrf_write(struct file *file,
priv->rf_offset = simple_strtoul(buf, NULL, 16);
res = count;
out_unlock:
- free_page(addr);
+ free_page((void *)addr);
return res;
}
@@ -684,7 +684,7 @@ static ssize_t lbs_wrrf_write(struct file *file,
if (!res)
res = count;
out_unlock:
- free_page(addr);
+ free_page((void *)addr);
return res;
}
@@ -887,7 +887,7 @@ static ssize_t lbs_debugfs_read(struct file *file, char __user *userbuf,
res = simple_read_from_buffer(userbuf, count, ppos, p, pos);
- free_page(addr);
+ free_page((void *)addr);
return res;
}
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index 9824d8d..4ed3dba 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -147,7 +147,7 @@ mwifiex_info_read(struct file *file, char __user *ubuf,
(unsigned long) p - page);
free_and_exit:
- free_page(page);
+ free_page((void *)page);
return ret;
}
@@ -257,7 +257,7 @@ mwifiex_getlog_read(struct file *file, char __user *ubuf,
(unsigned long) p - page);
free_and_exit:
- free_page(page);
+ free_page((void *)page);
return ret;
}
@@ -430,7 +430,7 @@ mwifiex_debug_read(struct file *file, char __user *ubuf,
(unsigned long) p - page);
free_and_exit:
- free_page(page);
+ free_page((void *)page);
return ret;
}
@@ -474,7 +474,7 @@ mwifiex_regrdwr_write(struct file *file,
ret = count;
}
done:
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -531,7 +531,7 @@ mwifiex_regrdwr_read(struct file *file, char __user *ubuf,
ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
done:
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -557,7 +557,7 @@ mwifiex_debug_mask_read(struct file *file, char __user *ubuf,
priv->adapter->debug_mask);
ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
- free_page(page);
+ free_page((void *)page);
return ret;
}
@@ -592,7 +592,7 @@ mwifiex_debug_mask_write(struct file *file, const char __user *ubuf,
priv->adapter->debug_mask = debug_mask;
ret = count;
done:
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -645,7 +645,7 @@ mwifiex_memrw_write(struct file *file, const char __user *ubuf, size_t count,
ret = count;
done:
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -669,7 +669,7 @@ mwifiex_memrw_read(struct file *file, char __user *ubuf,
priv->mem_rw.value);
ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -712,7 +712,7 @@ mwifiex_rdeeprom_write(struct file *file,
ret = count;
}
done:
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -759,7 +759,7 @@ mwifiex_rdeeprom_read(struct file *file, char __user *ubuf,
done:
ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
out_free:
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -823,7 +823,7 @@ mwifiex_hscfg_write(struct file *file, const char __user *ubuf,
priv->adapter->hs_enabling = false;
ret = count;
done:
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
@@ -852,7 +852,7 @@ mwifiex_hscfg_read(struct file *file, char __user *ubuf,
ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos);
- free_page(addr);
+ free_page((void *)addr);
return ret;
}
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index ec7f6af..25defe4 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -6348,7 +6348,7 @@ err_mbox:
kfree(wl->mbox);
err_fwlog:
- free_page((unsigned long)wl->fwlog);
+ free_page(wl->fwlog);
err_dummy_packet:
dev_kfree_skb(wl->dummy_packet);
@@ -6384,7 +6384,7 @@ int wlcore_free_hw(struct wl1271 *wl)
kfree(wl->buffer_32);
kfree(wl->mbox);
- free_page((unsigned long)wl->fwlog);
+ free_page(wl->fwlog);
dev_kfree_skb(wl->dummy_packet);
free_pages((unsigned long)wl->aggr_buf, get_order(wl->aggr_buf_size));
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index d6abf19..0f9b7cf 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1587,11 +1587,11 @@ static int setup_netfront(struct xenbus_device *dev,
alloc_evtchn_fail:
gnttab_end_foreign_access_ref(queue->rx_ring_ref, 0);
grant_rx_ring_fail:
- free_page((unsigned long)rxs);
+ free_page(rxs);
alloc_rx_ring_fail:
gnttab_end_foreign_access_ref(queue->tx_ring_ref, 0);
grant_tx_ring_fail:
- free_page((unsigned long)txs);
+ free_page(txs);
fail:
return err;
}
diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index c777b97..85f69e5 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -774,7 +774,7 @@ static void free_pdev(struct pcifront_device *pdev)
gnttab_end_foreign_access(pdev->gnt_ref, 0 /* r/w page */,
(unsigned long)pdev->sh_info);
else
- free_page((unsigned long)pdev->sh_info);
+ free_page(pdev->sh_info);
dev_set_drvdata(&pdev->xdev->dev, NULL);
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index aaeeae8..996839f 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -2208,7 +2208,7 @@ static int __init dell_init(void)
fail_backlight:
dell_cleanup_rfkill();
fail_rfkill:
- free_page((unsigned long)buffer);
+ free_page(buffer);
fail_buffer:
platform_device_del(platform_device);
fail_platform_device2:
@@ -2233,7 +2233,7 @@ static void __exit dell_exit(void)
platform_driver_unregister(&platform_driver);
}
kfree(da_tokens);
- free_page((unsigned long)buffer);
+ free_page(buffer);
}
/* dell-rbtn.c driver export functions which will not work correctly (and could
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index ed2d7fd..e0063c5 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -330,7 +330,7 @@ int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env)
}
out:
- free_page((unsigned long)prop_buf);
+ free_page(prop_buf);
return ret;
}
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index a263c10..5257c80 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -136,8 +136,8 @@ struct dasd_device *dasd_alloc_device(void)
void dasd_free_device(struct dasd_device *device)
{
kfree(device->private);
- free_page((unsigned long) device->erp_mem);
- free_pages((unsigned long) device->ccw_mem, 1);
+ free_page(device->erp_mem);
+ free_pages((unsigned long)device->ccw_mem, 1);
kfree(device);
}
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index cb61f30..f5746ad 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -460,7 +460,7 @@ dasd_diag_check_device(struct dasd_device *device)
rc = 0;
}
out_label:
- free_page((long) label);
+ free_page(label);
out:
if (rc) {
device->block = NULL;
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 9083247..c2d120a 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -4270,7 +4270,7 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
if (len > 0)
printk(KERN_ERR "%s", page);
}
- free_page((unsigned long) page);
+ free_page(page);
}
@@ -4403,7 +4403,7 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
" SORRY - NO TSB DATA AVAILABLE\n");
}
printk(KERN_ERR "%s", page);
- free_page((unsigned long) page);
+ free_page(page);
}
static void dasd_eckd_dump_sense(struct dasd_device *device,
@@ -5130,7 +5130,7 @@ dasd_eckd_init(void)
else {
kfree(path_verification_worker);
kfree(dasd_reserve_req);
- free_page((unsigned long)rawpadpage);
+ free_page(rawpadpage);
}
return ret;
}
@@ -5141,7 +5141,7 @@ dasd_eckd_cleanup(void)
ccw_driver_unregister(&dasd_eckd_driver);
kfree(path_verification_worker);
kfree(dasd_reserve_req);
- free_page((unsigned long)rawpadpage);
+ free_page(rawpadpage);
}
module_init(dasd_eckd_init);
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
index 21ef63c..6cab911 100644
--- a/drivers/s390/block/dasd_eer.c
+++ b/drivers/s390/block/dasd_eer.c
@@ -216,7 +216,7 @@ static void dasd_eer_free_buffer_pages(char **buf, int no_pages)
int i;
for (i = 0; i < no_pages; i++)
- free_page((unsigned long) buf[i]);
+ free_page(buf[i]);
}
/*
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index c9262e7..0b69bad 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -571,7 +571,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
}
if (len > 0)
printk(KERN_ERR "%s", page);
- free_page((unsigned long) page);
+ free_page(page);
}
/*
diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c
index 75d9896..146a3ae 100644
--- a/drivers/s390/block/scm_blk.c
+++ b/drivers/s390/block/scm_blk.c
@@ -41,7 +41,7 @@ static void __scm_free_rq(struct scm_request *scmrq)
{
struct aob_rq_header *aobrq = to_aobrq(scmrq);
- free_page((unsigned long) scmrq->aob);
+ free_page(scmrq->aob);
__scm_free_rq_cluster(scmrq);
kfree(scmrq->request);
kfree(aobrq);
diff --git a/drivers/s390/block/scm_blk_cluster.c b/drivers/s390/block/scm_blk_cluster.c
index 7497ddd..65952f7 100644
--- a/drivers/s390/block/scm_blk_cluster.c
+++ b/drivers/s390/block/scm_blk_cluster.c
@@ -29,7 +29,7 @@ void __scm_free_rq_cluster(struct scm_request *scmrq)
return;
for (i = 0; i < 2 * write_cluster_size; i++)
- free_page((unsigned long) scmrq->cluster.buf[i]);
+ free_page(scmrq->cluster.buf[i]);
kfree(scmrq->cluster.buf);
}
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 288f59a..542c6d0 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -149,7 +149,7 @@ static int xpram_present(void)
if (!mem_page)
return -ENOMEM;
rc = xpram_page_in(mem_page, 0);
- free_page(mem_page);
+ free_page((void *)mem_page);
return rc ? -ENXIO : 0;
}
@@ -173,7 +173,7 @@ static unsigned long xpram_highest_page_index(void)
add_bit >>= 1;
}
- free_page (mem_page);
+ free_page((void *)mem_page);
return page_index;
}
diff --git a/drivers/s390/char/diag_ftp.c b/drivers/s390/char/diag_ftp.c
index a5ccbf6..d110a32 100644
--- a/drivers/s390/char/diag_ftp.c
+++ b/drivers/s390/char/diag_ftp.c
@@ -207,7 +207,7 @@ ssize_t diag_ftp_cmd(const struct hmcdrv_ftp_cmdspec *ftp, size_t *fsize)
}
out_free:
- free_page((unsigned long) ldfpl);
+ free_page(ldfpl);
out:
return len;
}
diff --git a/drivers/s390/char/hmcdrv_ftp.c b/drivers/s390/char/hmcdrv_ftp.c
index d4b61d9..d8a07bb 100644
--- a/drivers/s390/char/hmcdrv_ftp.c
+++ b/drivers/s390/char/hmcdrv_ftp.c
@@ -216,7 +216,7 @@ int hmcdrv_ftp_probe(void)
break;
} /* switch */
out:
- free_page((unsigned long) ftp.buf);
+ free_page(ftp.buf);
return rc;
}
EXPORT_SYMBOL(hmcdrv_ftp_probe);
diff --git a/drivers/s390/char/sclp_async.c b/drivers/s390/char/sclp_async.c
index 19c2542..bc029d6 100644
--- a/drivers/s390/char/sclp_async.c
+++ b/drivers/s390/char/sclp_async.c
@@ -186,7 +186,7 @@ static int __init sclp_async_init(void)
goto out;
out_mem:
kfree(request);
- free_page((unsigned long) sccb);
+ free_page(sccb);
unregister_sysctl_table(callhome_sysctl_header);
out_sclp:
sclp_unregister(&sclp_async_register);
@@ -201,7 +201,7 @@ static void __exit sclp_async_exit(void)
&call_home_panic_nb);
unregister_sysctl_table(callhome_sysctl_header);
sclp_unregister(&sclp_async_register);
- free_page((unsigned long) sccb);
+ free_page(sccb);
kfree(request);
}
module_exit(sclp_async_exit);
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index 806239c..09b6c07 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -129,7 +129,7 @@ int sclp_get_core_info(struct sclp_core_info *info)
}
sclp_fill_core_info(info, sccb);
out:
- free_page((unsigned long) sccb);
+ free_page(sccb);
return rc;
}
@@ -237,7 +237,7 @@ static int do_assign_storage(sclp_cmdw_t cmd, u16 rn)
break;
}
out:
- free_page((unsigned long) sccb);
+ free_page(sccb);
return rc;
}
@@ -294,7 +294,7 @@ static int sclp_attach_storage(u8 id)
break;
}
out:
- free_page((unsigned long) sccb);
+ free_page(sccb);
return rc;
}
@@ -570,7 +570,7 @@ static int __init sclp_detect_standby_memory(void)
out_driver:
platform_driver_unregister(&sclp_mem_pdrv);
out:
- free_page((unsigned long) sccb);
+ free_page(sccb);
return rc;
}
__initcall(sclp_detect_standby_memory);
@@ -622,7 +622,7 @@ static int do_pci_configure(sclp_cmdw_t cmd, u32 fid)
break;
}
out:
- free_page((unsigned long) sccb);
+ free_page(sccb);
return rc;
}
@@ -682,7 +682,7 @@ static int do_chp_configure(sclp_cmdw_t cmd)
break;
}
out:
- free_page((unsigned long) sccb);
+ free_page(sccb);
return rc;
}
@@ -753,6 +753,6 @@ int sclp_chp_read_info(struct sclp_chp_info *info)
memcpy(info->standby, sccb->standby, SCLP_CHP_INFO_MASK_SIZE);
memcpy(info->configured, sccb->configured, SCLP_CHP_INFO_MASK_SIZE);
out:
- free_page((unsigned long) sccb);
+ free_page(sccb);
return rc;
}
diff --git a/drivers/s390/char/sclp_cpi_sys.c b/drivers/s390/char/sclp_cpi_sys.c
index 2acea80..9895146 100644
--- a/drivers/s390/char/sclp_cpi_sys.c
+++ b/drivers/s390/char/sclp_cpi_sys.c
@@ -118,7 +118,7 @@ static struct sclp_req *cpi_prepare_req(void)
static void cpi_free_req(struct sclp_req *req)
{
- free_page((unsigned long) req->sccb);
+ free_page(req->sccb);
kfree(req);
}
diff --git a/drivers/s390/char/sclp_ctl.c b/drivers/s390/char/sclp_ctl.c
index 648cb86..8b90112 100644
--- a/drivers/s390/char/sclp_ctl.c
+++ b/drivers/s390/char/sclp_ctl.c
@@ -81,7 +81,7 @@ static int sclp_ctl_ioctl_sccb(void __user *user_area)
if (copy_to_user(u64_to_uptr(ctl_sccb.sccb), sccb, sccb->length))
rc = -EFAULT;
out_free:
- free_page((unsigned long) sccb);
+ free_page(sccb);
return rc;
}
diff --git a/drivers/s390/char/sclp_ftp.c b/drivers/s390/char/sclp_ftp.c
index 6561cc5..66bf759 100644
--- a/drivers/s390/char/sclp_ftp.c
+++ b/drivers/s390/char/sclp_ftp.c
@@ -152,7 +152,7 @@ static int sclp_ftp_et7(const struct hmcdrv_ftp_cmdspec *ftp)
}
out_free:
- free_page((unsigned long) sccb);
+ free_page(sccb);
kfree(req);
return rc;
}
@@ -260,7 +260,7 @@ int sclp_ftp_startup(void)
info222->lpar_number, info222->name);
}
- free_page(info);
+ free_page((void *)info);
}
#endif /* DEBUG */
return 0;
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c
index 68d6ee7..373d280 100644
--- a/drivers/s390/char/sclp_vt220.c
+++ b/drivers/s390/char/sclp_vt220.c
@@ -668,7 +668,7 @@ static void __init __sclp_vt220_free_pages(void)
list_for_each_safe(page, p, &sclp_vt220_empty) {
list_del(page);
- free_page((unsigned long) page);
+ free_page(page);
}
}
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index 799c152..a42ef55 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -839,7 +839,7 @@ static void vmlogrdr_cleanup(void)
}
for (i=0; i < MAXMINOR; ++i ) {
vmlogrdr_unregister_device(&sys_ser[i]);
- free_page((unsigned long)sys_ser[i].buffer);
+ free_page(sys_ser[i].buffer);
}
vmlogrdr_unregister_driver();
if (vmlogrdr_major) {
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 0efb27f..3974f34 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -551,7 +551,7 @@ static ssize_t diag14_read(struct file *file, char __user *ubuf, size_t count,
*offs += copied;
rc = copied;
fail:
- free_page((unsigned long) buf);
+ free_page(buf);
return rc;
}
@@ -636,7 +636,7 @@ static int verify_uri_device(struct urdev *urd)
rc = 0;
fail_free_buf:
- free_page((unsigned long) buf);
+ free_page(buf);
fail_free_fcb:
kfree(fcb);
return rc;
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c
index 823f41f..4a6f730 100644
--- a/drivers/s390/char/zcore.c
+++ b/drivers/s390/char/zcore.c
@@ -626,7 +626,7 @@ static int __init zcore_reipl_init(void)
if (rc || csum_partial(ipl_block, ipl_block->hdr.len, 0) !=
ipib_info.checksum) {
TRACE("Checksum does not match\n");
- free_page((unsigned long) ipl_block);
+ free_page(ipl_block);
ipl_block = NULL;
}
return 0;
@@ -733,7 +733,7 @@ static void __exit zcore_exit(void)
{
debug_unregister(zcore_dbf);
sclp_sdias_exit();
- free_page((unsigned long) ipl_block);
+ free_page(ipl_block);
debugfs_remove(zcore_hsa_file);
debugfs_remove(zcore_reipl_file);
debugfs_remove(zcore_memmap_file);
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index a831d18..e7640e4 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -864,8 +864,8 @@ chsc_secm(struct channel_subsystem *css, int enable)
css->cub_addr1 = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
css->cub_addr2 = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
if (!css->cub_addr1 || !css->cub_addr2) {
- free_page((unsigned long)css->cub_addr1);
- free_page((unsigned long)css->cub_addr2);
+ free_page(css->cub_addr1);
+ free_page(css->cub_addr2);
return -ENOMEM;
}
}
@@ -882,8 +882,8 @@ chsc_secm(struct channel_subsystem *css, int enable)
chsc_remove_cmg_attr(css);
}
if (!css->cm_enabled) {
- free_page((unsigned long)css->cub_addr1);
- free_page((unsigned long)css->cub_addr2);
+ free_page(css->cub_addr1);
+ free_page(css->cub_addr2);
}
return ret;
}
@@ -1068,16 +1068,16 @@ int __init chsc_init(void)
goto out_err;
return ret;
out_err:
- free_page((unsigned long)chsc_page);
- free_page((unsigned long)sei_page);
+ free_page(chsc_page);
+ free_page(sei_page);
return ret;
}
void __init chsc_init_cleanup(void)
{
crw_unregister_handler(CRW_RSC_CSS);
- free_page((unsigned long)chsc_page);
- free_page((unsigned long)sei_page);
+ free_page(chsc_page);
+ free_page(sei_page);
}
int __chsc_enable_facility(struct chsc_sda_area *sda_area, int operation_code)
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index 213159d..41ee3da 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -361,7 +361,7 @@ out_free:
snprintf(dbf, sizeof(dbf), "ret:%d", ret);
CHSC_LOG(0, dbf);
kfree(request);
- free_page((unsigned long)chsc_area);
+ free_page(chsc_area);
return ret;
}
@@ -393,7 +393,7 @@ static int chsc_ioctl_on_close_set(void __user *user_area)
goto out_unlock;
out_free_chsc:
- free_page((unsigned long)on_close_chsc_area);
+ free_page(on_close_chsc_area);
on_close_chsc_area = NULL;
out_free_request:
kfree(on_close_request);
@@ -415,7 +415,7 @@ static int chsc_ioctl_on_close_remove(void)
ret = -ENOENT;
goto out_unlock;
}
- free_page((unsigned long)on_close_chsc_area);
+ free_page(on_close_chsc_area);
on_close_chsc_area = NULL;
kfree(on_close_request);
on_close_request = NULL;
@@ -454,7 +454,7 @@ static int chsc_ioctl_start_sync(void __user *user_area)
else
ret = 0;
out_free:
- free_page((unsigned long)chsc_area);
+ free_page(chsc_area);
return ret;
}
@@ -516,7 +516,7 @@ static int chsc_ioctl_info_channel_path(void __user *user_cd)
ret = 0;
out_free:
kfree(cd);
- free_page((unsigned long)scpcd_area);
+ free_page(scpcd_area);
return ret;
}
@@ -578,7 +578,7 @@ static int chsc_ioctl_info_cu(void __user *user_cd)
ret = 0;
out_free:
kfree(cd);
- free_page((unsigned long)scucd_area);
+ free_page(scucd_area);
return ret;
}
@@ -642,7 +642,7 @@ static int chsc_ioctl_info_sch_cu(void __user *user_cud)
ret = 0;
out_free:
kfree(cud);
- free_page((unsigned long)sscud_area);
+ free_page(sscud_area);
return ret;
}
@@ -702,7 +702,7 @@ static int chsc_ioctl_conf_info(void __user *user_ci)
ret = 0;
out_free:
kfree(ci);
- free_page((unsigned long)sci_area);
+ free_page(sci_area);
return ret;
}
@@ -785,7 +785,7 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl)
ret = 0;
out_free:
kfree(ccl);
- free_page((unsigned long)sccl_area);
+ free_page(sccl_area);
return ret;
}
@@ -815,7 +815,7 @@ static int chsc_ioctl_chpd(void __user *user_chpd)
ret = -EFAULT;
out_free:
kfree(chpd);
- free_page((unsigned long)scpd_area);
+ free_page(scpd_area);
return ret;
}
@@ -874,7 +874,7 @@ static int chsc_ioctl_dcal(void __user *user_dcal)
ret = 0;
out_free:
kfree(dcal);
- free_page((unsigned long)sdcal_area);
+ free_page(sdcal_area);
return ret;
}
@@ -947,7 +947,7 @@ static int chsc_release(struct inode *inode, struct file *filp)
}
snprintf(dbf, sizeof(dbf), "relret:%d", ret);
CHSC_LOG(0, dbf);
- free_page((unsigned long)on_close_chsc_area);
+ free_page(on_close_chsc_area);
on_close_chsc_area = NULL;
kfree(on_close_request);
on_close_request = NULL;
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index 4bb5262..86c4599 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -1836,7 +1836,7 @@ int qdio_pnso_brinfo(struct subchannel_id schid,
(*response) = rr->response.code;
out:
- free_page((unsigned long)rr);
+ free_page(rr);
return rc;
}
EXPORT_SYMBOL_GPL(qdio_pnso_brinfo);
diff --git a/drivers/s390/cio/qdio_setup.c b/drivers/s390/cio/qdio_setup.c
index 48b3866..637d1a8 100644
--- a/drivers/s390/cio/qdio_setup.c
+++ b/drivers/s390/cio/qdio_setup.c
@@ -44,7 +44,7 @@ void qdio_free_buffers(struct qdio_buffer **buf, unsigned int count)
int pos;
for (pos = 0; pos < count; pos += QBUFF_PER_PAGE)
- free_page((unsigned long) buf[pos]);
+ free_page(buf[pos]);
}
EXPORT_SYMBOL_GPL(qdio_free_buffers);
@@ -326,7 +326,7 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,
out:
if (!irq_ptr)
- free_page((unsigned long)ssqd);
+ free_page(ssqd);
return rc;
}
@@ -364,7 +364,7 @@ void qdio_release_memory(struct qdio_irq *irq_ptr)
for (i = 0; i < QDIO_MAX_QUEUES_PER_IRQ; i++) {
q = irq_ptr->input_qs[i];
if (q) {
- free_page((unsigned long) q->slib);
+ free_page(q->slib);
kmem_cache_free(qdio_q_cache, q);
}
}
@@ -384,13 +384,13 @@ void qdio_release_memory(struct qdio_irq *irq_ptr)
qdio_disable_async_operation(&q->u.out);
}
- free_page((unsigned long) q->slib);
+ free_page(q->slib);
kmem_cache_free(qdio_q_cache, q);
}
}
- free_page((unsigned long) irq_ptr->qdr);
- free_page(irq_ptr->chsc_page);
- free_page((unsigned long) irq_ptr);
+ free_page(irq_ptr->qdr);
+ free_page((void *)irq_ptr->chsc_page);
+ free_page(irq_ptr);
}
static void __qdio_allocate_fill_qdr(struct qdio_irq *irq_ptr,
diff --git a/drivers/s390/cio/scm.c b/drivers/s390/cio/scm.c
index 15268ed..db1812e 100644
--- a/drivers/s390/cio/scm.c
+++ b/drivers/s390/cio/scm.c
@@ -247,7 +247,7 @@ int scm_update_information(void)
token = scm_info->restok;
} while (token);
- free_page((unsigned long)scm_info);
+ free_page(scm_info);
return ret;
}
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index 9f8fa42..0d6b831 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -1393,7 +1393,7 @@ static int zcrypt_rng_device_add(void)
return 0;
out_free:
- free_page((unsigned long) zcrypt_rng_buffer);
+ free_page(zcrypt_rng_buffer);
out:
mutex_unlock(&zcrypt_rng_mutex);
return rc;
@@ -1405,7 +1405,7 @@ static void zcrypt_rng_device_remove(void)
zcrypt_rng_device_count--;
if (zcrypt_rng_device_count == 0) {
hwrng_unregister(&zcrypt_rng_dev);
- free_page((unsigned long) zcrypt_rng_buffer);
+ free_page(zcrypt_rng_buffer);
}
mutex_unlock(&zcrypt_rng_mutex);
}
diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
index 9a2dd47..6c6a435 100644
--- a/drivers/s390/crypto/zcrypt_msgtype6.c
+++ b/drivers/s390/crypto/zcrypt_msgtype6.c
@@ -941,7 +941,7 @@ static long zcrypt_msgtype6_modexpo(struct zcrypt_device *zdev,
/* Signal pending. */
ap_cancel_message(zdev->ap_dev, &ap_msg);
out_free:
- free_page((unsigned long) ap_msg.message);
+ free_page(ap_msg.message);
return rc;
}
@@ -985,7 +985,7 @@ static long zcrypt_msgtype6_modexpo_crt(struct zcrypt_device *zdev,
/* Signal pending. */
ap_cancel_message(zdev->ap_dev, &ap_msg);
out_free:
- free_page((unsigned long) ap_msg.message);
+ free_page(ap_msg.message);
return rc;
}
diff --git a/drivers/s390/crypto/zcrypt_pcixcc.c b/drivers/s390/crypto/zcrypt_pcixcc.c
index f418527..83e407f 100644
--- a/drivers/s390/crypto/zcrypt_pcixcc.c
+++ b/drivers/s390/crypto/zcrypt_pcixcc.c
@@ -200,7 +200,7 @@ static int zcrypt_pcixcc_mcl(struct ap_device *ap_dev)
else
rc = ZCRYPT_PCIXCC_MCL3;
out_free:
- free_page((unsigned long) reply);
+ free_page(reply);
return rc;
}
@@ -253,7 +253,7 @@ static int zcrypt_pcixcc_rng_supported(struct ap_device *ap_dev)
else
rc = 0;
out_free:
- free_page((unsigned long) ap_msg.message);
+ free_page(ap_msg.message);
return rc;
}
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 31ac53f..c753f8f 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -268,8 +268,7 @@ static int qeth_alloc_buffer_pool(struct qeth_card *card)
ptr = (void *) __get_free_page(GFP_KERNEL);
if (!ptr) {
while (j > 0)
- free_page((unsigned long)
- pool_entry->elements[--j]);
+ free_page(pool_entry->elements[--j]);
kfree(pool_entry);
qeth_free_buffer_pool(card);
return -ENOMEM;
@@ -1311,7 +1310,7 @@ static void qeth_free_buffer_pool(struct qeth_card *card)
list_for_each_entry_safe(pool_entry, tmp,
&card->qdio.init_pool.entry_list, init_list){
for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i)
- free_page((unsigned long)pool_entry->elements[i]);
+ free_page(pool_entry->elements[i]);
list_del(&pool_entry->init_list);
kfree(pool_entry);
}
@@ -2763,7 +2762,7 @@ static inline struct qeth_buffer_pool_entry *qeth_find_free_buffer_pool_entry(
if (!page) {
return NULL;
} else {
- free_page((unsigned long)entry->elements[i]);
+ free_page(entry->elements[i]);
entry->elements[i] = page_address(page);
if (card->options.performance_stats)
card->perf_stats.sg_alloc_page_rx++;
@@ -3180,7 +3179,7 @@ static void qeth_get_trap_id(struct qeth_card *card, struct qeth_trap_id *tid)
EBCASC(info322->vm[0].name, sizeof(info322->vm[0].name));
memcpy(tid->vmname, info322->vm[0].name, sizeof(tid->vmname));
}
- free_page(info);
+ free_page((void *)info);
return;
}
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index c00ac46..a3671dba 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -550,7 +550,7 @@ void zfcp_sg_free_table(struct scatterlist *sg, int count)
for (i = 0; i < count; i++, sg++)
if (sg)
- free_page((unsigned long) sg_virt(sg));
+ free_page(sg_virt(sg));
else
break;
}
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 1e5bf0c..b91d769 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -619,7 +619,7 @@ static void free_mem(struct cxlflash_cfg *cfg)
for (i = 0; i < CXLFLASH_NUM_CMDS; i++) {
buf = afu->cmd[i].buf;
if (!((u64)buf & (PAGE_SIZE - 1)))
- free_page((ulong)buf);
+ free_page(buf);
}
free_pages((ulong)afu, get_order(sizeof(struct afu)));
diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
index cac2e6a..0083441 100644
--- a/drivers/scsi/cxlflash/superpipe.c
+++ b/drivers/scsi/cxlflash/superpipe.c
@@ -733,7 +733,7 @@ static void destroy_context(struct cxlflash_cfg *cfg,
}
/* Free memory associated with context */
- free_page((ulong)ctxi->rht_start);
+ free_page(ctxi->rht_start);
kfree(ctxi->rht_needs_ws);
kfree(ctxi->rht_lun);
kfree(ctxi);
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 6aa317c..166d834 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -665,7 +665,7 @@ static void ibmvfc_release_crq_queue(struct ibmvfc_host *vhost)
vhost->state = IBMVFC_NO_CRQ;
vhost->logged_in = 0;
dma_unmap_single(vhost->dev, crq->msg_token, PAGE_SIZE, DMA_BIDIRECTIONAL);
- free_page((unsigned long)crq->msgs);
+ free_page(crq->msgs);
}
/**
@@ -4565,7 +4565,7 @@ req_irq_failed:
reg_crq_failed:
dma_unmap_single(dev, crq->msg_token, PAGE_SIZE, DMA_BIDIRECTIONAL);
map_failed:
- free_page((unsigned long)crq->msgs);
+ free_page(crq->msgs);
return retrc;
}
@@ -4590,7 +4590,7 @@ static void ibmvfc_free_mem(struct ibmvfc_host *vhost)
dma_pool_destroy(vhost->sg_pool);
dma_unmap_single(vhost->dev, async_q->msg_token,
async_q->size * sizeof(*async_q->msgs), DMA_BIDIRECTIONAL);
- free_page((unsigned long)async_q->msgs);
+ free_page(async_q->msgs);
LEAVE;
}
@@ -4680,7 +4680,7 @@ unmap_async_crq:
dma_unmap_single(dev, async_q->msg_token,
async_q->size * sizeof(*async_q->msgs), DMA_BIDIRECTIONAL);
free_async_crq:
- free_page((unsigned long)async_q->msgs);
+ free_page(async_q->msgs);
nomem:
LEAVE;
return -ENOMEM;
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index adfef9d..88a4eff 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -165,7 +165,7 @@ static void ibmvscsi_release_crq_queue(struct crq_queue *queue,
dma_unmap_single(hostdata->dev,
queue->msg_token,
queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
- free_page((unsigned long)queue->msgs);
+ free_page(queue->msgs);
}
/**
@@ -410,7 +410,7 @@ static int ibmvscsi_init_crq_queue(struct crq_queue *queue,
queue->msg_token,
queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
map_failed:
- free_page((unsigned long)queue->msgs);
+ free_page(queue->msgs);
malloc_failed:
return -1;
}
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 536cd5a..1a05ba8 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3237,7 +3237,7 @@ static void ipr_release_dump(struct kref *kref)
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
for (i = 0; i < dump->ioa_dump.next_page_index; i++)
- free_page((unsigned long) dump->ioa_dump.ioa_data[i]);
+ free_page(dump->ioa_dump.ioa_data[i]);
vfree(dump->ioa_dump.ioa_data);
kfree(dump);
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 2c1160c7..2f93f80 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -724,7 +724,7 @@ static ssize_t proc_scsi_devinfo_write(struct file *file,
scsi_dev_info_list_add_str(buffer);
out:
- free_page((unsigned long)buffer);
+ free_page(buffer);
return err;
}
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
index 251598e..e0e0e5d 100644
--- a/drivers/scsi/scsi_proc.c
+++ b/drivers/scsi/scsi_proc.c
@@ -66,7 +66,7 @@ static ssize_t proc_scsi_host_write(struct file *file, const char __user *buf,
ret = shost->hostt->write_info(shost, page, count);
}
out:
- free_page((unsigned long)page);
+ free_page(page);
return ret;
}
@@ -366,7 +366,7 @@ static ssize_t proc_scsi_write(struct file *file, const char __user *buf,
err = length;
out:
- free_page((unsigned long)buffer);
+ free_page(buffer);
return err;
}
diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
index 9dc8687..d59486a 100644
--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -729,7 +729,7 @@ static int scsifront_alloc_ring(struct vscsifrnt_info *info)
err = xenbus_grant_ring(dev, sring, 1, &gref);
if (err < 0) {
- free_page((unsigned long)sring);
+ free_page(sring);
xenbus_dev_fatal(dev, err,
"fail to grant shared ring (Front to Back)");
return err;
diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index bb00be8..5b59d23 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -835,7 +835,7 @@ fail_release_rx:
dma_release_channel(espi->dma_rx);
espi->dma_rx = NULL;
fail_free_page:
- free_page((unsigned long)espi->zeropage);
+ free_page(espi->zeropage);
return ret;
}
@@ -852,7 +852,7 @@ static void ep93xx_spi_release_dma(struct ep93xx_spi *espi)
}
if (espi->zeropage)
- free_page((unsigned long)espi->zeropage);
+ free_page(espi->zeropage);
}
static int ep93xx_spi_probe(struct platform_device *pdev)
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index a7934ab..b8286e7 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -1118,9 +1118,9 @@ static int sh_msiof_request_dma(struct sh_msiof_spi_priv *p)
unmap_tx_page:
dma_unmap_single(tx_dev, p->tx_dma_addr, PAGE_SIZE, DMA_TO_DEVICE);
free_rx_page:
- free_page((unsigned long)p->rx_dma_page);
+ free_page(p->rx_dma_page);
free_tx_page:
- free_page((unsigned long)p->tx_dma_page);
+ free_page(p->tx_dma_page);
free_rx_chan:
dma_release_channel(master->dma_rx);
free_tx_chan:
@@ -1142,8 +1142,8 @@ static void sh_msiof_release_dma(struct sh_msiof_spi_priv *p)
PAGE_SIZE, DMA_FROM_DEVICE);
dma_unmap_single(master->dma_tx->device->dev, p->tx_dma_addr,
PAGE_SIZE, DMA_TO_DEVICE);
- free_page((unsigned long)p->rx_dma_page);
- free_page((unsigned long)p->tx_dma_page);
+ free_page(p->rx_dma_page);
+ free_page(p->tx_dma_page);
dma_release_channel(master->dma_rx);
dma_release_channel(master->dma_tx);
}
diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index 90c2801..f3625bb 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -48,7 +48,7 @@ static void comedi_buf_map_kref_release(struct kref *kref)
buf->dma_addr);
#endif
} else {
- free_page((unsigned long)buf->virt_addr);
+ free_page(buf->virt_addr);
}
}
vfree(bm->page_list);
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 4a8c759..92259be 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -2286,5 +2286,5 @@ void ll_dirty_page_discard_warn(struct page *page, int ioret)
dput(dentry);
if (buf != NULL)
- free_page((unsigned long)buf);
+ free_page(buf);
}
diff --git a/drivers/staging/rdma/ehca/ehca_iverbs.h b/drivers/staging/rdma/ehca/ehca_iverbs.h
index 80e6a3d..f493ac4 100644
--- a/drivers/staging/rdma/ehca/ehca_iverbs.h
+++ b/drivers/staging/rdma/ehca/ehca_iverbs.h
@@ -210,7 +210,7 @@ void *ehca_alloc_fw_ctrlblock(gfp_t flags);
void ehca_free_fw_ctrlblock(void *ptr);
#else
#define ehca_alloc_fw_ctrlblock(flags) ((void *)get_zeroed_page(flags))
-#define ehca_free_fw_ctrlblock(ptr) free_page((unsigned long)(ptr))
+#define ehca_free_fw_ctrlblock(ptr) free_page(ptr)
#endif
void ehca_recover_sqp(struct ib_qp *sqp);
diff --git a/drivers/staging/rdma/ehca/ehca_pd.c b/drivers/staging/rdma/ehca/ehca_pd.c
index 351577a..c3424f4 100644
--- a/drivers/staging/rdma/ehca/ehca_pd.c
+++ b/drivers/staging/rdma/ehca/ehca_pd.c
@@ -92,7 +92,7 @@ int ehca_dealloc_pd(struct ib_pd *pd)
list_splice(&my_pd->full[i], &my_pd->free[i]);
list_for_each_entry_safe(page, tmp, &my_pd->free[i], list) {
leftovers = 1;
- free_page(page->page);
+ free_page((void *)page->page);
kmem_cache_free(small_qp_cache, page);
}
}
diff --git a/drivers/staging/rdma/ehca/ipz_pt_fn.c b/drivers/staging/rdma/ehca/ipz_pt_fn.c
index 7ffc748..0742740 100644
--- a/drivers/staging/rdma/ehca/ipz_pt_fn.c
+++ b/drivers/staging/rdma/ehca/ipz_pt_fn.c
@@ -120,7 +120,7 @@ static int alloc_queue_pages(struct ipz_queue *queue, const u32 nr_of_pages)
out:
for (f = 0; f < nr_of_pages && queue->queue_pages[f];
f += PAGES_PER_KPAGE)
- free_page((unsigned long)(queue->queue_pages)[f]);
+ free_page(queue->queue_pages[f]);
return 0;
}
@@ -196,7 +196,7 @@ static void free_small_queue_page(struct ipz_queue *queue, struct ehca_pd *pd)
mutex_unlock(&pd->lock);
if (free_page) {
- free_page(page->page);
+ free_page((void *)page->page);
kmem_cache_free(small_qp_cache, page);
}
}
@@ -264,7 +264,7 @@ int ipz_queue_dtor(struct ehca_pd *pd, struct ipz_queue *queue)
else {
nr_pages = queue->queue_length / queue->pagesize;
for (i = 0; i < nr_pages; i += PAGES_PER_KPAGE)
- free_page((unsigned long)queue->queue_pages[i]);
+ free_page(queue->queue_pages[i]);
}
kvfree(queue->queue_pages);
diff --git a/drivers/staging/rdma/hfi1/qp.c b/drivers/staging/rdma/hfi1/qp.c
index f8c3616..6310b3c 100644
--- a/drivers/staging/rdma/hfi1/qp.c
+++ b/drivers/staging/rdma/hfi1/qp.c
@@ -128,7 +128,7 @@ static void get_map_page(struct hfi1_qpn_table *qpt, struct qpn_map *map)
spin_lock(&qpt->lock);
if (map->page)
- free_page(page);
+ free_page((void *)page);
else
map->page = (void *)page;
spin_unlock(&qpt->lock);
@@ -1341,7 +1341,7 @@ static void free_qpn_table(struct hfi1_qpn_table *qpt)
int i;
for (i = 0; i < ARRAY_SIZE(qpt->map); i++)
- free_page((unsigned long) qpt->map[i].page);
+ free_page(qpt->map[i].page);
}
/**
diff --git a/drivers/staging/rdma/ipath/ipath_qp.c b/drivers/staging/rdma/ipath/ipath_qp.c
index 280cd2d..8ca0b76 100644
--- a/drivers/staging/rdma/ipath/ipath_qp.c
+++ b/drivers/staging/rdma/ipath/ipath_qp.c
@@ -94,7 +94,7 @@ static void get_map_page(struct ipath_qp_table *qpt, struct qpn_map *map)
spin_lock_irqsave(&qpt->lock, flags);
if (map->page)
- free_page(page);
+ free_page((void *)page);
else
map->page = (void *)page;
spin_unlock_irqrestore(&qpt->lock, flags);
@@ -285,7 +285,7 @@ unsigned ipath_free_all_qps(struct ipath_qp_table *qpt)
for (n = 0; n < ARRAY_SIZE(qpt->map); n++)
if (qpt->map[n].page)
- free_page((unsigned long) qpt->map[n].page);
+ free_page(qpt->map[n].page);
return qp_inuse;
}
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c
index a4e117f..486bef0 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -301,7 +301,7 @@ visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
err = 0;
cleanup:
- free_page((unsigned long)buf);
+ free_page(buf);
return err;
}
EXPORT_SYMBOL_GPL(visorchannel_clear);
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index e319570..ca682ec 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -469,7 +469,7 @@ fd_do_prot_unmap(struct se_cmd *cmd, sector_t lba, sector_t nolb)
rc = fd_do_prot_fill(cmd->se_dev, lba, nolb, buf, PAGE_SIZE);
- free_page((unsigned long)buf);
+ free_page(buf);
return rc;
}
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index e53d9a5..d245a36 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -527,12 +527,12 @@ static int startup(struct tty_struct *tty, struct serial_state *info)
local_irq_save(flags);
if (port->flags & ASYNC_INITIALIZED) {
- free_page(page);
+ free_page((void *)page);
goto errout;
}
if (info->xmit.buf)
- free_page(page);
+ free_page((void *)page);
else
info->xmit.buf = (unsigned char *) page;
@@ -628,7 +628,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info)
free_irq(IRQ_AMIGA_VERTB, info);
if (info->xmit.buf) {
- free_page((unsigned long) info->xmit.buf);
+ free_page(info->xmit.buf);
info->xmit.buf = NULL;
}
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
index d4a1331..3310706 100644
--- a/drivers/tty/cyclades.c
+++ b/drivers/tty/cyclades.c
@@ -1288,7 +1288,7 @@ static int cy_startup(struct cyclades_port *info, struct tty_struct *tty)
}
if (info->port.xmit_buf)
- free_page(page);
+ free_page((void *)page);
else
info->port.xmit_buf = (unsigned char *)page;
@@ -1383,7 +1383,7 @@ static int cy_startup(struct cyclades_port *info, struct tty_struct *tty)
errout:
spin_unlock_irqrestore(&card->card_lock, flags);
- free_page(page);
+ free_page((void *)page);
return retval;
} /* startup */
@@ -1438,7 +1438,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty)
unsigned char *temp;
temp = info->port.xmit_buf;
info->port.xmit_buf = NULL;
- free_page((unsigned long)temp);
+ free_page(temp);
}
if (tty->termios.c_cflag & HUPCL)
cyy_change_rts_dtr(info, 0, TIOCM_RTS | TIOCM_DTR);
@@ -1466,7 +1466,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty)
unsigned char *temp;
temp = info->port.xmit_buf;
info->port.xmit_buf = NULL;
- free_page((unsigned long)temp);
+ free_page(temp);
}
if (tty->termios.c_cflag & HUPCL)
diff --git a/drivers/tty/hvc/hvc_iucv.c b/drivers/tty/hvc/hvc_iucv.c
index 8b70a16..e17db99 100644
--- a/drivers/tty/hvc/hvc_iucv.c
+++ b/drivers/tty/hvc/hvc_iucv.c
@@ -1158,7 +1158,7 @@ static int __init hvc_iucv_alloc(int id, unsigned int is_console)
out_error_dev:
hvc_remove(priv->hvc);
out_error_hvc:
- free_page((unsigned long) priv->sndbuf);
+ free_page(priv->sndbuf);
kfree(priv);
return rc;
@@ -1171,7 +1171,7 @@ static void __init hvc_iucv_destroy(struct hvc_iucv_private *priv)
{
hvc_remove(priv->hvc);
device_unregister(priv->dev);
- free_page((unsigned long) priv->sndbuf);
+ free_page(priv->sndbuf);
kfree(priv);
}
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index fa816b7..4f7716d 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -341,7 +341,7 @@ static void xencons_disconnect_backend(struct xencons_info *info)
static void xencons_free(struct xencons_info *info)
{
- free_page((unsigned long)info->intf);
+ free_page(info->intf);
info->intf = NULL;
info->vtermno = 0;
kfree(info);
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
index 5997b17..fb3f4cd 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -1548,7 +1548,7 @@ static int hvcs_initialize(void)
return 0;
kthread_fail:
- free_page((unsigned long)hvcs_pi_buff);
+ free_page(hvcs_pi_buff);
buff_alloc_fail:
tty_unregister_driver(hvcs_tty_driver);
register_fail:
@@ -1597,7 +1597,7 @@ static void __exit hvcs_module_exit(void)
kthread_stop(hvcs_task);
spin_lock(&hvcs_pi_lock);
- free_page((unsigned long)hvcs_pi_buff);
+ free_page(hvcs_pi_buff);
hvcs_pi_buff = NULL;
spin_unlock(&hvcs_pi_lock);
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 4c4a236..b730857 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -873,7 +873,7 @@ static int mxser_activate(struct tty_port *port, struct tty_struct *tty)
if (!info->ioaddr || !info->type) {
set_bit(TTY_IO_ERROR, &tty->flags);
- free_page(page);
+ free_page((void *)page);
spin_unlock_irqrestore(&info->slock, flags);
return 0;
}
@@ -969,7 +969,7 @@ static void mxser_shutdown_port(struct tty_port *port)
* Free the xmit buffer, if necessary
*/
if (info->port.xmit_buf) {
- free_page((unsigned long) info->port.xmit_buf);
+ free_page(info->port.xmit_buf);
info->port.xmit_buf = NULL;
}
diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
index 802eac7..2ed96e3 100644
--- a/drivers/tty/rocket.c
+++ b/drivers/tty/rocket.c
@@ -899,7 +899,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
* We must not sleep from here until the port is marked fully in use.
*/
if (info->xmit_buf)
- free_page(page);
+ free_page((void *)page);
else
info->xmit_buf = (unsigned char *) page;
@@ -1038,7 +1038,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
wake_up_interruptible(&port->open_wait);
} else {
if (info->xmit_buf) {
- free_page((unsigned long) info->xmit_buf);
+ free_page(info->xmit_buf);
info->xmit_buf = NULL;
}
}
diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index 0140ba4..4485466 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -436,7 +436,7 @@ static void shutdown(struct m68k_serial *info, struct tty_struct *tty)
local_irq_save(flags);
if (info->xmit_buf) {
- free_page((unsigned long) info->xmit_buf);
+ free_page(info->xmit_buf);
info->xmit_buf = 0;
}
diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
index f13f2eb..8e792c1 100644
--- a/drivers/tty/serial/crisv10.c
+++ b/drivers/tty/serial/crisv10.c
@@ -2603,12 +2603,12 @@ startup(struct e100_serial * info)
if (info->port.flags & ASYNC_INITIALIZED) {
local_irq_restore(flags);
- free_page(xmit_page);
+ free_page((void *)xmit_page);
return 0;
}
if (info->xmit.buf)
- free_page(xmit_page);
+ free_page((void *)xmit_page);
else
info->xmit.buf = (unsigned char *) xmit_page;
@@ -2758,7 +2758,7 @@ shutdown(struct e100_serial * info)
local_irq_save(flags);
if (info->xmit.buf) {
- free_page((unsigned long)info->xmit.buf);
+ free_page(info->xmit.buf);
info->xmit.buf = NULL;
}
diff --git a/drivers/tty/serial/men_z135_uart.c b/drivers/tty/serial/men_z135_uart.c
index 3141aa2..df3c6ad 100644
--- a/drivers/tty/serial/men_z135_uart.c
+++ b/drivers/tty/serial/men_z135_uart.c
@@ -855,7 +855,7 @@ static int men_z135_probe(struct mcb_device *mdev,
return 0;
err:
- free_page((unsigned long) uart->rxbuf);
+ free_page(uart->rxbuf);
dev_err(dev, "Failed to add UART: %d\n", err);
return err;
@@ -872,7 +872,7 @@ static void men_z135_remove(struct mcb_device *mdev)
line--;
uart_remove_one_port(&men_z135_driver, &uart->port);
- free_page((unsigned long) uart->rxbuf);
+ free_page(uart->rxbuf);
}
static const struct mcb_device_id men_z135_ids[] = {
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index ea4ffc2..7e461e0 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1845,7 +1845,7 @@ init_port_hal_free:
#ifdef CONFIG_SERIAL_PCH_UART_CONSOLE
pch_uart_ports[board->line_no] = NULL;
#endif
- free_page((unsigned long)rxbuf);
+ free_page(rxbuf);
init_port_free_txbuf:
kfree(priv);
init_port_alloc_err:
@@ -1861,7 +1861,7 @@ static void pch_uart_exit_port(struct eg20t_port *priv)
debugfs_remove(priv->debugfs);
#endif
uart_remove_one_port(&pch_uart_driver, &priv->port);
- free_page((unsigned long)priv->rxbuf.buf);
+ free_page(priv->rxbuf.buf);
}
static void pch_uart_pci_remove(struct pci_dev *pdev)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index def5199..9bc0284 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -257,7 +257,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
* Free the transmit buffer page.
*/
if (state->xmit.buf) {
- free_page((unsigned long)state->xmit.buf);
+ free_page(state->xmit.buf);
state->xmit.buf = NULL;
}
}
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index 6188059..6e52c8f 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
@@ -1824,7 +1824,7 @@ static void shutdown(struct mgsl_struct * info)
del_timer_sync(&info->tx_timer);
if (info->xmit_buf) {
- free_page((unsigned long) info->xmit_buf);
+ free_page(info->xmit_buf);
info->xmit_buf = NULL;
}
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 482f33f..3fe48c7 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -113,7 +113,7 @@ void tty_port_free_xmit_buf(struct tty_port *port)
{
mutex_lock(&port->buf_mutex);
if (port->xmit_buf != NULL) {
- free_page((unsigned long)port->xmit_buf);
+ free_page(port->xmit_buf);
port->xmit_buf = NULL;
}
mutex_unlock(&port->buf_mutex);
@@ -143,7 +143,7 @@ static void tty_port_destructor(struct kref *kref)
if (WARN_ON(port->itty))
return;
if (port->xmit_buf)
- free_page((unsigned long)port->xmit_buf);
+ free_page(port->xmit_buf);
tty_port_destroy(port);
if (port->ops && port->ops->destruct)
port->ops->destruct(port);
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index 14a2b5f..5d25934 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -366,7 +366,7 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
ret = read;
unlock_out:
console_unlock();
- free_page((unsigned long) con_buf);
+ free_page(con_buf);
return ret;
}
@@ -554,7 +554,7 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
unlock_out:
console_unlock();
- free_page((unsigned long) con_buf);
+ free_page(con_buf);
return ret;
}
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 1173f9c..f03bc30 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -978,7 +978,7 @@ static int cxacru_fw(struct usb_device *usb_dev, enum cxacru_fw_request fw,
ret = 0;
cleanup:
- free_page((unsigned long) buf);
+ free_page(buf);
return ret;
}
@@ -1217,8 +1217,8 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance,
return 0;
fail:
- free_page((unsigned long) instance->snd_buf);
- free_page((unsigned long) instance->rcv_buf);
+ free_page(instance->snd_buf);
+ free_page(instance->rcv_buf);
usb_free_urb(instance->snd_urb);
usb_free_urb(instance->rcv_urb);
kfree(instance);
@@ -1259,8 +1259,8 @@ static void cxacru_unbind(struct usbatm_data *usbatm_instance,
usb_free_urb(instance->snd_urb);
usb_free_urb(instance->rcv_urb);
- free_page((unsigned long) instance->snd_buf);
- free_page((unsigned long) instance->rcv_buf);
+ free_page(instance->snd_buf);
+ free_page(instance->rcv_buf);
kfree(instance);
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c
index 0270d13..681599f 100644
--- a/drivers/usb/atm/speedtch.c
+++ b/drivers/usb/atm/speedtch.c
@@ -354,7 +354,7 @@ static int speedtch_upload_firmware(struct speedtch_instance_data *instance,
ret = 0;
out_free:
- free_page((unsigned long)buffer);
+ free_page(buffer);
out:
return ret;
}
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 38ae877c..c2cef46 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1047,7 +1047,7 @@ static int proc_control(struct usb_dev_state *ps, void __user *arg)
}
ret = i;
done:
- free_page((unsigned long) tbuf);
+ free_page(tbuf);
usbfs_decrease_memory_usage(PAGE_SIZE + sizeof(struct urb) +
sizeof(struct usb_ctrlrequest));
return ret;
diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
index c3eded3..1e8397f 100644
--- a/drivers/usb/host/ohci-dbg.c
+++ b/drivers/usb/host/ohci-dbg.c
@@ -730,7 +730,7 @@ static int debug_close(struct inode *inode, struct file *file)
if (buf) {
if (buf->page)
- free_page((unsigned long)buf->page);
+ free_page(buf->page);
kfree(buf);
}
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c
index 13731d5..3c49061 100644
--- a/drivers/usb/misc/rio500.c
+++ b/drivers/usb/misc/rio500.c
@@ -146,7 +146,7 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg)
}
if (copy_from_user(buffer, rio_cmd.buffer, rio_cmd.length)) {
retval = -EFAULT;
- free_page((unsigned long) buffer);
+ free_page(buffer);
goto err_out;
}
@@ -180,7 +180,7 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg)
result, buffer[0]);
if (copy_to_user(rio_cmd.buffer, buffer,
rio_cmd.length)) {
- free_page((unsigned long) buffer);
+ free_page(buffer);
retval = -EFAULT;
goto err_out;
}
@@ -195,7 +195,7 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg)
be swapped at the app level */
}
- free_page((unsigned long) buffer);
+ free_page(buffer);
break;
case RIO_SEND_COMMAND:
@@ -216,7 +216,7 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg)
goto err_out;
}
if (copy_from_user(buffer, rio_cmd.buffer, rio_cmd.length)) {
- free_page((unsigned long)buffer);
+ free_page(buffer);
retval = -EFAULT;
goto err_out;
}
@@ -253,7 +253,7 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg)
}
}
- free_page((unsigned long) buffer);
+ free_page(buffer);
break;
default:
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index 3598f1a..bd463eb 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -1311,7 +1311,7 @@ static int mon_alloc_buff(struct mon_pgmap *map, int npages)
vaddr = get_zeroed_page(GFP_KERNEL);
if (vaddr == 0) {
while (n-- != 0)
- free_page((unsigned long) map[n].ptr);
+ free_page(map[n].ptr);
return -ENOMEM;
}
map[n].ptr = (unsigned char *) vaddr;
@@ -1325,7 +1325,7 @@ static void mon_free_buff(struct mon_pgmap *map, int npages)
int n;
for (n = 0; n < npages; n++)
- free_page((unsigned long) map[n].ptr);
+ free_page(map[n].ptr);
}
int mon_bin_add(struct mon_bus *mbus, const struct usb_bus *ubus)
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index be9cb61..de9ff1b 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -562,7 +562,7 @@ bail_out_error2:
bail_out_error:
for (i = 0; i < N_IN_URB; i++) {
usb_free_urb(portdata->in_urbs[i]);
- free_page((unsigned long)portdata->in_buffer[i]);
+ free_page(portdata->in_buffer[i]);
}
kfree(portdata);
@@ -580,7 +580,7 @@ int usb_wwan_port_remove(struct usb_serial_port *port)
for (i = 0; i < N_IN_URB; i++) {
usb_free_urb(portdata->in_urbs[i]);
- free_page((unsigned long)portdata->in_buffer[i]);
+ free_page(portdata->in_buffer[i]);
}
for (i = 0; i < N_OUT_URB; i++) {
usb_free_urb(portdata->out_urbs[i]);
diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
index 0257f35..2d3334f 100644
--- a/drivers/uwb/hwa-rc.c
+++ b/drivers/uwb/hwa-rc.c
@@ -720,7 +720,7 @@ error_neep_submit:
usb_free_urb(hwarc->neep_urb);
hwarc->neep_urb = NULL;
error_urb_alloc:
- free_page((unsigned long)hwarc->rd_buffer);
+ free_page(hwarc->rd_buffer);
hwarc->rd_buffer = NULL;
error_rd_buffer:
return -ENOMEM;
@@ -736,7 +736,7 @@ static void hwarc_neep_release(struct uwb_rc *rc)
usb_free_urb(hwarc->neep_urb);
hwarc->neep_urb = NULL;
- free_page((unsigned long)hwarc->rd_buffer);
+ free_page(hwarc->rd_buffer);
hwarc->rd_buffer = NULL;
}
diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c
index 0567d51..b126f77 100644
--- a/drivers/video/fbdev/xen-fbfront.c
+++ b/drivers/video/fbdev/xen-fbfront.c
@@ -529,7 +529,7 @@ static int xenfb_remove(struct xenbus_device *dev)
fb_dealloc_cmap(&info->fb_info->cmap);
framebuffer_release(info->fb_info);
}
- free_page((unsigned long)info->page);
+ free_page(info->page);
vfree(info->gfns);
vfree(info->fb);
kfree(info);
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 524c221..0fe5889 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1693,7 +1693,7 @@ void __init xen_init_IRQ(void)
rc = HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn_v2, &eoi_gmfn);
/* TODO: No PVH support for PIRQ EOI */
if (rc != 0) {
- free_page((unsigned long) pirq_eoi_map);
+ free_page(pirq_eoi_map);
pirq_eoi_map = NULL;
} else
pirq_needs_eoi = pirq_check_eoi_map;
diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c
index e3e9e3d..722c2a0 100644
--- a/drivers/xen/events/events_fifo.c
+++ b/drivers/xen/events/events_fifo.c
@@ -125,7 +125,7 @@ static void free_unused_array_pages(void)
for (i = event_array_pages; i < MAX_EVENT_ARRAY_PAGES; i++) {
if (!event_array[i])
break;
- free_page((unsigned long)event_array[i]);
+ free_page(event_array[i]);
event_array[i] = NULL;
}
}
@@ -353,7 +353,7 @@ static void evtchn_fifo_resume(void)
* used.
*/
if (!cpu_online(cpu)) {
- free_page((unsigned long)control_block);
+ free_page(control_block);
per_cpu(cpu_control_block, cpu) = NULL;
continue;
}
@@ -404,7 +404,7 @@ static int evtchn_fifo_alloc_control_block(unsigned cpu)
return 0;
error:
- free_page((unsigned long)control_block);
+ free_page(control_block);
return ret;
}
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
index 38272ad..bcd5f54 100644
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
@@ -308,7 +308,7 @@ static ssize_t evtchn_write(struct file *file, const char __user *buf,
rc = count;
out:
- free_page((unsigned long)kbuf);
+ free_page(kbuf);
return rc;
}
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index c49f79ed..1189c13 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -384,7 +384,7 @@ void gnttab_end_foreign_access(grant_ref_t ref, int readonly,
if (gnttab_end_foreign_access_ref(ref, readonly)) {
put_free_entry(ref);
if (page != 0)
- free_page(page);
+ free_page((void *)page);
} else
gnttab_add_deferred(ref, readonly,
page ? virt_to_page(page) : NULL);
@@ -599,7 +599,7 @@ static int grow_gnttab_list(unsigned int more_frames)
grow_nomem:
while (i-- > nr_glist_frames)
- free_page((unsigned long) gnttab_list[i]);
+ free_page(gnttab_list[i]);
return -ENOMEM;
}
@@ -1139,7 +1139,7 @@ int gnttab_init(void)
ini_nomem:
for (i--; i >= 0; i--)
- free_page((unsigned long)gnttab_list[i]);
+ free_page(gnttab_list[i]);
kfree(gnttab_list);
return ret;
}
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 33a31cf..43eae6a 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -730,7 +730,7 @@ static int __init xenstored_local_init(void)
out_err:
if (page != 0)
- free_page(page);
+ free_page((void *)page);
return err;
}
diff --git a/fs/affs/inode.c b/fs/affs/inode.c
index 1734950..dcfa753 100644
--- a/fs/affs/inode.c
+++ b/fs/affs/inode.c
@@ -274,7 +274,7 @@ affs_evict_inode(struct inode *inode)
pr_debug("freeing ext cache\n");
AFFS_I(inode)->i_lc = NULL;
AFFS_I(inode)->i_ac = NULL;
- free_page(cache_page);
+ free_page((void *)cache_page);
}
affs_brelse(AFFS_I(inode)->i_ext_bh);
AFFS_I(inode)->i_ext_last = ~1;
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c
index ccd0b21..f077aee 100644
--- a/fs/afs/mntpt.c
+++ b/fs/afs/mntpt.c
@@ -205,17 +205,17 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
mnt = vfs_kern_mount(&afs_fs_type, 0, devname, options);
_debug("--- mount result %p ---", mnt);
- free_page((unsigned long) devname);
- free_page((unsigned long) options);
+ free_page(devname);
+ free_page(options);
_leave(" = %p", mnt);
return mnt;
error:
page_cache_release(page);
error_no_page:
- free_page((unsigned long) options);
+ free_page(options);
error_no_options:
- free_page((unsigned long) devname);
+ free_page(devname);
error_no_devname:
_leave(" = %d", ret);
return ERR_PTR(ret);
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
index fdcb4d6..590b7bb 100644
--- a/fs/bfs/inode.c
+++ b/fs/bfs/inode.c
@@ -313,7 +313,7 @@ void bfs_dump_imap(const char *prefix, struct super_block *s)
}
printf("BFS-fs: %s: lasti=%08lx <%s>\n",
prefix, BFS_SB(s)->si_lasti, tmpbuf);
- free_page((unsigned long)tmpbuf);
+ free_page(tmpbuf);
#endif
}
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 78f005f..a7ab050 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -615,7 +615,7 @@ bm_entry_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
res = simple_read_from_buffer(buf, nbytes, ppos, page, strlen(page));
- free_page((unsigned long) page);
+ free_page(page);
return res;
}
diff --git a/fs/compat.c b/fs/compat.c
index 6fd272d..c4708ae 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -825,7 +825,7 @@ COMPAT_SYSCALL_DEFINE5(mount, const char __user *, dev_name,
flags, (void*)data_page);
out3:
- free_page(data_page);
+ free_page((void *)data_page);
out2:
kfree(kernel_dev);
out1:
diff --git a/fs/configfs/file.c b/fs/configfs/file.c
index d39099e..c4a3c5c 100644
--- a/fs/configfs/file.c
+++ b/fs/configfs/file.c
@@ -296,7 +296,7 @@ static int configfs_release(struct inode * inode, struct file * filp)
if (buffer) {
if (buffer->page)
- free_page((unsigned long)buffer->page);
+ free_page(buffer->page);
mutex_destroy(&buffer->mutex);
kfree(buffer);
}
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c
index ec5c832..a04bf59 100644
--- a/fs/configfs/symlink.c
+++ b/fs/configfs/symlink.c
@@ -292,7 +292,7 @@ static const char *configfs_follow_link(struct dentry *dentry, void **cookie)
return *cookie = (void *)page;
}
- free_page(page);
+ free_page((void *)page);
return ERR_PTR(error);
}
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c9ab67d..f785c13 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3064,7 +3064,7 @@ int ext4_calculate_overhead(struct super_block *sb)
sbi->s_overhead = overhead;
smp_wmb();
- free_page((unsigned long) buf);
+ free_page(buf);
return 0;
}
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 5e2e087..37b4ae3 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1385,7 +1385,7 @@ static const char *fuse_follow_link(struct dentry *dentry, void **cookie)
args.out.args[0].value = link;
ret = fuse_simple_request(fc, &args);
if (ret < 0) {
- free_page((unsigned long) link);
+ free_page(link);
link = ERR_PTR(ret);
} else {
link[ret] = '\0';
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 570ca40..a07709b 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2599,7 +2599,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg,
out:
if (req)
fuse_put_request(fc, req);
- free_page((unsigned long) iov_page);
+ free_page(iov_page);
while (num_pages)
__free_page(pages[--num_pages]);
kfree(pages);
diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c
index b943cbd..2d495b5 100644
--- a/fs/isofs/dir.c
+++ b/fs/isofs/dir.c
@@ -261,7 +261,7 @@ static int isofs_readdir(struct file *file, struct dir_context *ctx)
result = do_isofs_readdir(inode, file, ctx, tmpname, tmpde);
- free_page((unsigned long) tmpname);
+ free_page(tmpname);
return result;
}
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index d88576e..e585852 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -3324,13 +3324,13 @@ skip_one:
DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
if (rc) {
- free_page(dirent_buf);
+ free_page((void *)dirent_buf);
return rc;
}
}
out:
- free_page(dirent_buf);
+ free_page((void *)dirent_buf);
return rc;
}
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index a69bdf2..f635c17 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -1845,7 +1845,7 @@ static int lbmLogInit(struct jfs_log * log)
lbuf = kmalloc(sizeof(struct lbuf), GFP_KERNEL);
if (lbuf == NULL) {
if (offset == 0)
- free_page((unsigned long) buffer);
+ free_page(buffer);
goto error;
}
if (offset) /* we already have one reference */
diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c
index db27252..e98d520 100644
--- a/fs/kernfs/symlink.c
+++ b/fs/kernfs/symlink.c
@@ -120,7 +120,7 @@ static const char *kernfs_iop_follow_link(struct dentry *dentry, void **cookie)
return ERR_PTR(-ENOMEM);
error = kernfs_getlink(dentry, (char *)page);
if (unlikely(error < 0)) {
- free_page((unsigned long)page);
+ free_page((void *)page);
return ERR_PTR(error);
}
return *cookie = (char *)page;
diff --git a/fs/libfs.c b/fs/libfs.c
index c7cbfb0..1a790b9 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -709,7 +709,7 @@ char *simple_transaction_get(struct file *file, const char __user *buf, size_t s
/* only one write allowed per open */
if (file->private_data) {
spin_unlock(&simple_transaction_lock);
- free_page((unsigned long)ar);
+ free_page(ar);
return ERR_PTR(-EBUSY);
}
@@ -736,7 +736,7 @@ EXPORT_SYMBOL(simple_transaction_read);
int simple_transaction_release(struct inode *inode, struct file *file)
{
- free_page((unsigned long)file->private_data);
+ free_page(file->private_data);
return 0;
}
EXPORT_SYMBOL(simple_transaction_release);
@@ -1027,7 +1027,7 @@ EXPORT_SYMBOL(kfree_put_link);
void free_page_put_link(struct inode *unused, void *cookie)
{
- free_page((unsigned long) cookie);
+ free_page(cookie);
}
EXPORT_SYMBOL(free_page_put_link);
diff --git a/fs/namespace.c b/fs/namespace.c
index 0570729..55df421 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2625,7 +2625,7 @@ int copy_mount_options(const void __user * data, unsigned long *where)
i = size - exact_copy_from_user((void *)page, data, size);
if (!i) {
- free_page(page);
+ free_page((void *)page);
return -EFAULT;
}
if (i != PAGE_SIZE)
@@ -2915,7 +2915,7 @@ SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
ret = do_mount(kernel_dev, dir_name, kernel_type, flags,
(void *) data_page);
- free_page(data_page);
+ free_page((void *)data_page);
out_data:
kfree(kernel_dev);
out_dev:
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index c8162c6..faa1ce5 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -263,7 +263,7 @@ struct vfsmount *nfs_do_submount(struct dentry *dentry, struct nfs_fh *fh,
goto free_page;
mnt = nfs_do_clone_mount(NFS_SB(dentry->d_sb), devname, &mountdata);
free_page:
- free_page((unsigned long)page);
+ free_page(page);
out:
dprintk("%s: done\n", __func__);
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index f592672..82b1537 100644
--- a/fs/nfs/nfs4namespace.c
+++ b/fs/nfs/nfs4namespace.c
@@ -338,8 +338,8 @@ static struct vfsmount *nfs_follow_referral(struct dentry *dentry,
}
out:
- free_page((unsigned long) page);
- free_page((unsigned long) page2);
+ free_page(page);
+ free_page(page2);
dprintk("%s: done\n", __func__);
return mnt;
}
@@ -517,7 +517,7 @@ int nfs4_replace_transport(struct nfs_server *server,
}
out:
- free_page((unsigned long)page);
- free_page((unsigned long)page2);
+ free_page(page);
+ free_page(page2);
return error;
}
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index f126828..ba0ad91 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -789,7 +789,7 @@ int nfs_show_devname(struct seq_file *m, struct dentry *root)
err = PTR_ERR(devname);
else
seq_escape(m, devname, " \t\n\\");
- free_page((unsigned long)page);
+ free_page(page);
return err;
}
EXPORT_SYMBOL_GPL(nfs_show_devname);
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 994d66f..e9df47b 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1860,7 +1860,7 @@ static __be32 nfsd_buffered_readdir(struct file *file, nfsd_filldir_t func,
offset = vfs_llseek(file, 0, SEEK_CUR);
}
- free_page((unsigned long)(buf.dirent));
+ free_page(buf.dirent);
if (host_err)
return nfserrno(host_err);
diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
index 8251360..f172c20 100644
--- a/fs/ocfs2/dlm/dlmdebug.c
+++ b/fs/ocfs2/dlm/dlmdebug.c
@@ -332,7 +332,7 @@ void dlm_print_one_mle(struct dlm_master_list_entry *mle)
buf = (char *) get_zeroed_page(GFP_NOFS);
if (buf) {
dump_mle(mle, buf, PAGE_SIZE - 1);
- free_page((unsigned long)buf);
+ free_page(buf);
}
}
@@ -369,7 +369,7 @@ static void dlm_debug_get(struct dlm_debug_ctxt *dc)
static int debug_release(struct inode *inode, struct file *file)
{
- free_page((unsigned long)file->private_data);
+ free_page(file->private_data);
return 0;
}
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
index 2ee7fe7..841d822 100644
--- a/fs/ocfs2/dlm/dlmdomain.c
+++ b/fs/ocfs2/dlm/dlmdomain.c
@@ -79,7 +79,7 @@ static inline void byte_copymap(u8 dmap[], unsigned long smap[],
static void dlm_free_pagevec(void **vec, int pages)
{
while (pages--)
- free_page((unsigned long)vec[pages]);
+ free_page(vec[pages]);
kfree(vec);
}
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index ce38b4c..a0edd7e 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -2679,7 +2679,7 @@ leave:
wake_up(&res->wq);
if (mres)
- free_page((unsigned long)mres);
+ free_page(mres);
dlm_put(dlm);
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index 9e4f862..7368158 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -952,7 +952,7 @@ static void dlm_request_all_locks_worker(struct dlm_work_item *item, void *data)
}
}
leave:
- free_page((unsigned long)data);
+ free_page(data);
}
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 0a89834..b3f1da5 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -145,7 +145,7 @@ static char *ovl_read_symlink(struct dentry *realdentry)
(char __user *)buf, PAGE_SIZE - 1);
set_fs(old_fs);
if (res < 0) {
- free_page((unsigned long) buf);
+ free_page(buf);
goto err;
}
buf[res] = '\0';
@@ -359,7 +359,7 @@ out_unlock:
out_free_link:
if (link)
- free_page((unsigned long) link);
+ free_page(link);
return err;
}
diff --git a/fs/proc/base.c b/fs/proc/base.c
index bd3e9e6..a9828e5 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -387,7 +387,7 @@ skip_argv_envp:
}
out_free_page:
- free_page((unsigned long)page);
+ free_page(page);
out_mmput:
mmput(mm);
if (rv > 0)
@@ -892,7 +892,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
mmput(mm);
free:
- free_page((unsigned long) page);
+ free_page(page);
return copied;
}
@@ -997,7 +997,7 @@ static ssize_t environ_read(struct file *file, char __user *buf,
mmput(mm);
free:
- free_page((unsigned long) page);
+ free_page(page);
return ret;
}
@@ -1604,7 +1604,7 @@ static int do_proc_readlink(struct path *path, char __user *buffer, int buflen)
if (copy_to_user(buffer, pathname, len))
len = -EFAULT;
out:
- free_page((unsigned long)tmp);
+ free_page(tmp);
return len;
}
@@ -2393,7 +2393,7 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
(void*)page, count);
mutex_unlock(&task->signal->cred_guard_mutex);
out_free:
- free_page((unsigned long) page);
+ free_page(page);
out:
put_task_struct(task);
out_no_task:
diff --git a/fs/select.c b/fs/select.c
index 0155473..6acb0ae 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -150,7 +150,7 @@ void poll_freewait(struct poll_wqueues *pwq)
} while (entry > p->entries);
old = p;
p = p->next;
- free_page((unsigned long) old);
+ free_page(old);
}
}
EXPORT_SYMBOL(poll_freewait);
diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h
index 37d1fe2..6c731ec 100644
--- a/include/asm-generic/page.h
+++ b/include/asm-generic/page.h
@@ -25,7 +25,7 @@
#ifndef __ASSEMBLY__
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
-#define free_user_page(page, addr) free_page(addr)
+#define free_user_page(page, addr) free_page((void *)addr)
#define clear_page(page) memset((page), 0, PAGE_SIZE)
#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 8942af0..54c6efd 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -500,7 +500,7 @@ extern void __free_kmem_pages(struct page *page, unsigned int order);
extern void free_kmem_pages(unsigned long addr, unsigned int order);
#define __free_page(page) __free_pages((page), 0)
-#define free_page(addr) free_pages((addr), 0)
+#define free_page(addr) free_pages((unsigned long)(addr), 0)
void page_alloc_init(void);
void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
diff --git a/include/linux/security.h b/include/linux/security.h
index 2f4c1f7..c1ad479 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1623,7 +1623,7 @@ static inline char *alloc_secdata(void)
static inline void free_secdata(void *secdata)
{
- free_page((unsigned long)secdata);
+ free_page(secdata);
}
#else
diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index adfdc05..825c4724 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -650,9 +650,9 @@ struct ring_buffer *rb_alloc(int nr_pages, long watermark, int cpu, int flags)
fail_data_pages:
for (i--; i >= 0; i--)
- free_page((unsigned long)rb->data_pages[i]);
+ free_page(rb->data_pages[i]);
- free_page((unsigned long)rb->user_page);
+ free_page(rb->user_page);
fail_user_page:
kfree(rb);
diff --git a/kernel/groups.c b/kernel/groups.c
index 74d431d..88f7e1a8 100644
--- a/kernel/groups.c
+++ b/kernel/groups.c
@@ -40,7 +40,7 @@ struct group_info *groups_alloc(int gidsetsize)
out_undo_partial_alloc:
while (--i >= 0) {
- free_page((unsigned long)group_info->blocks[i]);
+ free_page(group_info->blocks[i]);
}
kfree(group_info);
return NULL;
@@ -53,7 +53,7 @@ void groups_free(struct group_info *group_info)
if (group_info->blocks[0] != group_info->small_block) {
int i;
for (i = 0; i < group_info->nblocks; i++)
- free_page((unsigned long)group_info->blocks[i]);
+ free_page(group_info->blocks[i]);
}
kfree(group_info);
}
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 12cd989..5bbe897 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -384,7 +384,7 @@ static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb)
static void release_swap_writer(struct swap_map_handle *handle)
{
if (handle->cur)
- free_page((unsigned long)handle->cur);
+ free_page(handle->cur);
handle->cur = NULL;
}
@@ -853,7 +853,7 @@ out_clean:
kthread_stop(data[thr].thr);
vfree(data);
}
- if (page) free_page((unsigned long)page);
+ if (page) free_page(page);
return ret;
}
@@ -938,7 +938,7 @@ static void release_swap_reader(struct swap_map_handle *handle)
while (handle->maps) {
if (handle->maps->map)
- free_page((unsigned long)handle->maps->map);
+ free_page(handle->maps->map);
tmp = handle->maps;
handle->maps = handle->maps->next;
kfree(tmp);
@@ -1010,7 +1010,7 @@ static int swap_read_page(struct swap_map_handle *handle, void *buf,
return error;
if (++handle->k >= MAP_PAGE_ENTRIES) {
handle->k = 0;
- free_page((unsigned long)handle->maps->map);
+ free_page(handle->maps->map);
tmp = handle->maps;
handle->maps = handle->maps->next;
kfree(tmp);
@@ -1440,7 +1440,7 @@ out_finish:
swsusp_show_speed(start, stop, nr_to_read, "Read");
out_clean:
for (i = 0; i < ring_size; i++)
- free_page((unsigned long)page[i]);
+ free_page(page[i]);
if (crc) {
if (crc->thr)
kthread_stop(crc->thr);
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index dc6858d..8e9cfe4 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2128,7 +2128,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
left -= proc_skip_spaces(&kbuf);
free:
if (write) {
- free_page(page);
+ free_page((void *)page);
if (first)
return err ? : -EINVAL;
}
@@ -2388,7 +2388,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
left -= proc_skip_spaces(&kbuf);
free:
if (write) {
- free_page(page);
+ free_page((void *)page);
if (first)
return err ? : -EINVAL;
}
@@ -2661,7 +2661,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
if (!kbuf)
return -ENOMEM;
if (copy_from_user(kbuf, buffer, left)) {
- free_page(page);
+ free_page((void *)page);
return -EFAULT;
}
kbuf[left] = 0;
@@ -2669,7 +2669,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
tmp_bitmap = kzalloc(BITS_TO_LONGS(bitmap_len) * sizeof(unsigned long),
GFP_KERNEL);
if (!tmp_bitmap) {
- free_page(page);
+ free_page((void *)page);
return -ENOMEM;
}
proc_skip_char(&kbuf, &left, '\n');
@@ -2713,7 +2713,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
first = 0;
proc_skip_char(&kbuf, &left, '\n');
}
- free_page(page);
+ free_page((void *)page);
} else {
unsigned long bit_a, bit_b = 0;
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 3f743b1..14703bb 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -744,7 +744,7 @@ int ftrace_profile_pages_init(struct ftrace_profile_stat *stat)
unsigned long tmp = (unsigned long)pg;
pg = pg->next;
- free_page(tmp);
+ free_page((void *)tmp);
}
stat->pages = NULL;
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 9c6045a..26aad80 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -341,7 +341,7 @@ size_t ring_buffer_page_len(void *page)
*/
static void free_buffer_page(struct buffer_page *bpage)
{
- free_page((unsigned long)bpage->page);
+ free_page(bpage->page);
kfree(bpage);
}
@@ -4437,7 +4437,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_alloc_read_page);
*/
void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data)
{
- free_page((unsigned long)data);
+ free_page(data);
}
EXPORT_SYMBOL_GPL(ring_buffer_free_read_page);
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 4f6ef69..f2e26df 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1345,7 +1345,7 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
return -ENOMEM;
if (copy_from_user(buf, ubuf, cnt)) {
- free_page((unsigned long) buf);
+ free_page(buf);
return -EFAULT;
}
buf[cnt] = '\0';
@@ -1356,7 +1356,7 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
err = apply_event_filter(file, buf);
mutex_unlock(&event_mutex);
- free_page((unsigned long) buf);
+ free_page(buf);
if (err < 0)
return err;
@@ -1512,13 +1512,13 @@ subsystem_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
return -ENOMEM;
if (copy_from_user(buf, ubuf, cnt)) {
- free_page((unsigned long) buf);
+ free_page(buf);
return -EFAULT;
}
buf[cnt] = '\0';
err = apply_subsystem_event_filter(dir, buf);
- free_page((unsigned long) buf);
+ free_page(buf);
if (err < 0)
return err;
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index f93a219..234b5b9e 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -684,7 +684,7 @@ static void append_filter_err(struct filter_parse_state *ps,
sprintf(pbuf, "\nparse_error: %s\n", err_text[ps->lasterr]);
append_filter_string(filter, buf);
- free_page((unsigned long) buf);
+ free_page(buf);
}
static inline struct event_filter *event_filter(struct trace_event_file *file)
diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
index 42a4009..0796e61 100644
--- a/kernel/trace/trace_events_trigger.c
+++ b/kernel/trace/trace_events_trigger.c
@@ -242,7 +242,7 @@ static ssize_t event_trigger_regex_write(struct file *file,
return -ENOMEM;
if (copy_from_user(buf, ubuf, cnt)) {
- free_page((unsigned long)buf);
+ free_page(buf);
return -EFAULT;
}
buf[cnt] = '\0';
@@ -252,13 +252,13 @@ static ssize_t event_trigger_regex_write(struct file *file,
event_file = event_file_data(file);
if (unlikely(!event_file)) {
mutex_unlock(&event_mutex);
- free_page((unsigned long)buf);
+ free_page(buf);
return -ENODEV;
}
ret = trigger_process_regex(event_file, buf);
mutex_unlock(&event_mutex);
- free_page((unsigned long)buf);
+ free_page(buf);
if (ret < 0)
goto out;
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index d2f6d0b..da18327 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -722,7 +722,7 @@ err:
for_each_possible_cpu(cpu) {
if (cpu == err_cpu)
break;
- free_page((unsigned long)per_cpu_ptr(uprobe_cpu_buffer, cpu)->buf);
+ free_page(per_cpu_ptr(uprobe_cpu_buffer, cpu)->buf);
}
free_percpu(uprobe_cpu_buffer);
@@ -752,8 +752,7 @@ static void uprobe_buffer_disable(void)
if (--uprobe_buffer_refcnt == 0) {
for_each_possible_cpu(cpu)
- free_page((unsigned long)per_cpu_ptr(uprobe_cpu_buffer,
- cpu)->buf);
+ free_page(per_cpu_ptr(uprobe_cpu_buffer, cpu)->buf);
free_percpu(uprobe_cpu_buffer);
uprobe_cpu_buffer = NULL;
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 88fefa6..b01948c 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -757,7 +757,7 @@ static ssize_t map_write(struct file *file, const char __user *buf,
out:
mutex_unlock(&userns_state_mutex);
if (page)
- free_page(page);
+ free_page((void *)page);
return ret;
}
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index bafa993..6f44c3e 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -184,7 +184,7 @@ static void sg_kfree(struct scatterlist *sg, unsigned int nents)
{
if (nents == SG_MAX_SINGLE_ALLOC) {
kmemleak_free(sg);
- free_page((unsigned long) sg);
+ free_page(sg);
} else
kfree(sg);
}
diff --git a/mm/memory.c b/mm/memory.c
index c387430..47f8f87 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -344,7 +344,7 @@ static void tlb_remove_table_rcu(struct rcu_head *head)
for (i = 0; i < batch->nr; i++)
__tlb_remove_table(batch->tables[i]);
- free_page((unsigned long)batch);
+ free_page(batch);
}
void tlb_table_flush(struct mmu_gather *tlb)
@@ -3772,7 +3772,7 @@ void print_vma_addr(char *prefix, unsigned long ip)
printk("%s%s[%lx+%lx]", prefix, kbasename(p),
vma->vm_start,
vma->vm_end - vma->vm_start);
- free_page((unsigned long)buf);
+ free_page(buf);
}
}
up_read(&mm->mmap_sem);
diff --git a/mm/migrate.c b/mm/migrate.c
index 7890d0b..7aeba9a 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1389,7 +1389,7 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes,
err = 0;
out_pm:
- free_page((unsigned long)pm);
+ free_page(pm);
out:
return err;
}
diff --git a/mm/mincore.c b/mm/mincore.c
index 14bb9fb..077ef0e 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -264,6 +264,6 @@ SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len,
start += retval << PAGE_SHIFT;
retval = 0;
}
- free_page((unsigned long) tmp);
+ free_page(tmp);
return retval;
}
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9d666df..e68689c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3458,7 +3458,7 @@ static void *make_alloc_exact(unsigned long addr, unsigned int order,
split_page(virt_to_page((void *)addr), order);
while (used < alloc_end) {
- free_page(used);
+ free_page((void *)used);
used += PAGE_SIZE;
}
}
@@ -3520,7 +3520,7 @@ void free_pages_exact(void *virt, size_t size)
unsigned long end = addr + PAGE_ALIGN(size);
while (addr < end) {
- free_page(addr);
+ free_page((void *)addr);
addr += PAGE_SIZE;
}
}
diff --git a/mm/quicklist.c b/mm/quicklist.c
index 9422129..d7d095c 100644
--- a/mm/quicklist.c
+++ b/mm/quicklist.c
@@ -79,7 +79,7 @@ void quicklist_trim(int nr, void (*dtor)(void *),
if (dtor)
dtor(p);
- free_page((unsigned long)p);
+ free_page(p);
pages_to_free--;
}
}
diff --git a/mm/slub.c b/mm/slub.c
index 4699751..b50b454 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5290,7 +5290,7 @@ static void memcg_propagate_slab_attrs(struct kmem_cache *s)
}
if (buffer)
- free_page((unsigned long)buffer);
+ free_page(buffer);
#endif
}
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c
index 2df34eb..a2721ae 100644
--- a/net/atm/mpoa_proc.c
+++ b/net/atm/mpoa_proc.c
@@ -221,7 +221,7 @@ static ssize_t proc_mpc_write(struct file *file, const char __user *buff,
for (p = page, len = 0; len < nbytes; p++, len++) {
if (get_user(*p, buff++)) {
- free_page((unsigned long)page);
+ free_page(page);
return -EFAULT;
}
if (*p == '\0' || *p == '\n')
@@ -233,7 +233,7 @@ static ssize_t proc_mpc_write(struct file *file, const char __user *buff,
if (!parse_qos(page))
printk("mpoa: proc_mpc_write: could not parse '%s'\n", page);
- free_page((unsigned long)page);
+ free_page(page);
return len;
}
diff --git a/net/atm/proc.c b/net/atm/proc.c
index bbb6461..2523c58 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -398,7 +398,7 @@ static ssize_t proc_dev_atm_read(struct file *file, char __user *buf,
length = -EFAULT;
(*pos)++;
}
- free_page(page);
+ free_page((void *)page);
return length;
}
diff --git a/net/core/dev.c b/net/core/dev.c
index ae00b89..7887d72 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1054,7 +1054,7 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
}
i = find_first_zero_bit(inuse, max_netdevices);
- free_page((unsigned long) inuse);
+ free_page(inuse);
}
if (buf != name)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 93cc473..6514ce1 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2438,7 +2438,7 @@ cont:
memset(inuse, 0, PAGE_SIZE);
goto cont;
}
- free_page((unsigned long)inuse);
+ free_page(inuse);
}
snprintf(set->name, sizeof(set->name), name, min + n);
diff --git a/net/rds/cong.c b/net/rds/cong.c
index e6144b8..15d4725 100644
--- a/net/rds/cong.c
+++ b/net/rds/cong.c
@@ -167,7 +167,7 @@ static struct rds_cong_map *rds_cong_from_addr(__be32 addr)
out:
if (map) {
for (i = 0; i < RDS_CONG_MAP_PAGES && map->m_page_addrs[i]; i++)
- free_page(map->m_page_addrs[i]);
+ free_page((void *)map->m_page_addrs[i]);
kfree(map);
}
@@ -399,7 +399,7 @@ void rds_cong_exit(void)
rdsdebug("freeing map %p\n", map);
rb_erase(&map->m_rb_node, &rds_cong_tree);
for (i = 0; i < RDS_CONG_MAP_PAGES && map->m_page_addrs[i]; i++)
- free_page(map->m_page_addrs[i]);
+ free_page((void *)map->m_page_addrs[i]);
kfree(map);
}
}
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index 229956b..be77bca 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -63,9 +63,9 @@ static void xprt_free_allocation(struct rpc_rqst *req)
dprintk("RPC: free allocations for req= %p\n", req);
WARN_ON_ONCE(test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state));
xbufp = &req->rq_rcv_buf;
- free_page((unsigned long)xbufp->head[0].iov_base);
+ free_page(xbufp->head[0].iov_base);
xbufp = &req->rq_snd_buf;
- free_page((unsigned long)xbufp->head[0].iov_base);
+ free_page(xbufp->head[0].iov_base);
kfree(req);
}
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 2ffaf6a..dbbc520 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2529,7 +2529,7 @@ static void bc_free(void *buffer)
return;
buf = container_of(buffer, struct rpc_buffer, data);
- free_page((unsigned long)buf);
+ free_page(buf);
}
/*
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index d0cfaa9..dba9f5f 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1277,7 +1277,7 @@ static int selinux_genfs_get_sid(struct dentry *dentry,
}
rc = security_genfs_sid(sb->s_type->name, path, tclass, sid);
}
- free_page((unsigned long)buffer);
+ free_page(buffer);
return rc;
}
@@ -2579,7 +2579,7 @@ static int selinux_sb_copy_data(char *orig, char *copy)
} while (*in_end++);
strcpy(in_save, nosec_save);
- free_page((unsigned long)nosec_save);
+ free_page(nosec_save);
out:
return rc;
}
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index c02da25..c4de69b 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -186,7 +186,7 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf,
}
length = count;
out:
- free_page((unsigned long) page);
+ free_page(page);
return length;
}
#else
@@ -313,7 +313,7 @@ static ssize_t sel_write_disable(struct file *file, const char __user *buf,
length = count;
out:
- free_page((unsigned long) page);
+ free_page(page);
return length;
}
#else
@@ -644,7 +644,7 @@ static ssize_t sel_write_checkreqprot(struct file *file, const char __user *buf,
selinux_checkreqprot = new_value ? 1 : 0;
length = count;
out:
- free_page((unsigned long) page);
+ free_page(page);
return length;
}
static const struct file_operations sel_checkreqprot_ops = {
@@ -1068,7 +1068,7 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf,
ret = simple_read_from_buffer(buf, count, ppos, page, length);
out:
mutex_unlock(&sel_mutex);
- free_page((unsigned long)page);
+ free_page(page);
return ret;
}
@@ -1121,7 +1121,7 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
out:
mutex_unlock(&sel_mutex);
- free_page((unsigned long) page);
+ free_page(page);
return length;
}
@@ -1176,7 +1176,7 @@ static ssize_t sel_commit_bools_write(struct file *filep,
out:
mutex_unlock(&sel_mutex);
- free_page((unsigned long) page);
+ free_page(page);
return length;
}
@@ -1257,10 +1257,10 @@ static int sel_make_bools(void)
bool_pending_names = names;
bool_pending_values = values;
- free_page((unsigned long)page);
+ free_page(page);
return 0;
out:
- free_page((unsigned long)page);
+ free_page(page);
if (names) {
for (i = 0; i < num; i++)
@@ -1326,7 +1326,7 @@ static ssize_t sel_write_avc_cache_threshold(struct file *file,
ret = count;
out:
- free_page((unsigned long)page);
+ free_page(page);
return ret;
}
@@ -1343,7 +1343,7 @@ static ssize_t sel_read_avc_hash_stats(struct file *filp, char __user *buf,
length = avc_get_hash_stats(page);
if (length >= 0)
length = simple_read_from_buffer(buf, count, ppos, page, length);
- free_page((unsigned long)page);
+ free_page(page);
return length;
}
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index ff81026..1f7a580 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -611,7 +611,7 @@ static int smack_sb_copy_data(char *orig, char *smackopts)
}
strcpy(orig, otheropts);
- free_page((unsigned long)otheropts);
+ free_page(otheropts);
return 0;
}
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 016e451..fb5730db 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -619,7 +619,7 @@ static void free_fake_buffer(void)
int i;
for (i = 0; i < 2; i++)
if (dummy_page[i]) {
- free_page((unsigned long)dummy_page[i]);
+ free_page(dummy_page[i]);
dummy_page[i] = NULL;
}
}
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
index a8bb4a0..8aa54fc 100644
--- a/sound/oss/msnd_pinnacle.c
+++ b/sound/oss/msnd_pinnacle.c
@@ -918,7 +918,7 @@ static int dsp_read(char __user *buf, size_t len)
n = msnd_fifo_read(&dev.DARF, page, k);
spin_unlock_irqrestore(&dev.lock, flags);
if (copy_to_user(buf, page, n)) {
- free_page((unsigned long)page);
+ free_page(page);
return -EFAULT;
}
buf += n;
@@ -934,7 +934,7 @@ static int dsp_read(char __user *buf, size_t len)
}
if (dev.rec_ndelay) {
- free_page((unsigned long)page);
+ free_page(page);
return count == len ? -EAGAIN : len - count;
}
@@ -946,12 +946,12 @@ static int dsp_read(char __user *buf, size_t len)
timeout) <= 0)
clear_bit(F_READING, &dev.flags);
if (signal_pending(current)) {
- free_page((unsigned long)page);
+ free_page(page);
return -EINTR;
}
}
}
- free_page((unsigned long)page);
+ free_page(page);
return len - count;
}
@@ -973,7 +973,7 @@ static int dsp_write(const char __user *buf, size_t len)
k = count;
if (copy_from_user(page, buf, k)) {
- free_page((unsigned long)page);
+ free_page(page);
return -EFAULT;
}
@@ -994,7 +994,7 @@ static int dsp_write(const char __user *buf, size_t len)
}
if (dev.play_ndelay) {
- free_page((unsigned long)page);
+ free_page(page);
return count == len ? -EAGAIN : len - count;
}
@@ -1005,13 +1005,13 @@ static int dsp_write(const char __user *buf, size_t len)
test_bit(F_WRITEBLOCK, &dev.flags),
timeout);
if (signal_pending(current)) {
- free_page((unsigned long)page);
+ free_page(page);
return -EINTR;
}
}
}
- free_page((unsigned long)page);
+ free_page(page);
return len - count;
}
diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c
index 92ca5be..b73fcc3 100644
--- a/sound/oss/vidc.c
+++ b/sound/oss/vidc.c
@@ -497,7 +497,7 @@ irq_failed:
dma_failed:
mem_failed:
for (i = 0; i < 2; i++)
- free_page(dma_buf[i]);
+ free_page((void *)dma_buf[i]);
sound_unload_mixerdev(audio_devs[adev]->mixer_dev);
mixer_failed:
sound_unload_audiodev(adev);
@@ -528,7 +528,7 @@ static void __exit unload_vidc(struct address_info *hw_config)
sound_unload_mixerdev(audio_devs[adev]->mixer_dev);
sound_unload_audiodev(adev);
for (i = 0; i < 2; i++)
- free_page(dma_buf[i]);
+ free_page((void *)dma_buf[i]);
}
}
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index 4f1f69b..2c2b73d 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -453,7 +453,7 @@ static void __synth_free_pages(struct snd_emu10k1 *emu, int first_page,
int page;
for (page = first_page; page <= last_page; page++) {
- free_page((unsigned long)emu->page_ptr_table[page]);
+ free_page(emu->page_ptr_table[page]);
emu->page_addr_table[page] = 0;
emu->page_ptr_table[page] = NULL;
}
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h
index 4db7d56..9e64717 100644
--- a/tools/virtio/linux/kernel.h
+++ b/tools/virtio/linux/kernel.h
@@ -77,9 +77,9 @@ static inline unsigned long __get_free_page(gfp_t gfp)
return (unsigned long)p;
}
-static inline void free_page(unsigned long addr)
+static inline void free_page(void *addr)
{
- free((void *)addr);
+ free(addr);
}
#define container_of(ptr, type, member) ({ \
diff --git a/virt/kvm/coalesced_mmio.c b/virt/kvm/coalesced_mmio.c
index 571c1ce..5fcb1ef 100644
--- a/virt/kvm/coalesced_mmio.c
+++ b/virt/kvm/coalesced_mmio.c
@@ -130,7 +130,7 @@ out_err:
void kvm_coalesced_mmio_free(struct kvm *kvm)
{
if (kvm->coalesced_mmio_ring)
- free_page((unsigned long)kvm->coalesced_mmio_ring);
+ free_page(kvm->coalesced_mmio_ring);
}
int kvm_vm_ioctl_register_coalesced_mmio(struct kvm *kvm,
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 484079e..e2353b2 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -250,7 +250,7 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
return 0;
fail_free_run:
- free_page((unsigned long)vcpu->run);
+ free_page(vcpu->run);
fail:
return r;
}
@@ -260,7 +260,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu)
{
put_pid(vcpu->pid);
kvm_arch_vcpu_uninit(vcpu);
- free_page((unsigned long)vcpu->run);
+ free_page(vcpu->run);
}
EXPORT_SYMBOL_GPL(kvm_vcpu_uninit);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/