* [PATCH 00/49] Use vzalloc not vmalloc/kmemset
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: linux-mips, alsa-devel, linux-ia64, kvm, dri-devel, linux-mm,
dm-devel, linux-mtd, devel, linux-s390, rds-devel, linux-scsi,
linux-rdma, linux-atm-general, codalist, virtualization,
coreteam, linux-input, osst-users, linux-ext4, linux-media,
cbe-oss-dev, amd64-microcode, reiserfs-devel, kvm-ppc, xfs,
linux-raid, netfilter, netdev, containers, linux-kernel,
xen-devel, e1000-devel, netfilter-devel, linux-crypto,
linuxppc-dev, drbd-user
Converted vmalloc/memset and vmalloc_node/memset to
vzalloc or vzalloc_node using a cocci script and some editing
Reduces text a little bit.
Compiled x86 only.
There are still vmalloc_32 with memset calls still around.
Broken out to multiple patches to cc appropriate maintainers.
Joe Perches (49):
arch/ia64: Use vzalloc
arch/mips: Use vzalloc
arch/powerpc: Use vzalloc
arch/s390: Use vzalloc
arch/x86: Use vzalloc
crypto: Use vzalloc
drivers/atm: Use vzalloc
drivers/block: Use vzalloc
drivers/char: Use vzalloc
drivers/gpu: Use vzalloc
drivers/hid: Use vzalloc
drivers/infiniband: Use vzalloc
drivers/isdn: Use vzalloc
drivers/md: Use vzalloc
drivers/media: Use vzalloc
drivers/mtd: Use vzalloc
drivers/net/cxgb3: Use vzalloc
drivers/net/cxgb4: Use vzalloc
drivers/net/e1000: Use vzalloc
drivers/net/e1000e: Use vzalloc
drivers/net/ehea: Use vzalloc
drivers/net/igb: Use vzalloc
drivers/net/igbvf: Use vzalloc
drivers/net/ixgb: Use vzalloc
drivers/net/ixgbe: Use vzalloc
drivers/net/ixgbevf: Use vzalloc
drivers/net/netxen: Use vzalloc
drivers/net/pch_gbe: Use vzalloc
drivers/net/qlcnic: Use vzalloc
drivers/net/sfc: Use vzalloc
drivers/net/vxge: Use vzalloc
drivers/net/bnx2.c: Use vzalloc
drivers/s390: Use vzalloc
drivers/scsi: Use vzalloc
drivers/staging: Use vzalloc
drivers/video: Use vzalloc
fs/ext4: Use vzalloc
fs/jffs2: Use vzalloc
fs/reiserfs: Use vzalloc
fs/udf: Use vzalloc
fs/xfs: Use vzalloc
include/linux/coda_linux.h: Use vzalloc
kernel: Use vzalloc
mm: Use vzalloc
net/core/pktgen.c: Use vzalloc
net/netfilter: Use vzalloc
net/rds: Use vzalloc
sound/oss/dev_table.c: Use vzalloc
virt/kvm/kvm_main.c: Use vzalloc
arch/ia64/kernel/perfmon.c | 3 +-
arch/mips/sibyte/common/sb_tbprof.c | 3 +-
arch/powerpc/kvm/book3s.c | 6 +--
arch/powerpc/platforms/cell/spufs/lscsa_alloc.c | 3 +-
arch/s390/hypfs/hypfs_diag.c | 3 +-
arch/x86/kernel/microcode_amd.c | 3 +-
arch/x86/kvm/x86.c | 3 +-
arch/x86/mm/pageattr-test.c | 3 +-
crypto/deflate.c | 3 +-
crypto/zlib.c | 3 +-
drivers/atm/idt77252.c | 11 ++++---
drivers/atm/lanai.c | 3 +-
drivers/block/drbd/drbd_bitmap.c | 5 +--
drivers/char/agp/backend.c | 3 +-
drivers/char/mspec.c | 5 +--
drivers/gpu/drm/via/via_dmablit.c | 4 +-
drivers/hid/hid-core.c | 3 +-
drivers/infiniband/hw/amso1100/c2_rnic.c | 5 +--
drivers/infiniband/hw/ehca/ipz_pt_fn.c | 5 +--
drivers/infiniband/hw/ipath/ipath_driver.c | 3 +-
drivers/infiniband/hw/ipath/ipath_file_ops.c | 11 ++-----
drivers/infiniband/hw/ipath/ipath_init_chip.c | 5 +--
drivers/infiniband/hw/qib/qib_init.c | 7 +---
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 10 ++----
drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +-
drivers/isdn/i4l/isdn_common.c | 4 +-
drivers/isdn/mISDN/dsp_core.c | 3 +-
drivers/isdn/mISDN/l1oip_codec.c | 6 +--
drivers/md/dm-log.c | 3 +-
drivers/md/dm-snap-persistent.c | 3 +-
drivers/md/dm-table.c | 4 +--
drivers/media/dvb/ngene/ngene-core.c | 3 +-
drivers/media/video/mx3_camera.c | 3 +-
drivers/media/video/pwc/pwc-if.c | 3 +-
drivers/media/video/videobuf-dma-sg.c | 3 +-
drivers/mtd/nand/nandsim.c | 3 +-
drivers/mtd/ubi/vtbl.c | 6 +--
drivers/net/bnx2.c | 10 +-----
drivers/net/cxgb3/cxgb3_offload.c | 7 ++--
drivers/net/cxgb4/cxgb4_main.c | 7 ++--
drivers/net/e1000/e1000_main.c | 6 +--
drivers/net/e1000e/netdev.c | 6 +--
drivers/net/ehea/ehea_main.c | 4 +--
drivers/net/igb/igb_main.c | 6 +--
drivers/net/igbvf/netdev.c | 6 +--
drivers/net/ixgb/ixgb_main.c | 6 +--
drivers/net/ixgbe/ixgbe_main.c | 10 ++----
drivers/net/ixgbevf/ixgbevf_main.c | 6 +--
drivers/net/netxen/netxen_nic_init.c | 7 +---
drivers/net/pch_gbe/pch_gbe_main.c | 6 +--
drivers/net/qlcnic/qlcnic_init.c | 7 +---
drivers/net/sfc/filter.c | 3 +-
drivers/net/vxge/vxge-config.c | 37 +++++-----------------
drivers/s390/cio/blacklist.c | 3 +-
drivers/scsi/bfa/bfad.c | 3 +-
drivers/scsi/bfa/bfad_debugfs.c | 8 +----
drivers/scsi/cxgbi/libcxgbi.h | 9 ++----
drivers/scsi/osst.c | 3 +-
drivers/scsi/qla2xxx/qla_attr.c | 3 +-
drivers/scsi/qla2xxx/qla_bsg.c | 3 +-
drivers/scsi/scsi_debug.c | 7 +---
drivers/staging/comedi/drivers.c | 4 +--
drivers/staging/rtl8192e/r8192E_core.c | 4 +--
drivers/staging/udlfb/udlfb.c | 5 +--
drivers/staging/xgifb/XGI_main_26.c | 3 +-
drivers/staging/zram/zram_drv.c | 3 +-
drivers/video/arcfb.c | 5 +--
drivers/video/broadsheetfb.c | 4 +--
drivers/video/hecubafb.c | 5 +--
drivers/video/metronomefb.c | 4 +--
drivers/video/xen-fbfront.c | 3 +-
fs/ext4/super.c | 4 +--
fs/jffs2/build.c | 5 +--
fs/reiserfs/journal.c | 9 ++----
fs/reiserfs/resize.c | 4 +--
fs/udf/super.c | 5 +--
fs/xfs/linux-2.6/kmem.h | 7 +----
include/linux/coda_linux.h | 26 ++++++++++------
kernel/profile.c | 6 +--
kernel/relay.c | 4 +--
mm/memcontrol.c | 5 +--
mm/page_cgroup.c | 3 +-
mm/percpu.c | 8 +----
mm/swapfile.c | 3 +-
net/core/pktgen.c | 3 +-
net/netfilter/x_tables.c | 5 +--
net/rds/ib_cm.c | 6 +--
sound/oss/dev_table.c | 6 +--
virt/kvm/kvm_main.c | 13 ++------
89 files changed, 167 insertions(+), 328 deletions(-)
--
1.7.3.1.g432b3.dirty
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 00/49] Use vzalloc not vmalloc/kmemset
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: linux-ia64, linux-kernel, linux-mips, kvm, kvm-ppc, linuxppc-dev,
cbe-oss-dev, linux-s390, amd64-microcode, linux-crypto,
linux-atm-general, netdev, drbd-user, dri-devel, linux-input,
linux-rdma, dm-devel, linux-raid, linux-media, linux-mtd,
e1000-devel, linux-scsi, osst-users, devel, xen-devel,
virtualization, linux-ext4, reiserfs-devel, xfs, codalist,
linux-mm, containers, netfilter-devel, netfilter, coreteam,
rds-devel, alsa-devel
Converted vmalloc/memset and vmalloc_node/memset to
vzalloc or vzalloc_node using a cocci script and some editing
Reduces text a little bit.
Compiled x86 only.
There are still vmalloc_32 with memset calls still around.
Broken out to multiple patches to cc appropriate maintainers.
Joe Perches (49):
arch/ia64: Use vzalloc
arch/mips: Use vzalloc
arch/powerpc: Use vzalloc
arch/s390: Use vzalloc
arch/x86: Use vzalloc
crypto: Use vzalloc
drivers/atm: Use vzalloc
drivers/block: Use vzalloc
drivers/char: Use vzalloc
drivers/gpu: Use vzalloc
drivers/hid: Use vzalloc
drivers/infiniband: Use vzalloc
drivers/isdn: Use vzalloc
drivers/md: Use vzalloc
drivers/media: Use vzalloc
drivers/mtd: Use vzalloc
drivers/net/cxgb3: Use vzalloc
drivers/net/cxgb4: Use vzalloc
drivers/net/e1000: Use vzalloc
drivers/net/e1000e: Use vzalloc
drivers/net/ehea: Use vzalloc
drivers/net/igb: Use vzalloc
drivers/net/igbvf: Use vzalloc
drivers/net/ixgb: Use vzalloc
drivers/net/ixgbe: Use vzalloc
drivers/net/ixgbevf: Use vzalloc
drivers/net/netxen: Use vzalloc
drivers/net/pch_gbe: Use vzalloc
drivers/net/qlcnic: Use vzalloc
drivers/net/sfc: Use vzalloc
drivers/net/vxge: Use vzalloc
drivers/net/bnx2.c: Use vzalloc
drivers/s390: Use vzalloc
drivers/scsi: Use vzalloc
drivers/staging: Use vzalloc
drivers/video: Use vzalloc
fs/ext4: Use vzalloc
fs/jffs2: Use vzalloc
fs/reiserfs: Use vzalloc
fs/udf: Use vzalloc
fs/xfs: Use vzalloc
include/linux/coda_linux.h: Use vzalloc
kernel: Use vzalloc
mm: Use vzalloc
net/core/pktgen.c: Use vzalloc
net/netfilter: Use vzalloc
net/rds: Use vzalloc
sound/oss/dev_table.c: Use vzalloc
virt/kvm/kvm_main.c: Use vzalloc
arch/ia64/kernel/perfmon.c | 3 +-
arch/mips/sibyte/common/sb_tbprof.c | 3 +-
arch/powerpc/kvm/book3s.c | 6 +--
arch/powerpc/platforms/cell/spufs/lscsa_alloc.c | 3 +-
arch/s390/hypfs/hypfs_diag.c | 3 +-
arch/x86/kernel/microcode_amd.c | 3 +-
arch/x86/kvm/x86.c | 3 +-
arch/x86/mm/pageattr-test.c | 3 +-
crypto/deflate.c | 3 +-
crypto/zlib.c | 3 +-
drivers/atm/idt77252.c | 11 ++++---
drivers/atm/lanai.c | 3 +-
drivers/block/drbd/drbd_bitmap.c | 5 +--
drivers/char/agp/backend.c | 3 +-
drivers/char/mspec.c | 5 +--
drivers/gpu/drm/via/via_dmablit.c | 4 +-
drivers/hid/hid-core.c | 3 +-
drivers/infiniband/hw/amso1100/c2_rnic.c | 5 +--
drivers/infiniband/hw/ehca/ipz_pt_fn.c | 5 +--
drivers/infiniband/hw/ipath/ipath_driver.c | 3 +-
drivers/infiniband/hw/ipath/ipath_file_ops.c | 11 ++-----
drivers/infiniband/hw/ipath/ipath_init_chip.c | 5 +--
drivers/infiniband/hw/qib/qib_init.c | 7 +---
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 10 ++----
drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +-
drivers/isdn/i4l/isdn_common.c | 4 +-
drivers/isdn/mISDN/dsp_core.c | 3 +-
drivers/isdn/mISDN/l1oip_codec.c | 6 +--
drivers/md/dm-log.c | 3 +-
drivers/md/dm-snap-persistent.c | 3 +-
drivers/md/dm-table.c | 4 +--
drivers/media/dvb/ngene/ngene-core.c | 3 +-
drivers/media/video/mx3_camera.c | 3 +-
drivers/media/video/pwc/pwc-if.c | 3 +-
drivers/media/video/videobuf-dma-sg.c | 3 +-
drivers/mtd/nand/nandsim.c | 3 +-
drivers/mtd/ubi/vtbl.c | 6 +--
drivers/net/bnx2.c | 10 +-----
drivers/net/cxgb3/cxgb3_offload.c | 7 ++--
drivers/net/cxgb4/cxgb4_main.c | 7 ++--
drivers/net/e1000/e1000_main.c | 6 +--
drivers/net/e1000e/netdev.c | 6 +--
drivers/net/ehea/ehea_main.c | 4 +--
drivers/net/igb/igb_main.c | 6 +--
drivers/net/igbvf/netdev.c | 6 +--
drivers/net/ixgb/ixgb_main.c | 6 +--
drivers/net/ixgbe/ixgbe_main.c | 10 ++----
drivers/net/ixgbevf/ixgbevf_main.c | 6 +--
drivers/net/netxen/netxen_nic_init.c | 7 +---
drivers/net/pch_gbe/pch_gbe_main.c | 6 +--
drivers/net/qlcnic/qlcnic_init.c | 7 +---
drivers/net/sfc/filter.c | 3 +-
drivers/net/vxge/vxge-config.c | 37 +++++-----------------
drivers/s390/cio/blacklist.c | 3 +-
drivers/scsi/bfa/bfad.c | 3 +-
drivers/scsi/bfa/bfad_debugfs.c | 8 +----
drivers/scsi/cxgbi/libcxgbi.h | 9 ++----
drivers/scsi/osst.c | 3 +-
drivers/scsi/qla2xxx/qla_attr.c | 3 +-
drivers/scsi/qla2xxx/qla_bsg.c | 3 +-
drivers/scsi/scsi_debug.c | 7 +---
drivers/staging/comedi/drivers.c | 4 +--
drivers/staging/rtl8192e/r8192E_core.c | 4 +--
drivers/staging/udlfb/udlfb.c | 5 +--
drivers/staging/xgifb/XGI_main_26.c | 3 +-
drivers/staging/zram/zram_drv.c | 3 +-
drivers/video/arcfb.c | 5 +--
drivers/video/broadsheetfb.c | 4 +--
drivers/video/hecubafb.c | 5 +--
drivers/video/metronomefb.c | 4 +--
drivers/video/xen-fbfront.c | 3 +-
fs/ext4/super.c | 4 +--
fs/jffs2/build.c | 5 +--
fs/reiserfs/journal.c | 9 ++----
fs/reiserfs/resize.c | 4 +--
fs/udf/super.c | 5 +--
fs/xfs/linux-2.6/kmem.h | 7 +----
include/linux/coda_linux.h | 26 ++++++++++------
kernel/profile.c | 6 +--
kernel/relay.c | 4 +--
mm/memcontrol.c | 5 +--
mm/page_cgroup.c | 3 +-
mm/percpu.c | 8 +----
mm/swapfile.c | 3 +-
net/core/pktgen.c | 3 +-
net/netfilter/x_tables.c | 5 +--
net/rds/ib_cm.c | 6 +--
sound/oss/dev_table.c | 6 +--
virt/kvm/kvm_main.c | 13 ++------
89 files changed, 167 insertions(+), 328 deletions(-)
--
1.7.3.1.g432b3.dirty
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 00/49] Use vzalloc not vmalloc/kmemset
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: linux-ia64, linux-kernel, linux-mips, kvm, kvm-ppc, linuxppc-dev,
cbe-oss-dev, linux-s390, amd64-microcode, linux-crypto,
linux-atm-general, netdev, drbd-user, dri-devel, linux-input,
linux-rdma, dm-devel, linux-raid, linux-media, linux-mtd,
e1000-devel, linux-scsi, osst-users, devel, xen-devel,
virtualization, linux-ext4, reiserfs-devel, xfs, codalist,
linux-mm, containers, netfilter-devel, netfilter, coreteam,
rds-devel, alsa-devel
Converted vmalloc/memset and vmalloc_node/memset to
vzalloc or vzalloc_node using a cocci script and some editing
Reduces text a little bit.
Compiled x86 only.
There are still vmalloc_32 with memset calls still around.
Broken out to multiple patches to cc appropriate maintainers.
Joe Perches (49):
arch/ia64: Use vzalloc
arch/mips: Use vzalloc
arch/powerpc: Use vzalloc
arch/s390: Use vzalloc
arch/x86: Use vzalloc
crypto: Use vzalloc
drivers/atm: Use vzalloc
drivers/block: Use vzalloc
drivers/char: Use vzalloc
drivers/gpu: Use vzalloc
drivers/hid: Use vzalloc
drivers/infiniband: Use vzalloc
drivers/isdn: Use vzalloc
drivers/md: Use vzalloc
drivers/media: Use vzalloc
drivers/mtd: Use vzalloc
drivers/net/cxgb3: Use vzalloc
drivers/net/cxgb4: Use vzalloc
drivers/net/e1000: Use vzalloc
drivers/net/e1000e: Use vzalloc
drivers/net/ehea: Use vzalloc
drivers/net/igb: Use vzalloc
drivers/net/igbvf: Use vzalloc
drivers/net/ixgb: Use vzalloc
drivers/net/ixgbe: Use vzalloc
drivers/net/ixgbevf: Use vzalloc
drivers/net/netxen: Use vzalloc
drivers/net/pch_gbe: Use vzalloc
drivers/net/qlcnic: Use vzalloc
drivers/net/sfc: Use vzalloc
drivers/net/vxge: Use vzalloc
drivers/net/bnx2.c: Use vzalloc
drivers/s390: Use vzalloc
drivers/scsi: Use vzalloc
drivers/staging: Use vzalloc
drivers/video: Use vzalloc
fs/ext4: Use vzalloc
fs/jffs2: Use vzalloc
fs/reiserfs: Use vzalloc
fs/udf: Use vzalloc
fs/xfs: Use vzalloc
include/linux/coda_linux.h: Use vzalloc
kernel: Use vzalloc
mm: Use vzalloc
net/core/pktgen.c: Use vzalloc
net/netfilter: Use vzalloc
net/rds: Use vzalloc
sound/oss/dev_table.c: Use vzalloc
virt/kvm/kvm_main.c: Use vzalloc
arch/ia64/kernel/perfmon.c | 3 +-
arch/mips/sibyte/common/sb_tbprof.c | 3 +-
arch/powerpc/kvm/book3s.c | 6 +--
arch/powerpc/platforms/cell/spufs/lscsa_alloc.c | 3 +-
arch/s390/hypfs/hypfs_diag.c | 3 +-
arch/x86/kernel/microcode_amd.c | 3 +-
arch/x86/kvm/x86.c | 3 +-
arch/x86/mm/pageattr-test.c | 3 +-
crypto/deflate.c | 3 +-
crypto/zlib.c | 3 +-
drivers/atm/idt77252.c | 11 ++++---
drivers/atm/lanai.c | 3 +-
drivers/block/drbd/drbd_bitmap.c | 5 +--
drivers/char/agp/backend.c | 3 +-
drivers/char/mspec.c | 5 +--
drivers/gpu/drm/via/via_dmablit.c | 4 +-
drivers/hid/hid-core.c | 3 +-
drivers/infiniband/hw/amso1100/c2_rnic.c | 5 +--
drivers/infiniband/hw/ehca/ipz_pt_fn.c | 5 +--
drivers/infiniband/hw/ipath/ipath_driver.c | 3 +-
drivers/infiniband/hw/ipath/ipath_file_ops.c | 11 ++-----
drivers/infiniband/hw/ipath/ipath_init_chip.c | 5 +--
drivers/infiniband/hw/qib/qib_init.c | 7 +---
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 10 ++----
drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +-
drivers/isdn/i4l/isdn_common.c | 4 +-
drivers/isdn/mISDN/dsp_core.c | 3 +-
drivers/isdn/mISDN/l1oip_codec.c | 6 +--
drivers/md/dm-log.c | 3 +-
drivers/md/dm-snap-persistent.c | 3 +-
drivers/md/dm-table.c | 4 +--
drivers/media/dvb/ngene/ngene-core.c | 3 +-
drivers/media/video/mx3_camera.c | 3 +-
drivers/media/video/pwc/pwc-if.c | 3 +-
drivers/media/video/videobuf-dma-sg.c | 3 +-
drivers/mtd/nand/nandsim.c | 3 +-
drivers/mtd/ubi/vtbl.c | 6 +--
drivers/net/bnx2.c | 10 +-----
drivers/net/cxgb3/cxgb3_offload.c | 7 ++--
drivers/net/cxgb4/cxgb4_main.c | 7 ++--
drivers/net/e1000/e1000_main.c | 6 +--
drivers/net/e1000e/netdev.c | 6 +--
drivers/net/ehea/ehea_main.c | 4 +--
drivers/net/igb/igb_main.c | 6 +--
drivers/net/igbvf/netdev.c | 6 +--
drivers/net/ixgb/ixgb_main.c | 6 +--
drivers/net/ixgbe/ixgbe_main.c | 10 ++----
drivers/net/ixgbevf/ixgbevf_main.c | 6 +--
drivers/net/netxen/netxen_nic_init.c | 7 +---
drivers/net/pch_gbe/pch_gbe_main.c | 6 +--
drivers/net/qlcnic/qlcnic_init.c | 7 +---
drivers/net/sfc/filter.c | 3 +-
drivers/net/vxge/vxge-config.c | 37 +++++-----------------
drivers/s390/cio/blacklist.c | 3 +-
drivers/scsi/bfa/bfad.c | 3 +-
drivers/scsi/bfa/bfad_debugfs.c | 8 +----
drivers/scsi/cxgbi/libcxgbi.h | 9 ++----
drivers/scsi/osst.c | 3 +-
drivers/scsi/qla2xxx/qla_attr.c | 3 +-
drivers/scsi/qla2xxx/qla_bsg.c | 3 +-
drivers/scsi/scsi_debug.c | 7 +---
drivers/staging/comedi/drivers.c | 4 +--
drivers/staging/rtl8192e/r8192E_core.c | 4 +--
drivers/staging/udlfb/udlfb.c | 5 +--
drivers/staging/xgifb/XGI_main_26.c | 3 +-
drivers/staging/zram/zram_drv.c | 3 +-
drivers/video/arcfb.c | 5 +--
drivers/video/broadsheetfb.c | 4 +--
drivers/video/hecubafb.c | 5 +--
drivers/video/metronomefb.c | 4 +--
drivers/video/xen-fbfront.c | 3 +-
fs/ext4/super.c | 4 +--
fs/jffs2/build.c | 5 +--
fs/reiserfs/journal.c | 9 ++----
fs/reiserfs/resize.c | 4 +--
fs/udf/super.c | 5 +--
fs/xfs/linux-2.6/kmem.h | 7 +----
include/linux/coda_linux.h | 26 ++++++++++------
kernel/profile.c | 6 +--
kernel/relay.c | 4 +--
mm/memcontrol.c | 5 +--
mm/page_cgroup.c | 3 +-
mm/percpu.c | 8 +----
mm/swapfile.c | 3 +-
net/core/pktgen.c | 3 +-
net/netfilter/x_tables.c | 5 +--
net/rds/ib_cm.c | 6 +--
sound/oss/dev_table.c | 6 +--
virt/kvm/kvm_main.c | 13 ++------
89 files changed, 167 insertions(+), 328 deletions(-)
--
1.7.3.1.g432b3.dirty
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 00/49] Use vzalloc not vmalloc/kmemset
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: linux-mips, alsa-devel, linux-ia64, kvm, dri-devel, linux-mm,
dm-devel, linux-mtd, devel, linux-s390, rds-devel, linux-scsi,
linux-rdma, linux-atm-general, virtualization, coreteam,
linux-input, osst-users, linux-ext4, linux-media, cbe-oss-dev,
amd64-microcode, reiserfs-devel, kvm-ppc, xfs, linux-raid,
netfilter, codalist, netdev, containers, linux-kernel, xen-devel,
e1000-devel, netfilter-devel, linux-crypto, linuxppc-dev,
drbd-user
Converted vmalloc/memset and vmalloc_node/memset to
vzalloc or vzalloc_node using a cocci script and some editing
Reduces text a little bit.
Compiled x86 only.
There are still vmalloc_32 with memset calls still around.
Broken out to multiple patches to cc appropriate maintainers.
Joe Perches (49):
arch/ia64: Use vzalloc
arch/mips: Use vzalloc
arch/powerpc: Use vzalloc
arch/s390: Use vzalloc
arch/x86: Use vzalloc
crypto: Use vzalloc
drivers/atm: Use vzalloc
drivers/block: Use vzalloc
drivers/char: Use vzalloc
drivers/gpu: Use vzalloc
drivers/hid: Use vzalloc
drivers/infiniband: Use vzalloc
drivers/isdn: Use vzalloc
drivers/md: Use vzalloc
drivers/media: Use vzalloc
drivers/mtd: Use vzalloc
drivers/net/cxgb3: Use vzalloc
drivers/net/cxgb4: Use vzalloc
drivers/net/e1000: Use vzalloc
drivers/net/e1000e: Use vzalloc
drivers/net/ehea: Use vzalloc
drivers/net/igb: Use vzalloc
drivers/net/igbvf: Use vzalloc
drivers/net/ixgb: Use vzalloc
drivers/net/ixgbe: Use vzalloc
drivers/net/ixgbevf: Use vzalloc
drivers/net/netxen: Use vzalloc
drivers/net/pch_gbe: Use vzalloc
drivers/net/qlcnic: Use vzalloc
drivers/net/sfc: Use vzalloc
drivers/net/vxge: Use vzalloc
drivers/net/bnx2.c: Use vzalloc
drivers/s390: Use vzalloc
drivers/scsi: Use vzalloc
drivers/staging: Use vzalloc
drivers/video: Use vzalloc
fs/ext4: Use vzalloc
fs/jffs2: Use vzalloc
fs/reiserfs: Use vzalloc
fs/udf: Use vzalloc
fs/xfs: Use vzalloc
include/linux/coda_linux.h: Use vzalloc
kernel: Use vzalloc
mm: Use vzalloc
net/core/pktgen.c: Use vzalloc
net/netfilter: Use vzalloc
net/rds: Use vzalloc
sound/oss/dev_table.c: Use vzalloc
virt/kvm/kvm_main.c: Use vzalloc
arch/ia64/kernel/perfmon.c | 3 +-
arch/mips/sibyte/common/sb_tbprof.c | 3 +-
arch/powerpc/kvm/book3s.c | 6 +--
arch/powerpc/platforms/cell/spufs/lscsa_alloc.c | 3 +-
arch/s390/hypfs/hypfs_diag.c | 3 +-
arch/x86/kernel/microcode_amd.c | 3 +-
arch/x86/kvm/x86.c | 3 +-
arch/x86/mm/pageattr-test.c | 3 +-
crypto/deflate.c | 3 +-
crypto/zlib.c | 3 +-
drivers/atm/idt77252.c | 11 ++++---
drivers/atm/lanai.c | 3 +-
drivers/block/drbd/drbd_bitmap.c | 5 +--
drivers/char/agp/backend.c | 3 +-
drivers/char/mspec.c | 5 +--
drivers/gpu/drm/via/via_dmablit.c | 4 +-
drivers/hid/hid-core.c | 3 +-
drivers/infiniband/hw/amso1100/c2_rnic.c | 5 +--
drivers/infiniband/hw/ehca/ipz_pt_fn.c | 5 +--
drivers/infiniband/hw/ipath/ipath_driver.c | 3 +-
drivers/infiniband/hw/ipath/ipath_file_ops.c | 11 ++-----
drivers/infiniband/hw/ipath/ipath_init_chip.c | 5 +--
drivers/infiniband/hw/qib/qib_init.c | 7 +---
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 10 ++----
drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +-
drivers/isdn/i4l/isdn_common.c | 4 +-
drivers/isdn/mISDN/dsp_core.c | 3 +-
drivers/isdn/mISDN/l1oip_codec.c | 6 +--
drivers/md/dm-log.c | 3 +-
drivers/md/dm-snap-persistent.c | 3 +-
drivers/md/dm-table.c | 4 +--
drivers/media/dvb/ngene/ngene-core.c | 3 +-
drivers/media/video/mx3_camera.c | 3 +-
drivers/media/video/pwc/pwc-if.c | 3 +-
drivers/media/video/videobuf-dma-sg.c | 3 +-
drivers/mtd/nand/nandsim.c | 3 +-
drivers/mtd/ubi/vtbl.c | 6 +--
drivers/net/bnx2.c | 10 +-----
drivers/net/cxgb3/cxgb3_offload.c | 7 ++--
drivers/net/cxgb4/cxgb4_main.c | 7 ++--
drivers/net/e1000/e1000_main.c | 6 +--
drivers/net/e1000e/netdev.c | 6 +--
drivers/net/ehea/ehea_main.c | 4 +--
drivers/net/igb/igb_main.c | 6 +--
drivers/net/igbvf/netdev.c | 6 +--
drivers/net/ixgb/ixgb_main.c | 6 +--
drivers/net/ixgbe/ixgbe_main.c | 10 ++----
drivers/net/ixgbevf/ixgbevf_main.c | 6 +--
drivers/net/netxen/netxen_nic_init.c | 7 +---
drivers/net/pch_gbe/pch_gbe_main.c | 6 +--
drivers/net/qlcnic/qlcnic_init.c | 7 +---
drivers/net/sfc/filter.c | 3 +-
drivers/net/vxge/vxge-config.c | 37 +++++-----------------
drivers/s390/cio/blacklist.c | 3 +-
drivers/scsi/bfa/bfad.c | 3 +-
drivers/scsi/bfa/bfad_debugfs.c | 8 +----
drivers/scsi/cxgbi/libcxgbi.h | 9 ++----
drivers/scsi/osst.c | 3 +-
drivers/scsi/qla2xxx/qla_attr.c | 3 +-
drivers/scsi/qla2xxx/qla_bsg.c | 3 +-
drivers/scsi/scsi_debug.c | 7 +---
drivers/staging/comedi/drivers.c | 4 +--
drivers/staging/rtl8192e/r8192E_core.c | 4 +--
drivers/staging/udlfb/udlfb.c | 5 +--
drivers/staging/xgifb/XGI_main_26.c | 3 +-
drivers/staging/zram/zram_drv.c | 3 +-
drivers/video/arcfb.c | 5 +--
drivers/video/broadsheetfb.c | 4 +--
drivers/video/hecubafb.c | 5 +--
drivers/video/metronomefb.c | 4 +--
drivers/video/xen-fbfront.c | 3 +-
fs/ext4/super.c | 4 +--
fs/jffs2/build.c | 5 +--
fs/reiserfs/journal.c | 9 ++----
fs/reiserfs/resize.c | 4 +--
fs/udf/super.c | 5 +--
fs/xfs/linux-2.6/kmem.h | 7 +----
include/linux/coda_linux.h | 26 ++++++++++------
kernel/profile.c | 6 +--
kernel/relay.c | 4 +--
mm/memcontrol.c | 5 +--
mm/page_cgroup.c | 3 +-
mm/percpu.c | 8 +----
mm/swapfile.c | 3 +-
net/core/pktgen.c | 3 +-
net/netfilter/x_tables.c | 5 +--
net/rds/ib_cm.c | 6 +--
sound/oss/dev_table.c | 6 +--
virt/kvm/kvm_main.c | 13 ++------
89 files changed, 167 insertions(+), 328 deletions(-)
--
1.7.3.1.g432b3.dirty
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 01/49] arch/ia64: Use vzalloc
2010-11-03 16:10 ` Christoph Lameter
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Tony Luck, Fenghua Yu, linux-ia64, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/ia64/kernel/perfmon.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 39e534f..3aee09d 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -829,10 +829,9 @@ pfm_rvmalloc(unsigned long size)
unsigned long addr;
size = PAGE_ALIGN(size);
- mem = vmalloc(size);
+ mem = vzalloc(size);
if (mem) {
//printk("perfmon: CPU%d pfm_rvmalloc(%ld)=%p\n", smp_processor_id(), size, mem);
- memset(mem, 0, size);
addr = (unsigned long)mem;
while (size > 0) {
pfm_reserve_page(addr);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 01/49] arch/ia64: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Tony Luck, Fenghua Yu, linux-ia64, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/ia64/kernel/perfmon.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 39e534f..3aee09d 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -829,10 +829,9 @@ pfm_rvmalloc(unsigned long size)
unsigned long addr;
size = PAGE_ALIGN(size);
- mem = vmalloc(size);
+ mem = vzalloc(size);
if (mem) {
//printk("perfmon: CPU%d pfm_rvmalloc(%ld)=%p\n", smp_processor_id(), size, mem);
- memset(mem, 0, size);
addr = (unsigned long)mem;
while (size > 0) {
pfm_reserve_page(addr);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 02/49] arch/mips: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (4 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
2010-11-05 10:51 ` Ralf Baechle
-1 siblings, 1 reply; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Ralf Baechle, linux-mips, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/mips/sibyte/common/sb_tbprof.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
index 87ccdb4..48853ab 100644
--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -410,14 +410,13 @@ static int sbprof_tb_open(struct inode *inode, struct file *filp)
return -EBUSY;
memset(&sbp, 0, sizeof(struct sbprof_tb));
- sbp.sbprof_tbbuf = vmalloc(MAX_TBSAMPLE_BYTES);
+ sbp.sbprof_tbbuf = vzalloc(MAX_TBSAMPLE_BYTES);
if (!sbp.sbprof_tbbuf) {
sbp.open = SB_CLOSED;
wmb();
return -ENOMEM;
}
- memset(sbp.sbprof_tbbuf, 0, MAX_TBSAMPLE_BYTES);
init_waitqueue_head(&sbp.tb_sync);
init_waitqueue_head(&sbp.tb_read);
mutex_init(&sbp.lock);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 03/49] arch/powerpc: Use vzalloc
2010-11-05 3:07 ` Joe Perches
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Avi Kivity, Marcelo Tosatti, Alexander Graf,
Benjamin Herrenschmidt, Paul Mackerras, Jeremy Kerr,
Arnd Bergmann, kvm, kvm-ppc, linuxppc-dev, linux-kernel,
cbe-oss-dev
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/powerpc/kvm/book3s.c | 6 ++----
arch/powerpc/platforms/cell/spufs/lscsa_alloc.c | 3 +--
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index e316847..4275463 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -1307,13 +1307,11 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
int err = -ENOMEM;
unsigned long p;
- vcpu_book3s = vmalloc(sizeof(struct kvmppc_vcpu_book3s));
+ vcpu_book3s = vzalloc(sizeof(struct kvmppc_vcpu_book3s));
if (!vcpu_book3s)
goto out;
- memset(vcpu_book3s, 0, sizeof(struct kvmppc_vcpu_book3s));
-
- vcpu_book3s->shadow_vcpu = (struct kvmppc_book3s_shadow_vcpu *)
+ vcpu_book3s->shadow_vcpu =
kzalloc(sizeof(*vcpu_book3s->shadow_vcpu), GFP_KERNEL);
if (!vcpu_book3s->shadow_vcpu)
goto free_vcpu;
diff --git a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
index a101abf..3b894f5 100644
--- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
+++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
@@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa)
struct spu_lscsa *lscsa;
unsigned char *p;
- lscsa = vmalloc(sizeof(struct spu_lscsa));
+ lscsa = vzalloc(sizeof(struct spu_lscsa));
if (!lscsa)
return -ENOMEM;
- memset(lscsa, 0, sizeof(struct spu_lscsa));
csa->lscsa = lscsa;
/* Set LS pages reserved to allow for user-space mapping. */
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 03/49] arch/powerpc: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Avi Kivity, Marcelo Tosatti, Alexander Graf,
Benjamin Herrenschmidt, Paul Mackerras, Jeremy Kerr,
Arnd Bergmann, kvm, kvm-ppc, linuxppc-dev, linux-kernel,
cbe-oss-dev
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/powerpc/kvm/book3s.c | 6 ++----
arch/powerpc/platforms/cell/spufs/lscsa_alloc.c | 3 +--
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index e316847..4275463 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -1307,13 +1307,11 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
int err = -ENOMEM;
unsigned long p;
- vcpu_book3s = vmalloc(sizeof(struct kvmppc_vcpu_book3s));
+ vcpu_book3s = vzalloc(sizeof(struct kvmppc_vcpu_book3s));
if (!vcpu_book3s)
goto out;
- memset(vcpu_book3s, 0, sizeof(struct kvmppc_vcpu_book3s));
-
- vcpu_book3s->shadow_vcpu = (struct kvmppc_book3s_shadow_vcpu *)
+ vcpu_book3s->shadow_vcpu kzalloc(sizeof(*vcpu_book3s->shadow_vcpu), GFP_KERNEL);
if (!vcpu_book3s->shadow_vcpu)
goto free_vcpu;
diff --git a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
index a101abf..3b894f5 100644
--- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
+++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
@@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa)
struct spu_lscsa *lscsa;
unsigned char *p;
- lscsa = vmalloc(sizeof(struct spu_lscsa));
+ lscsa = vzalloc(sizeof(struct spu_lscsa));
if (!lscsa)
return -ENOMEM;
- memset(lscsa, 0, sizeof(struct spu_lscsa));
csa->lscsa = lscsa;
/* Set LS pages reserved to allow for user-space mapping. */
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 03/49] arch/powerpc: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: cbe-oss-dev, kvm, Arnd Bergmann, Marcelo Tosatti, Alexander Graf,
kvm-ppc, linux-kernel, Paul Mackerras, Jeremy Kerr, linuxppc-dev,
Avi Kivity
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/powerpc/kvm/book3s.c | 6 ++----
arch/powerpc/platforms/cell/spufs/lscsa_alloc.c | 3 +--
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index e316847..4275463 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -1307,13 +1307,11 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
int err = -ENOMEM;
unsigned long p;
- vcpu_book3s = vmalloc(sizeof(struct kvmppc_vcpu_book3s));
+ vcpu_book3s = vzalloc(sizeof(struct kvmppc_vcpu_book3s));
if (!vcpu_book3s)
goto out;
- memset(vcpu_book3s, 0, sizeof(struct kvmppc_vcpu_book3s));
-
- vcpu_book3s->shadow_vcpu = (struct kvmppc_book3s_shadow_vcpu *)
+ vcpu_book3s->shadow_vcpu =
kzalloc(sizeof(*vcpu_book3s->shadow_vcpu), GFP_KERNEL);
if (!vcpu_book3s->shadow_vcpu)
goto free_vcpu;
diff --git a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
index a101abf..3b894f5 100644
--- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
+++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
@@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa)
struct spu_lscsa *lscsa;
unsigned char *p;
- lscsa = vmalloc(sizeof(struct spu_lscsa));
+ lscsa = vzalloc(sizeof(struct spu_lscsa));
if (!lscsa)
return -ENOMEM;
- memset(lscsa, 0, sizeof(struct spu_lscsa));
csa->lscsa = lscsa;
/* Set LS pages reserved to allow for user-space mapping. */
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [Cbe-oss-dev] [PATCH 03/49] arch/powerpc: Use vzalloc
2010-11-05 3:07 ` Joe Perches
(?)
@ 2010-11-05 13:08 ` Jeremy Kerr
-1 siblings, 0 replies; 153+ messages in thread
From: Jeremy Kerr @ 2010-11-05 13:08 UTC (permalink / raw)
To: cbe-oss-dev
Cc: Joe Perches, Jiri Kosina, kvm, Arnd Bergmann, Marcelo Tosatti,
Alexander Graf, kvm-ppc, linux-kernel, Paul Mackerras,
linuxppc-dev, Avi Kivity
Hi Joe,
> diff --git a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
> b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c index a101abf..3b894f5
> 100644
> --- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
> +++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
> @@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa)
> struct spu_lscsa *lscsa;
> unsigned char *p;
>
> - lscsa = vmalloc(sizeof(struct spu_lscsa));
> + lscsa = vzalloc(sizeof(struct spu_lscsa));
> if (!lscsa)
> return -ENOMEM;
> - memset(lscsa, 0, sizeof(struct spu_lscsa));
> csa->lscsa = lscsa;
>
> /* Set LS pages reserved to allow for user-space mapping. */
For the spufs bit:
Acked-By: Jeremy Kerr <jk@ozlabs.org>
Cheers,
Jeremy
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [Cbe-oss-dev] [PATCH 03/49] arch/powerpc: Use vzalloc
@ 2010-11-05 13:08 ` Jeremy Kerr
0 siblings, 0 replies; 153+ messages in thread
From: Jeremy Kerr @ 2010-11-05 13:08 UTC (permalink / raw)
To: cbe-oss-dev
Cc: Joe Perches, Jiri Kosina, kvm, Arnd Bergmann, Marcelo Tosatti,
Alexander Graf, kvm-ppc, linux-kernel, Paul Mackerras,
linuxppc-dev, Avi Kivity
Hi Joe,
> diff --git a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
> b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c index a101abf..3b894f5
> 100644
> --- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
> +++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
> @@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa)
> struct spu_lscsa *lscsa;
> unsigned char *p;
>
> - lscsa = vmalloc(sizeof(struct spu_lscsa));
> + lscsa = vzalloc(sizeof(struct spu_lscsa));
> if (!lscsa)
> return -ENOMEM;
> - memset(lscsa, 0, sizeof(struct spu_lscsa));
> csa->lscsa = lscsa;
>
> /* Set LS pages reserved to allow for user-space mapping. */
For the spufs bit:
Acked-By: Jeremy Kerr <jk@ozlabs.org>
Cheers,
Jeremy
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [Cbe-oss-dev] [PATCH 03/49] arch/powerpc: Use vzalloc
@ 2010-11-05 13:08 ` Jeremy Kerr
0 siblings, 0 replies; 153+ messages in thread
From: Jeremy Kerr @ 2010-11-05 13:08 UTC (permalink / raw)
To: cbe-oss-dev
Cc: Jiri Kosina, kvm, Arnd Bergmann, Marcelo Tosatti, Alexander Graf,
kvm-ppc, linux-kernel, Paul Mackerras, Avi Kivity, Joe Perches,
linuxppc-dev
Hi Joe,
> diff --git a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
> b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c index a101abf..3b894f5
> 100644
> --- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
> +++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
> @@ -36,10 +36,9 @@ static int spu_alloc_lscsa_std(struct spu_state *csa)
> struct spu_lscsa *lscsa;
> unsigned char *p;
>
> - lscsa = vmalloc(sizeof(struct spu_lscsa));
> + lscsa = vzalloc(sizeof(struct spu_lscsa));
> if (!lscsa)
> return -ENOMEM;
> - memset(lscsa, 0, sizeof(struct spu_lscsa));
> csa->lscsa = lscsa;
>
> /* Set LS pages reserved to allow for user-space mapping. */
For the spufs bit:
Acked-By: Jeremy Kerr <jk@ozlabs.org>
Cheers,
Jeremy
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 04/49] arch/s390: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (6 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Martin Schwidefsky, Heiko Carstens, linux390, linux-s390, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/s390/hypfs/hypfs_diag.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c
index cd4a81b..1b1acef 100644
--- a/arch/s390/hypfs/hypfs_diag.c
+++ b/arch/s390/hypfs/hypfs_diag.c
@@ -570,12 +570,11 @@ static int dbfs_d204_open(struct inode *inode, struct file *file)
if (!data)
return -ENOMEM;
buf_size = PAGE_SIZE * (diag204_buf_pages + 1) + sizeof(d204->hdr);
- data->base = vmalloc(buf_size);
+ data->base = vzalloc(buf_size);
if (!data->base) {
rc = -ENOMEM;
goto fail_kfree_data;
}
- memset(data->base, 0, buf_size);
d204 = page_align_ptr(data->base + sizeof(d204->hdr))
- sizeof(d204->hdr);
rc = diag204_do_store(&d204->buf, diag204_buf_pages);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 05/49] arch/x86: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (7 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
2010-11-05 4:22 ` Takuya Yoshikawa
-1 siblings, 1 reply; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Andreas Herrmann, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
x86, Avi Kivity, Marcelo Tosatti, amd64-microcode, linux-kernel,
kvm
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/x86/kernel/microcode_amd.c | 3 +--
arch/x86/kvm/x86.c | 3 +--
arch/x86/mm/pageattr-test.c | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index e1af7c0..d46e805 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -183,9 +183,8 @@ get_next_ucode(const u8 *buf, unsigned int size, unsigned int *mc_size)
return NULL;
}
- mc = vmalloc(UCODE_MAX_SIZE);
+ mc = vzalloc(UCODE_MAX_SIZE);
if (mc) {
- memset(mc, 0, UCODE_MAX_SIZE);
if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR,
total_size)) {
vfree(mc);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 2288ad8..624d4da 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3174,10 +3174,9 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
spin_unlock(&kvm->mmu_lock);
r = -ENOMEM;
- dirty_bitmap = vmalloc(n);
+ dirty_bitmap = vzalloc(n);
if (!dirty_bitmap)
goto out;
- memset(dirty_bitmap, 0, n);
r = -ENOMEM;
slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);
diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c
index e1d1069..b008656 100644
--- a/arch/x86/mm/pageattr-test.c
+++ b/arch/x86/mm/pageattr-test.c
@@ -123,12 +123,11 @@ static int pageattr_test(void)
if (print)
printk(KERN_INFO "CPA self-test:\n");
- bm = vmalloc((max_pfn_mapped + 7) / 8);
+ bm = vzalloc((max_pfn_mapped + 7) / 8);
if (!bm) {
printk(KERN_ERR "CPA Cannot vmalloc bitmap\n");
return -ENOMEM;
}
- memset(bm, 0, (max_pfn_mapped + 7) / 8);
failed += print_split(&sa);
srandom32(100);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 05/49] arch/x86: Use vzalloc
2010-11-05 3:07 ` [PATCH 05/49] arch/x86: " Joe Perches
@ 2010-11-05 4:22 ` Takuya Yoshikawa
0 siblings, 0 replies; 153+ messages in thread
From: Takuya Yoshikawa @ 2010-11-05 4:22 UTC (permalink / raw)
To: Joe Perches
Cc: Jiri Kosina, Andreas Herrmann, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, Avi Kivity, Marcelo Tosatti,
amd64-microcode, linux-kernel, kvm
(2010/11/05 12:07), Joe Perches wrote:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 2288ad8..624d4da 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3174,10 +3174,9 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
> spin_unlock(&kvm->mmu_lock);
>
> r = -ENOMEM;
> - dirty_bitmap = vmalloc(n);
> + dirty_bitmap = vzalloc(n);
This vmalloc() does not exist already, see kvm.git.
Takuya
> if (!dirty_bitmap)
> goto out;
> - memset(dirty_bitmap, 0, n);
>
> r = -ENOMEM;
> slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 06/49] crypto: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Herbert Xu, David S. Miller, linux-crypto, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
crypto/deflate.c | 3 +--
crypto/zlib.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/crypto/deflate.c b/crypto/deflate.c
index 463dc85..cbc7a33 100644
--- a/crypto/deflate.c
+++ b/crypto/deflate.c
@@ -48,12 +48,11 @@ static int deflate_comp_init(struct deflate_ctx *ctx)
int ret = 0;
struct z_stream_s *stream = &ctx->comp_stream;
- stream->workspace = vmalloc(zlib_deflate_workspacesize());
+ stream->workspace = vzalloc(zlib_deflate_workspacesize());
if (!stream->workspace) {
ret = -ENOMEM;
goto out;
}
- memset(stream->workspace, 0, zlib_deflate_workspacesize());
ret = zlib_deflateInit2(stream, DEFLATE_DEF_LEVEL, Z_DEFLATED,
-DEFLATE_DEF_WINBITS, DEFLATE_DEF_MEMLEVEL,
Z_DEFAULT_STRATEGY);
diff --git a/crypto/zlib.c b/crypto/zlib.c
index c3015733..739b8fc 100644
--- a/crypto/zlib.c
+++ b/crypto/zlib.c
@@ -95,11 +95,10 @@ static int zlib_compress_setup(struct crypto_pcomp *tfm, void *params,
zlib_comp_exit(ctx);
workspacesize = zlib_deflate_workspacesize();
- stream->workspace = vmalloc(workspacesize);
+ stream->workspace = vzalloc(workspacesize);
if (!stream->workspace)
return -ENOMEM;
- memset(stream->workspace, 0, workspacesize);
ret = zlib_deflateInit2(stream,
tb[ZLIB_COMP_LEVEL]
? nla_get_u32(tb[ZLIB_COMP_LEVEL])
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 06/49] crypto: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Herbert Xu, David S. Miller, linux-crypto, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
crypto/deflate.c | 3 +--
crypto/zlib.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/crypto/deflate.c b/crypto/deflate.c
index 463dc85..cbc7a33 100644
--- a/crypto/deflate.c
+++ b/crypto/deflate.c
@@ -48,12 +48,11 @@ static int deflate_comp_init(struct deflate_ctx *ctx)
int ret = 0;
struct z_stream_s *stream = &ctx->comp_stream;
- stream->workspace = vmalloc(zlib_deflate_workspacesize());
+ stream->workspace = vzalloc(zlib_deflate_workspacesize());
if (!stream->workspace) {
ret = -ENOMEM;
goto out;
}
- memset(stream->workspace, 0, zlib_deflate_workspacesize());
ret = zlib_deflateInit2(stream, DEFLATE_DEF_LEVEL, Z_DEFLATED,
-DEFLATE_DEF_WINBITS, DEFLATE_DEF_MEMLEVEL,
Z_DEFAULT_STRATEGY);
diff --git a/crypto/zlib.c b/crypto/zlib.c
index c3015733..739b8fc 100644
--- a/crypto/zlib.c
+++ b/crypto/zlib.c
@@ -95,11 +95,10 @@ static int zlib_compress_setup(struct crypto_pcomp *tfm, void *params,
zlib_comp_exit(ctx);
workspacesize = zlib_deflate_workspacesize();
- stream->workspace = vmalloc(workspacesize);
+ stream->workspace = vzalloc(workspacesize);
if (!stream->workspace)
return -ENOMEM;
- memset(stream->workspace, 0, workspacesize);
ret = zlib_deflateInit2(stream,
tb[ZLIB_COMP_LEVEL]
? nla_get_u32(tb[ZLIB_COMP_LEVEL])
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 06/49] crypto: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-27 8:31 ` Herbert Xu
-1 siblings, 0 replies; 153+ messages in thread
From: Herbert Xu @ 2010-11-27 8:31 UTC (permalink / raw)
To: Joe Perches; +Cc: Jiri Kosina, David S. Miller, linux-crypto, linux-kernel
On Thu, Nov 04, 2010 at 08:07:30PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 07/49] drivers/atm: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (9 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Chas Williams, linux-atm-general, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/atm/idt77252.c | 11 ++++++-----
drivers/atm/lanai.c | 3 +--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index bce5732..8c09e32 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -3459,27 +3459,28 @@ init_card(struct atm_dev *dev)
size = sizeof(struct vc_map *) * card->tct_size;
IPRINTK("%s: allocate %d byte for VC map.\n", card->name, size);
- if (NULL == (card->vcs = vmalloc(size))) {
+ card->vcs = vzalloc(size);
+ if (!card->vcs) {
printk("%s: memory allocation failure.\n", card->name);
deinit_card(card);
return -1;
}
- memset(card->vcs, 0, size);
size = sizeof(struct vc_map *) * card->scd_size;
IPRINTK("%s: allocate %d byte for SCD to VC mapping.\n",
card->name, size);
- if (NULL == (card->scd2vc = vmalloc(size))) {
+ card->scd2vc = vzalloc(size);
+ if (!card->scd2vc) {
printk("%s: memory allocation failure.\n", card->name);
deinit_card(card);
return -1;
}
- memset(card->scd2vc, 0, size);
size = sizeof(struct tst_info) * (card->tst_size - 2);
IPRINTK("%s: allocate %d byte for TST to VC mapping.\n",
card->name, size);
- if (NULL == (card->soft_tst = vmalloc(size))) {
+ card->soft_tst = vmalloc(size);
+ if (!card->soft_tst) {
printk("%s: memory allocation failure.\n", card->name);
deinit_card(card);
return -1;
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index cbe15a8..5cec592 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -1457,10 +1457,9 @@ static int __devinit vcc_table_allocate(struct lanai_dev *lanai)
return (lanai->vccs == NULL) ? -ENOMEM : 0;
#else
int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *);
- lanai->vccs = (struct lanai_vcc **) vmalloc(bytes);
+ lanai->vccs = vzalloc(bytes);
if (unlikely(lanai->vccs == NULL))
return -ENOMEM;
- memset(lanai->vccs, 0, bytes);
return 0;
#endif
}
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 08/49] drivers/block: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (10 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Lars Ellenberg, drbd-user, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/block/drbd/drbd_bitmap.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c
index fd42832..09e8cfc 100644
--- a/drivers/block/drbd/drbd_bitmap.c
+++ b/drivers/block/drbd/drbd_bitmap.c
@@ -250,15 +250,14 @@ static struct page **bm_realloc_pages(struct drbd_bitmap *b, unsigned long want)
* thread. As we have no disk yet, we are not in the IO path,
* not even the IO path of the peer. */
bytes = sizeof(struct page *)*want;
- new_pages = kmalloc(bytes, GFP_KERNEL);
+ new_pages = kzalloc(bytes, GFP_KERNEL);
if (!new_pages) {
- new_pages = vmalloc(bytes);
+ new_pages = vzalloc(bytes);
if (!new_pages)
return NULL;
vmalloced = 1;
}
- memset(new_pages, 0, bytes);
if (want >= have) {
for (i = 0; i < have; i++)
new_pages[i] = old_pages[i];
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 09/49] drivers/char: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (11 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: David Airlie, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/char/agp/backend.c | 3 +--
drivers/char/mspec.c | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index f27d0d0..4b71647 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -171,7 +171,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
}
got_gatt = 1;
- bridge->key_list = vmalloc(PAGE_SIZE * 4);
+ bridge->key_list = vzalloc(PAGE_SIZE * 4);
if (bridge->key_list == NULL) {
dev_err(&bridge->dev->dev,
"can't allocate memory for key lists\n");
@@ -181,7 +181,6 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
got_keylist = 1;
/* FIXME vmalloc'd memory not guaranteed contiguous */
- memset(bridge->key_list, 0, PAGE_SIZE * 4);
if (bridge->driver->configure()) {
dev_err(&bridge->dev->dev, "error configuring host chipset\n");
diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c
index 966a95b..25d139c 100644
--- a/drivers/char/mspec.c
+++ b/drivers/char/mspec.c
@@ -271,14 +271,13 @@ mspec_mmap(struct file *file, struct vm_area_struct *vma,
pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
vdata_size = sizeof(struct vma_data) + pages * sizeof(long);
if (vdata_size <= PAGE_SIZE)
- vdata = kmalloc(vdata_size, GFP_KERNEL);
+ vdata = kzalloc(vdata_size, GFP_KERNEL);
else {
- vdata = vmalloc(vdata_size);
+ vdata = vzalloc(vdata_size);
flags = VMD_VMALLOCED;
}
if (!vdata)
return -ENOMEM;
- memset(vdata, 0, vdata_size);
vdata->vm_start = vma->vm_start;
vdata->vm_end = vma->vm_end;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 10/49] drivers/gpu: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: David Airlie, dri-devel, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/gpu/drm/via/via_dmablit.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c
index 9b5b4d9..3e038a3 100644
--- a/drivers/gpu/drm/via/via_dmablit.c
+++ b/drivers/gpu/drm/via/via_dmablit.c
@@ -235,9 +235,9 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer)
vsg->num_pages = VIA_PFN(xfer->mem_addr + (xfer->num_lines * xfer->mem_stride - 1)) -
first_pfn + 1;
- if (NULL == (vsg->pages = vmalloc(sizeof(struct page *) * vsg->num_pages)))
+ vsg->pages = vzalloc(sizeof(struct page *) * vsg->num_pages);
+ if (NULL == vsg->pages)
return -ENOMEM;
- memset(vsg->pages, 0, sizeof(struct page *) * vsg->num_pages);
down_read(¤t->mm->mmap_sem);
ret = get_user_pages(current, current->mm,
(unsigned long)xfer->mem_addr,
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 10/49] drivers/gpu: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-kernel, dri-devel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/gpu/drm/via/via_dmablit.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c
index 9b5b4d9..3e038a3 100644
--- a/drivers/gpu/drm/via/via_dmablit.c
+++ b/drivers/gpu/drm/via/via_dmablit.c
@@ -235,9 +235,9 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer)
vsg->num_pages = VIA_PFN(xfer->mem_addr + (xfer->num_lines * xfer->mem_stride - 1)) -
first_pfn + 1;
- if (NULL == (vsg->pages = vmalloc(sizeof(struct page *) * vsg->num_pages)))
+ vsg->pages = vzalloc(sizeof(struct page *) * vsg->num_pages);
+ if (NULL == vsg->pages)
return -ENOMEM;
- memset(vsg->pages, 0, sizeof(struct page *) * vsg->num_pages);
down_read(¤t->mm->mmap_sem);
ret = get_user_pages(current, current->mm,
(unsigned long)xfer->mem_addr,
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 10/49] drivers/gpu: Use vzalloc
2010-11-05 3:07 ` Joe Perches
(?)
@ 2010-11-05 9:29 ` Thomas Hellstrom
-1 siblings, 0 replies; 153+ messages in thread
From: Thomas Hellstrom @ 2010-11-05 9:29 UTC (permalink / raw)
To: Joe Perches; +Cc: Jiri Kosina, linux-kernel, dri-devel
On 11/05/2010 04:07 AM, Joe Perches wrote:
> Signed-off-by: Joe Perches<joe@perches.com>
>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
> ---
> drivers/gpu/drm/via/via_dmablit.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c
> index 9b5b4d9..3e038a3 100644
> --- a/drivers/gpu/drm/via/via_dmablit.c
> +++ b/drivers/gpu/drm/via/via_dmablit.c
> @@ -235,9 +235,9 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer)
> vsg->num_pages = VIA_PFN(xfer->mem_addr + (xfer->num_lines * xfer->mem_stride - 1)) -
> first_pfn + 1;
>
> - if (NULL == (vsg->pages = vmalloc(sizeof(struct page *) * vsg->num_pages)))
> + vsg->pages = vzalloc(sizeof(struct page *) * vsg->num_pages);
> + if (NULL == vsg->pages)
> return -ENOMEM;
> - memset(vsg->pages, 0, sizeof(struct page *) * vsg->num_pages);
> down_read(¤t->mm->mmap_sem);
> ret = get_user_pages(current, current->mm,
> (unsigned long)xfer->mem_addr,
>
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 11/49] drivers/hid: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (13 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Jiri Kosina, linux-input, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/hid/hid-core.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 515345b..3fd8e5a 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -652,13 +652,12 @@ int hid_parse_report(struct hid_device *device, __u8 *start,
return -ENOMEM;
device->rsize = size;
- parser = vmalloc(sizeof(struct hid_parser));
+ parser = vzalloc(sizeof(struct hid_parser));
if (!parser) {
ret = -ENOMEM;
goto err;
}
- memset(parser, 0, sizeof(struct hid_parser));
parser->device = device;
end = start + size;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 13/49] drivers/isdn: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (14 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Karsten Keil, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/isdn/i4l/isdn_common.c | 4 ++--
drivers/isdn/mISDN/dsp_core.c | 3 +--
drivers/isdn/mISDN/l1oip_codec.c | 6 ++----
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 15632bd..2601d5c 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -2315,11 +2315,11 @@ static int __init isdn_init(void)
int i;
char tmprev[50];
- if (!(dev = vmalloc(sizeof(isdn_dev)))) {
+ dev = vzalloc(sizeof(isdn_dev));
+ if (!dev) {
printk(KERN_WARNING "isdn: Could not allocate device-struct.\n");
return -EIO;
}
- memset((char *) dev, 0, sizeof(isdn_dev));
init_timer(&dev->timer);
dev->timer.function = isdn_timer_funct;
spin_lock_init(&dev->lock);
diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c
index 6f5b548..a255de5 100644
--- a/drivers/isdn/mISDN/dsp_core.c
+++ b/drivers/isdn/mISDN/dsp_core.c
@@ -1052,12 +1052,11 @@ dspcreate(struct channel_req *crq)
if (crq->protocol != ISDN_P_B_L2DSP
&& crq->protocol != ISDN_P_B_L2DSPHDLC)
return -EPROTONOSUPPORT;
- ndsp = vmalloc(sizeof(struct dsp));
+ ndsp = vzalloc(sizeof(struct dsp));
if (!ndsp) {
printk(KERN_ERR "%s: vmalloc struct dsp failed\n", __func__);
return -ENOMEM;
}
- memset(ndsp, 0, sizeof(struct dsp));
if (dsp_debug & DEBUG_DSP_CTRL)
printk(KERN_DEBUG "%s: creating new dsp instance\n", __func__);
diff --git a/drivers/isdn/mISDN/l1oip_codec.c b/drivers/isdn/mISDN/l1oip_codec.c
index bbfd1b8..5a89972 100644
--- a/drivers/isdn/mISDN/l1oip_codec.c
+++ b/drivers/isdn/mISDN/l1oip_codec.c
@@ -330,14 +330,12 @@ l1oip_4bit_alloc(int ulaw)
return 0;
/* alloc conversion tables */
- table_com = vmalloc(65536);
- table_dec = vmalloc(512);
+ table_com = vzalloc(65536);
+ table_dec = vzalloc(512);
if (!table_com || !table_dec) {
l1oip_4bit_free();
return -ENOMEM;
}
- memset(table_com, 0, 65536);
- memset(table_dec, 0, 512);
/* generate compression table */
i1 = 0;
while (i1 < 256) {
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 14/49] drivers/md: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-raid, dm-devel, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/md/dm-log.c | 3 +--
drivers/md/dm-snap-persistent.c | 3 +--
drivers/md/dm-table.c | 4 +---
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index 33420e6..8f00e38 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -487,7 +487,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
memset(lc->sync_bits, (sync == NOSYNC) ? -1 : 0, bitset_size);
lc->sync_count = (sync == NOSYNC) ? region_count : 0;
- lc->recovering_bits = vmalloc(bitset_size);
+ lc->recovering_bits = vzalloc(bitset_size);
if (!lc->recovering_bits) {
DMWARN("couldn't allocate sync bitset");
vfree(lc->sync_bits);
@@ -499,7 +499,6 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
kfree(lc);
return -ENOMEM;
}
- memset(lc->recovering_bits, 0, bitset_size);
lc->sync_search = 0;
log->context = lc;
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
index 2129cdb..8eb943f 100644
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -174,10 +174,9 @@ static int alloc_area(struct pstore *ps)
if (!ps->area)
goto err_area;
- ps->zero_area = vmalloc(len);
+ ps->zero_area = vzalloc(len);
if (!ps->zero_area)
goto err_zero_area;
- memset(ps->zero_area, 0, len);
ps->header_area = vmalloc(len);
if (!ps->header_area)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 90267f8..d6a91f7 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -151,9 +151,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size)
return NULL;
size = nmemb * elem_size;
- addr = vmalloc(size);
- if (addr)
- memset(addr, 0, size);
+ addr = vzalloc(size);
return addr;
}
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 14/49] drivers/md: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Neil Brown, dm-devel, linux-raid, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/md/dm-log.c | 3 +--
drivers/md/dm-snap-persistent.c | 3 +--
drivers/md/dm-table.c | 4 +---
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index 33420e6..8f00e38 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -487,7 +487,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
memset(lc->sync_bits, (sync == NOSYNC) ? -1 : 0, bitset_size);
lc->sync_count = (sync == NOSYNC) ? region_count : 0;
- lc->recovering_bits = vmalloc(bitset_size);
+ lc->recovering_bits = vzalloc(bitset_size);
if (!lc->recovering_bits) {
DMWARN("couldn't allocate sync bitset");
vfree(lc->sync_bits);
@@ -499,7 +499,6 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
kfree(lc);
return -ENOMEM;
}
- memset(lc->recovering_bits, 0, bitset_size);
lc->sync_search = 0;
log->context = lc;
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
index 2129cdb..8eb943f 100644
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -174,10 +174,9 @@ static int alloc_area(struct pstore *ps)
if (!ps->area)
goto err_area;
- ps->zero_area = vmalloc(len);
+ ps->zero_area = vzalloc(len);
if (!ps->zero_area)
goto err_zero_area;
- memset(ps->zero_area, 0, len);
ps->header_area = vmalloc(len);
if (!ps->header_area)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 90267f8..d6a91f7 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -151,9 +151,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size)
return NULL;
size = nmemb * elem_size;
- addr = vmalloc(size);
- if (addr)
- memset(addr, 0, size);
+ addr = vzalloc(size);
return addr;
}
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 14/49] drivers/md: Use vzalloc
2010-11-05 3:07 ` Joe Perches
(?)
@ 2011-01-17 20:28 ` Mike Snitzer
-1 siblings, 0 replies; 153+ messages in thread
From: Mike Snitzer @ 2011-01-17 20:28 UTC (permalink / raw)
To: Joe Perches; +Cc: device-mapper development, Jiri Kosina
On Thu, Nov 04 2010 at 11:07pm -0400,
Joe Perches <joe@perches.com> wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
Subject for final commit should be: "dm: Use vzalloc"
Original patch may be referenced here:
https://patchwork.kernel.org/patch/303242/mbox/
Acked-by: Mike Snitzer <snitzer@redhat.com>
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 15/49] drivers/media: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (16 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/media/dvb/ngene/ngene-core.c | 3 +--
drivers/media/video/mx3_camera.c | 3 +--
drivers/media/video/pwc/pwc-if.c | 3 +--
drivers/media/video/videobuf-dma-sg.c | 3 +--
4 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c
index 4caeb16..1abc3a0 100644
--- a/drivers/media/dvb/ngene/ngene-core.c
+++ b/drivers/media/dvb/ngene/ngene-core.c
@@ -1537,12 +1537,11 @@ int __devinit ngene_probe(struct pci_dev *pci_dev,
if (pci_enable_device(pci_dev) < 0)
return -ENODEV;
- dev = vmalloc(sizeof(struct ngene));
+ dev = vzalloc(sizeof(struct ngene));
if (dev == NULL) {
stat = -ENOMEM;
goto fail0;
}
- memset(dev, 0, sizeof(struct ngene));
dev->pci_dev = pci_dev;
dev->card_info = (struct ngene_info *)id->driver_data;
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index 29c5fc3..321c3e5 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -1182,13 +1182,12 @@ static int __devinit mx3_camera_probe(struct platform_device *pdev)
goto egetres;
}
- mx3_cam = vmalloc(sizeof(*mx3_cam));
+ mx3_cam = vzalloc(sizeof(*mx3_cam));
if (!mx3_cam) {
dev_err(&pdev->dev, "Could not allocate mx3 camera object\n");
err = -ENOMEM;
goto ealloc;
}
- memset(mx3_cam, 0, sizeof(*mx3_cam));
mx3_cam->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(mx3_cam->clk)) {
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index e62beb4..fc5f02e 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -288,14 +288,13 @@ static int pwc_allocate_buffers(struct pwc_device *pdev)
/* create frame buffers, and make circular ring */
for (i = 0; i < default_fbufs; i++) {
if (pdev->fbuf[i].data == NULL) {
- kbuf = vmalloc(PWC_FRAME_SIZE); /* need vmalloc since frame buffer > 128K */
+ kbuf = vzalloc(PWC_FRAME_SIZE); /* need vmalloc since frame buffer > 128K */
if (kbuf == NULL) {
PWC_ERROR("Failed to allocate frame buffer %d.\n", i);
return -ENOMEM;
}
PWC_DEBUG_MEMORY("Allocated frame buffer %d at %p.\n", i, kbuf);
pdev->fbuf[i].data = kbuf;
- memset(kbuf, 0, PWC_FRAME_SIZE);
}
}
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c
index 20f227e..ab684e8 100644
--- a/drivers/media/video/videobuf-dma-sg.c
+++ b/drivers/media/video/videobuf-dma-sg.c
@@ -69,10 +69,9 @@ static struct scatterlist *videobuf_vmalloc_to_sg(unsigned char *virt,
struct page *pg;
int i;
- sglist = vmalloc(nr_pages * sizeof(*sglist));
+ sglist = vzalloc(nr_pages * sizeof(*sglist));
if (NULL == sglist)
return NULL;
- memset(sglist, 0, nr_pages * sizeof(*sglist));
sg_init_table(sglist, nr_pages);
for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) {
pg = vmalloc_to_page(virt);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 16/49] drivers/mtd: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: David Woodhouse, Artem Bityutskiy, linux-mtd, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/mtd/nand/nandsim.c | 3 +--
drivers/mtd/ubi/vtbl.c | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index a6a73aa..b3d241b 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -470,7 +470,7 @@ static int alloc_device(struct nandsim *ns)
err = -EINVAL;
goto err_close;
}
- ns->pages_written = vmalloc(ns->geom.pgnum);
+ ns->pages_written = vzalloc(ns->geom.pgnum);
if (!ns->pages_written) {
NS_ERR("alloc_device: unable to allocate pages written array\n");
err = -ENOMEM;
@@ -483,7 +483,6 @@ static int alloc_device(struct nandsim *ns)
goto err_free;
}
ns->cfile = cfile;
- memset(ns->pages_written, 0, ns->geom.pgnum);
return 0;
}
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index fcdb7f6..0b8141f 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -425,12 +425,11 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
/* Read both LEB 0 and LEB 1 into memory */
ubi_rb_for_each_entry(rb, seb, &sv->root, u.rb) {
- leb[seb->lnum] = vmalloc(ubi->vtbl_size);
+ leb[seb->lnum] = vzalloc(ubi->vtbl_size);
if (!leb[seb->lnum]) {
err = -ENOMEM;
goto out_free;
}
- memset(leb[seb->lnum], 0, ubi->vtbl_size);
err = ubi_io_read_data(ubi, leb[seb->lnum], seb->pnum, 0,
ubi->vtbl_size);
@@ -516,10 +515,9 @@ static struct ubi_vtbl_record *create_empty_lvol(struct ubi_device *ubi,
int i;
struct ubi_vtbl_record *vtbl;
- vtbl = vmalloc(ubi->vtbl_size);
+ vtbl = vzalloc(ubi->vtbl_size);
if (!vtbl)
return ERR_PTR(-ENOMEM);
- memset(vtbl, 0, ubi->vtbl_size);
for (i = 0; i < ubi->vtbl_slots; i++)
memcpy(&vtbl[i], &empty_vtbl_record, UBI_VTBL_RECORD_SIZE);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 16/49] drivers/mtd: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-mtd, David Woodhouse, linux-kernel, Artem Bityutskiy
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/mtd/nand/nandsim.c | 3 +--
drivers/mtd/ubi/vtbl.c | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index a6a73aa..b3d241b 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -470,7 +470,7 @@ static int alloc_device(struct nandsim *ns)
err = -EINVAL;
goto err_close;
}
- ns->pages_written = vmalloc(ns->geom.pgnum);
+ ns->pages_written = vzalloc(ns->geom.pgnum);
if (!ns->pages_written) {
NS_ERR("alloc_device: unable to allocate pages written array\n");
err = -ENOMEM;
@@ -483,7 +483,6 @@ static int alloc_device(struct nandsim *ns)
goto err_free;
}
ns->cfile = cfile;
- memset(ns->pages_written, 0, ns->geom.pgnum);
return 0;
}
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index fcdb7f6..0b8141f 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -425,12 +425,11 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
/* Read both LEB 0 and LEB 1 into memory */
ubi_rb_for_each_entry(rb, seb, &sv->root, u.rb) {
- leb[seb->lnum] = vmalloc(ubi->vtbl_size);
+ leb[seb->lnum] = vzalloc(ubi->vtbl_size);
if (!leb[seb->lnum]) {
err = -ENOMEM;
goto out_free;
}
- memset(leb[seb->lnum], 0, ubi->vtbl_size);
err = ubi_io_read_data(ubi, leb[seb->lnum], seb->pnum, 0,
ubi->vtbl_size);
@@ -516,10 +515,9 @@ static struct ubi_vtbl_record *create_empty_lvol(struct ubi_device *ubi,
int i;
struct ubi_vtbl_record *vtbl;
- vtbl = vmalloc(ubi->vtbl_size);
+ vtbl = vzalloc(ubi->vtbl_size);
if (!vtbl)
return ERR_PTR(-ENOMEM);
- memset(vtbl, 0, ubi->vtbl_size);
for (i = 0; i < ubi->vtbl_slots; i++)
memcpy(&vtbl[i], &empty_vtbl_record, UBI_VTBL_RECORD_SIZE);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 16/49] drivers/mtd: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-13 11:19 ` Artem Bityutskiy
-1 siblings, 0 replies; 153+ messages in thread
From: Artem Bityutskiy @ 2010-11-13 11:19 UTC (permalink / raw)
To: Joe Perches; +Cc: Jiri Kosina, David Woodhouse, linux-mtd, linux-kernel
On Thu, 2010-11-04 at 20:07 -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/mtd/nand/nandsim.c | 3 +--
> drivers/mtd/ubi/vtbl.c | 6 ++----
> 2 files changed, 3 insertions(+), 6 deletions(-)
Pushed to l2-mtd-2.6.git, thanks.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 16/49] drivers/mtd: Use vzalloc
@ 2010-11-13 11:19 ` Artem Bityutskiy
0 siblings, 0 replies; 153+ messages in thread
From: Artem Bityutskiy @ 2010-11-13 11:19 UTC (permalink / raw)
To: Joe Perches; +Cc: David Woodhouse, Jiri Kosina, linux-kernel, linux-mtd
On Thu, 2010-11-04 at 20:07 -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/mtd/nand/nandsim.c | 3 +--
> drivers/mtd/ubi/vtbl.c | 6 ++----
> 2 files changed, 3 insertions(+), 6 deletions(-)
Pushed to l2-mtd-2.6.git, thanks.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 17/49] drivers/net/cxgb3: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (18 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Divy Le Ray, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/cxgb3/cxgb3_offload.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index bcf0753..5e632e2 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -1164,12 +1164,11 @@ static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
*/
void *cxgb_alloc_mem(unsigned long size)
{
- void *p = kmalloc(size, GFP_KERNEL);
+ void *p = kzalloc(size, GFP_KERNEL);
if (!p)
- p = vmalloc(size);
- if (p)
- memset(p, 0, size);
+ p = vzalloc(size);
+
return p;
}
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 18/49] drivers/net/cxgb4: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (19 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Dimitris Michailidis, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/cxgb4/cxgb4_main.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index f17703f..b7758ce 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -868,12 +868,11 @@ out: release_firmware(fw);
*/
void *t4_alloc_mem(size_t size)
{
- void *p = kmalloc(size, GFP_KERNEL);
+ void *p = kzalloc(size, GFP_KERNEL);
if (!p)
- p = vmalloc(size);
- if (p)
- memset(p, 0, size);
+ p = vzalloc(size);
+
return p;
}
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 19/49] drivers/net/e1000: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, PJ Waskiewicz, Alex Duyck, John Ronciak,
e1000-devel, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/e1000/e1000_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4686c39..dcb7f82 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1425,13 +1425,12 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
int size;
size = sizeof(struct e1000_buffer) * txdr->count;
- txdr->buffer_info = vmalloc(size);
+ txdr->buffer_info = vzalloc(size);
if (!txdr->buffer_info) {
e_err(probe, "Unable to allocate memory for the Tx descriptor "
"ring\n");
return -ENOMEM;
}
- memset(txdr->buffer_info, 0, size);
/* round up to nearest 4K */
@@ -1621,13 +1620,12 @@ static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
int size, desc_len;
size = sizeof(struct e1000_buffer) * rxdr->count;
- rxdr->buffer_info = vmalloc(size);
+ rxdr->buffer_info = vzalloc(size);
if (!rxdr->buffer_info) {
e_err(probe, "Unable to allocate memory for the Rx descriptor "
"ring\n");
return -ENOMEM;
}
- memset(rxdr->buffer_info, 0, size);
desc_len = sizeof(struct e1000_rx_desc);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 19/49] drivers/net/e1000: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/e1000/e1000_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4686c39..dcb7f82 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1425,13 +1425,12 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
int size;
size = sizeof(struct e1000_buffer) * txdr->count;
- txdr->buffer_info = vmalloc(size);
+ txdr->buffer_info = vzalloc(size);
if (!txdr->buffer_info) {
e_err(probe, "Unable to allocate memory for the Tx descriptor "
"ring\n");
return -ENOMEM;
}
- memset(txdr->buffer_info, 0, size);
/* round up to nearest 4K */
@@ -1621,13 +1620,12 @@ static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
int size, desc_len;
size = sizeof(struct e1000_buffer) * rxdr->count;
- rxdr->buffer_info = vmalloc(size);
+ rxdr->buffer_info = vzalloc(size);
if (!rxdr->buffer_info) {
e_err(probe, "Unable to allocate memory for the Rx descriptor "
"ring\n");
return -ENOMEM;
}
- memset(rxdr->buffer_info, 0, size);
desc_len = sizeof(struct e1000_rx_desc);
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 20/49] drivers/net/e1000e: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, PJ Waskiewicz, Alex Duyck, John Ronciak,
e1000-devel, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/e1000e/netdev.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index c4ca162..9922edb 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2059,10 +2059,9 @@ int e1000e_setup_tx_resources(struct e1000_adapter *adapter)
int err = -ENOMEM, size;
size = sizeof(struct e1000_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info)
goto err;
- memset(tx_ring->buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(struct e1000_tx_desc);
@@ -2095,10 +2094,9 @@ int e1000e_setup_rx_resources(struct e1000_adapter *adapter)
int i, size, desc_len, err = -ENOMEM;
size = sizeof(struct e1000_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info)
goto err;
- memset(rx_ring->buffer_info, 0, size);
for (i = 0; i < rx_ring->count; i++) {
buffer_info = &rx_ring->buffer_info[i];
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 20/49] drivers/net/e1000e: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/e1000e/netdev.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index c4ca162..9922edb 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2059,10 +2059,9 @@ int e1000e_setup_tx_resources(struct e1000_adapter *adapter)
int err = -ENOMEM, size;
size = sizeof(struct e1000_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info)
goto err;
- memset(tx_ring->buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(struct e1000_tx_desc);
@@ -2095,10 +2094,9 @@ int e1000e_setup_rx_resources(struct e1000_adapter *adapter)
int i, size, desc_len, err = -ENOMEM;
size = sizeof(struct e1000_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info)
goto err;
- memset(rx_ring->buffer_info, 0, size);
for (i = 0; i < rx_ring->count; i++) {
buffer_info = &rx_ring->buffer_info[i];
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 21/49] drivers/net/ehea: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (22 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Breno Leitao, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ehea/ehea_main.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 182b2a7..a84c389 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -1496,12 +1496,10 @@ static int ehea_init_q_skba(struct ehea_q_skb_arr *q_skba, int max_q_entries)
{
int arr_size = sizeof(void *) * max_q_entries;
- q_skba->arr = vmalloc(arr_size);
+ q_skba->arr = vzalloc(arr_size);
if (!q_skba->arr)
return -ENOMEM;
- memset(q_skba->arr, 0, arr_size);
-
q_skba->len = max_q_entries;
q_skba->index = 0;
q_skba->os_skbs = 0;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 22/49] drivers/net/igb: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, PJ Waskiewicz, Alex Duyck, John Ronciak,
e1000-devel, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/igb/igb_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 892d196..67ea262 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2436,10 +2436,9 @@ int igb_setup_tx_resources(struct igb_ring *tx_ring)
int size;
size = sizeof(struct igb_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info)
goto err;
- memset(tx_ring->buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
@@ -2587,10 +2586,9 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
int size, desc_len;
size = sizeof(struct igb_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info)
goto err;
- memset(rx_ring->buffer_info, 0, size);
desc_len = sizeof(union e1000_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 22/49] drivers/net/igb: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/igb/igb_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 892d196..67ea262 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2436,10 +2436,9 @@ int igb_setup_tx_resources(struct igb_ring *tx_ring)
int size;
size = sizeof(struct igb_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info)
goto err;
- memset(tx_ring->buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
@@ -2587,10 +2586,9 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
int size, desc_len;
size = sizeof(struct igb_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info)
goto err;
- memset(rx_ring->buffer_info, 0, size);
desc_len = sizeof(union e1000_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 23/49] drivers/net/igbvf: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, PJ Waskiewicz, Alex Duyck, John Ronciak,
e1000-devel, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/igbvf/netdev.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 28af019..08e7459 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -429,10 +429,9 @@ int igbvf_setup_tx_resources(struct igbvf_adapter *adapter,
int size;
size = sizeof(struct igbvf_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info)
goto err;
- memset(tx_ring->buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
@@ -469,10 +468,9 @@ int igbvf_setup_rx_resources(struct igbvf_adapter *adapter,
int size, desc_len;
size = sizeof(struct igbvf_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info)
goto err;
- memset(rx_ring->buffer_info, 0, size);
desc_len = sizeof(union e1000_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 23/49] drivers/net/igbvf: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/igbvf/netdev.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 28af019..08e7459 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -429,10 +429,9 @@ int igbvf_setup_tx_resources(struct igbvf_adapter *adapter,
int size;
size = sizeof(struct igbvf_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info)
goto err;
- memset(tx_ring->buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
@@ -469,10 +468,9 @@ int igbvf_setup_rx_resources(struct igbvf_adapter *adapter,
int size, desc_len;
size = sizeof(struct igbvf_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info)
goto err;
- memset(rx_ring->buffer_info, 0, size);
desc_len = sizeof(union e1000_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 153+ messages in thread
* RE: [PATCH 23/49] drivers/net/igbvf: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 11:58 ` Rose, Gregory V
-1 siblings, 0 replies; 153+ messages in thread
From: Rose, Gregory V @ 2010-11-05 11:58 UTC (permalink / raw)
To: Joe Perches, Jiri Kosina
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Allan, Bruce W, Wyborny,
Carolyn, Skidmore, Donald C, Waskiewicz Jr, Peter P, Duyck,
Alexander H, Ronciak, John, e1000-devel, netdev, linux-kernel
> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Thursday, November 04, 2010 8:08 PM
> To: Jiri Kosina
> Cc: Kirsher, Jeffrey T; Brandeburg, Jesse; Allan, Bruce W; Wyborny,
> Carolyn; Skidmore, Donald C; Rose, Gregory V; Waskiewicz Jr, Peter P;
> Duyck, Alexander H; Ronciak, John; e1000-devel@lists.sourceforge.net;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 23/49] drivers/net/igbvf: Use vzalloc
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/igbvf/netdev.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
> index 28af019..08e7459 100644
> --- a/drivers/net/igbvf/netdev.c
> +++ b/drivers/net/igbvf/netdev.c
> @@ -429,10 +429,9 @@ int igbvf_setup_tx_resources(struct igbvf_adapter
> *adapter,
> int size;
>
> size = sizeof(struct igbvf_buffer) * tx_ring->count;
> - tx_ring->buffer_info = vmalloc(size);
> + tx_ring->buffer_info = vzalloc(size);
> if (!tx_ring->buffer_info)
> goto err;
> - memset(tx_ring->buffer_info, 0, size);
>
> /* round up to nearest 4K */
> tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
> @@ -469,10 +468,9 @@ int igbvf_setup_rx_resources(struct igbvf_adapter
> *adapter,
> int size, desc_len;
>
> size = sizeof(struct igbvf_buffer) * rx_ring->count;
> - rx_ring->buffer_info = vmalloc(size);
> + rx_ring->buffer_info = vzalloc(size);
> if (!rx_ring->buffer_info)
> goto err;
> - memset(rx_ring->buffer_info, 0, size);
>
> desc_len = sizeof(union e1000_adv_rx_desc);
>
> --
> 1.7.3.1.g432b3.dirty
Acked By: Greg Rose <Gregory.v.rose@intel.com>
^ permalink raw reply [flat|nested] 153+ messages in thread
* RE: [PATCH 23/49] drivers/net/igbvf: Use vzalloc
@ 2010-11-05 11:58 ` Rose, Gregory V
0 siblings, 0 replies; 153+ messages in thread
From: Rose, Gregory V @ 2010-11-05 11:58 UTC (permalink / raw)
To: Joe Perches, Jiri Kosina
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Allan, Bruce W, Wyborny,
Carolyn, Skidmore, Donald C, Waskiewicz Jr, Peter P, Duyck,
Alexander H, Ronciak, John, e1000-devel, netdev, linux-kernel
> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Thursday, November 04, 2010 8:08 PM
> To: Jiri Kosina
> Cc: Kirsher, Jeffrey T; Brandeburg, Jesse; Allan, Bruce W; Wyborny,
> Carolyn; Skidmore, Donald C; Rose, Gregory V; Waskiewicz Jr, Peter P;
> Duyck, Alexander H; Ronciak, John; e1000-devel@lists.sourceforge.net;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 23/49] drivers/net/igbvf: Use vzalloc
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/igbvf/netdev.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
> index 28af019..08e7459 100644
> --- a/drivers/net/igbvf/netdev.c
> +++ b/drivers/net/igbvf/netdev.c
> @@ -429,10 +429,9 @@ int igbvf_setup_tx_resources(struct igbvf_adapter
> *adapter,
> int size;
>
> size = sizeof(struct igbvf_buffer) * tx_ring->count;
> - tx_ring->buffer_info = vmalloc(size);
> + tx_ring->buffer_info = vzalloc(size);
> if (!tx_ring->buffer_info)
> goto err;
> - memset(tx_ring->buffer_info, 0, size);
>
> /* round up to nearest 4K */
> tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
> @@ -469,10 +468,9 @@ int igbvf_setup_rx_resources(struct igbvf_adapter
> *adapter,
> int size, desc_len;
>
> size = sizeof(struct igbvf_buffer) * rx_ring->count;
> - rx_ring->buffer_info = vmalloc(size);
> + rx_ring->buffer_info = vzalloc(size);
> if (!rx_ring->buffer_info)
> goto err;
> - memset(rx_ring->buffer_info, 0, size);
>
> desc_len = sizeof(union e1000_adv_rx_desc);
>
> --
> 1.7.3.1.g432b3.dirty
Acked By: Greg Rose <Gregory.v.rose@intel.com>
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 24/49] drivers/net/ixgb: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, PJ Waskiewicz, Alex Duyck, John Ronciak,
e1000-devel, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ixgb/ixgb_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index caa8192..211a169 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -669,13 +669,12 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
int size;
size = sizeof(struct ixgb_buffer) * txdr->count;
- txdr->buffer_info = vmalloc(size);
+ txdr->buffer_info = vzalloc(size);
if (!txdr->buffer_info) {
netif_err(adapter, probe, adapter->netdev,
"Unable to allocate transmit descriptor ring memory\n");
return -ENOMEM;
}
- memset(txdr->buffer_info, 0, size);
/* round up to nearest 4K */
@@ -759,13 +758,12 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
int size;
size = sizeof(struct ixgb_buffer) * rxdr->count;
- rxdr->buffer_info = vmalloc(size);
+ rxdr->buffer_info = vzalloc(size);
if (!rxdr->buffer_info) {
netif_err(adapter, probe, adapter->netdev,
"Unable to allocate receive descriptor ring\n");
return -ENOMEM;
}
- memset(rxdr->buffer_info, 0, size);
/* Round up to nearest 4K */
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 24/49] drivers/net/ixgb: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ixgb/ixgb_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index caa8192..211a169 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -669,13 +669,12 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
int size;
size = sizeof(struct ixgb_buffer) * txdr->count;
- txdr->buffer_info = vmalloc(size);
+ txdr->buffer_info = vzalloc(size);
if (!txdr->buffer_info) {
netif_err(adapter, probe, adapter->netdev,
"Unable to allocate transmit descriptor ring memory\n");
return -ENOMEM;
}
- memset(txdr->buffer_info, 0, size);
/* round up to nearest 4K */
@@ -759,13 +758,12 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
int size;
size = sizeof(struct ixgb_buffer) * rxdr->count;
- rxdr->buffer_info = vmalloc(size);
+ rxdr->buffer_info = vzalloc(size);
if (!rxdr->buffer_info) {
netif_err(adapter, probe, adapter->netdev,
"Unable to allocate receive descriptor ring\n");
return -ENOMEM;
}
- memset(rxdr->buffer_info, 0, size);
/* Round up to nearest 4K */
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 25/49] drivers/net/ixgbe: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, PJ Waskiewicz, Alex Duyck, John Ronciak,
e1000-devel, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ixgbe/ixgbe_main.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 2bd3eb4..c10d179 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4970,12 +4970,11 @@ int ixgbe_setup_tx_resources(struct ixgbe_adapter *adapter,
int size;
size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count;
- tx_ring->tx_buffer_info = vmalloc_node(size, tx_ring->numa_node);
+ tx_ring->tx_buffer_info = vzalloc_node(size, tx_ring->numa_node);
if (!tx_ring->tx_buffer_info)
- tx_ring->tx_buffer_info = vmalloc(size);
+ tx_ring->tx_buffer_info = vzalloc(size);
if (!tx_ring->tx_buffer_info)
goto err;
- memset(tx_ring->tx_buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
@@ -5037,15 +5036,14 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,
int size;
size = sizeof(struct ixgbe_rx_buffer) * rx_ring->count;
- rx_ring->rx_buffer_info = vmalloc_node(size, adapter->node);
+ rx_ring->rx_buffer_info = vzalloc_node(size, adapter->node);
if (!rx_ring->rx_buffer_info)
- rx_ring->rx_buffer_info = vmalloc(size);
+ rx_ring->rx_buffer_info = vzalloc(size);
if (!rx_ring->rx_buffer_info) {
e_err(probe, "vmalloc allocation failed for the Rx "
"descriptor ring\n");
goto alloc_failed;
}
- memset(rx_ring->rx_buffer_info, 0, size);
/* Round up to nearest 4K */
rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 25/49] drivers/net/ixgbe: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ixgbe/ixgbe_main.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 2bd3eb4..c10d179 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4970,12 +4970,11 @@ int ixgbe_setup_tx_resources(struct ixgbe_adapter *adapter,
int size;
size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count;
- tx_ring->tx_buffer_info = vmalloc_node(size, tx_ring->numa_node);
+ tx_ring->tx_buffer_info = vzalloc_node(size, tx_ring->numa_node);
if (!tx_ring->tx_buffer_info)
- tx_ring->tx_buffer_info = vmalloc(size);
+ tx_ring->tx_buffer_info = vzalloc(size);
if (!tx_ring->tx_buffer_info)
goto err;
- memset(tx_ring->tx_buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
@@ -5037,15 +5036,14 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,
int size;
size = sizeof(struct ixgbe_rx_buffer) * rx_ring->count;
- rx_ring->rx_buffer_info = vmalloc_node(size, adapter->node);
+ rx_ring->rx_buffer_info = vzalloc_node(size, adapter->node);
if (!rx_ring->rx_buffer_info)
- rx_ring->rx_buffer_info = vmalloc(size);
+ rx_ring->rx_buffer_info = vzalloc(size);
if (!rx_ring->rx_buffer_info) {
e_err(probe, "vmalloc allocation failed for the Rx "
"descriptor ring\n");
goto alloc_failed;
}
- memset(rx_ring->rx_buffer_info, 0, size);
/* Round up to nearest 4K */
rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 26/49] drivers/net/ixgbevf: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, PJ Waskiewicz, Alex Duyck, John Ronciak,
e1000-devel, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ixgbevf/ixgbevf_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index dc03c96..6aeaf54 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -2488,10 +2488,9 @@ int ixgbevf_setup_tx_resources(struct ixgbevf_adapter *adapter,
int size;
size = sizeof(struct ixgbevf_tx_buffer) * tx_ring->count;
- tx_ring->tx_buffer_info = vmalloc(size);
+ tx_ring->tx_buffer_info = vzalloc(size);
if (!tx_ring->tx_buffer_info)
goto err;
- memset(tx_ring->tx_buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
@@ -2555,14 +2554,13 @@ int ixgbevf_setup_rx_resources(struct ixgbevf_adapter *adapter,
int size;
size = sizeof(struct ixgbevf_rx_buffer) * rx_ring->count;
- rx_ring->rx_buffer_info = vmalloc(size);
+ rx_ring->rx_buffer_info = vzalloc(size);
if (!rx_ring->rx_buffer_info) {
hw_dbg(&adapter->hw,
"Unable to vmalloc buffer memory for "
"the receive descriptor ring\n");
goto alloc_failed;
}
- memset(rx_ring->rx_buffer_info, 0, size);
/* Round up to nearest 4K */
rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 26/49] drivers/net/ixgbevf: Use vzalloc
@ 2010-11-05 3:07 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ixgbevf/ixgbevf_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index dc03c96..6aeaf54 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -2488,10 +2488,9 @@ int ixgbevf_setup_tx_resources(struct ixgbevf_adapter *adapter,
int size;
size = sizeof(struct ixgbevf_tx_buffer) * tx_ring->count;
- tx_ring->tx_buffer_info = vmalloc(size);
+ tx_ring->tx_buffer_info = vzalloc(size);
if (!tx_ring->tx_buffer_info)
goto err;
- memset(tx_ring->tx_buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
@@ -2555,14 +2554,13 @@ int ixgbevf_setup_rx_resources(struct ixgbevf_adapter *adapter,
int size;
size = sizeof(struct ixgbevf_rx_buffer) * rx_ring->count;
- rx_ring->rx_buffer_info = vmalloc(size);
+ rx_ring->rx_buffer_info = vzalloc(size);
if (!rx_ring->rx_buffer_info) {
hw_dbg(&adapter->hw,
"Unable to vmalloc buffer memory for "
"the receive descriptor ring\n");
goto alloc_failed;
}
- memset(rx_ring->rx_buffer_info, 0, size);
/* Round up to nearest 4K */
rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 153+ messages in thread
* RE: [PATCH 26/49] drivers/net/ixgbevf: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 11:59 ` Rose, Gregory V
-1 siblings, 0 replies; 153+ messages in thread
From: Rose, Gregory V @ 2010-11-05 11:59 UTC (permalink / raw)
To: Joe Perches, Jiri Kosina
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Allan, Bruce W, Wyborny,
Carolyn, Skidmore, Donald C, Waskiewicz Jr, Peter P, Duyck,
Alexander H, Ronciak, John, e1000-devel, netdev, linux-kernel
> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Thursday, November 04, 2010 8:08 PM
> To: Jiri Kosina
> Cc: Kirsher, Jeffrey T; Brandeburg, Jesse; Allan, Bruce W; Wyborny,
> Carolyn; Skidmore, Donald C; Rose, Gregory V; Waskiewicz Jr, Peter P;
> Duyck, Alexander H; Ronciak, John; e1000-devel@lists.sourceforge.net;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 26/49] drivers/net/ixgbevf: Use vzalloc
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/ixgbevf/ixgbevf_main.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ixgbevf/ixgbevf_main.c
> b/drivers/net/ixgbevf/ixgbevf_main.c
> index dc03c96..6aeaf54 100644
> --- a/drivers/net/ixgbevf/ixgbevf_main.c
> +++ b/drivers/net/ixgbevf/ixgbevf_main.c
> @@ -2488,10 +2488,9 @@ int ixgbevf_setup_tx_resources(struct
> ixgbevf_adapter *adapter,
> int size;
>
> size = sizeof(struct ixgbevf_tx_buffer) * tx_ring->count;
> - tx_ring->tx_buffer_info = vmalloc(size);
> + tx_ring->tx_buffer_info = vzalloc(size);
> if (!tx_ring->tx_buffer_info)
> goto err;
> - memset(tx_ring->tx_buffer_info, 0, size);
>
> /* round up to nearest 4K */
> tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
> @@ -2555,14 +2554,13 @@ int ixgbevf_setup_rx_resources(struct
> ixgbevf_adapter *adapter,
> int size;
>
> size = sizeof(struct ixgbevf_rx_buffer) * rx_ring->count;
> - rx_ring->rx_buffer_info = vmalloc(size);
> + rx_ring->rx_buffer_info = vzalloc(size);
> if (!rx_ring->rx_buffer_info) {
> hw_dbg(&adapter->hw,
> "Unable to vmalloc buffer memory for "
> "the receive descriptor ring\n");
> goto alloc_failed;
> }
> - memset(rx_ring->rx_buffer_info, 0, size);
>
> /* Round up to nearest 4K */
> rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
> --
> 1.7.3.1.g432b3.dirty
Acked By: Greg Rose <Gregory.v.rose@intel.com>
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 26/49] drivers/net/ixgbevf: Use vzalloc
@ 2010-11-05 11:59 ` Rose, Gregory V
0 siblings, 0 replies; 153+ messages in thread
From: Rose, Gregory V @ 2010-11-05 11:59 UTC (permalink / raw)
To: Joe Perches, Jiri Kosina
Cc: e1000-devel, Allan, Bruce W, Brandeburg, Jesse, linux-kernel,
Ronciak, John, Kirsher, Jeffrey T, netdev
> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Thursday, November 04, 2010 8:08 PM
> To: Jiri Kosina
> Cc: Kirsher, Jeffrey T; Brandeburg, Jesse; Allan, Bruce W; Wyborny,
> Carolyn; Skidmore, Donald C; Rose, Gregory V; Waskiewicz Jr, Peter P;
> Duyck, Alexander H; Ronciak, John; e1000-devel@lists.sourceforge.net;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 26/49] drivers/net/ixgbevf: Use vzalloc
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/ixgbevf/ixgbevf_main.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ixgbevf/ixgbevf_main.c
> b/drivers/net/ixgbevf/ixgbevf_main.c
> index dc03c96..6aeaf54 100644
> --- a/drivers/net/ixgbevf/ixgbevf_main.c
> +++ b/drivers/net/ixgbevf/ixgbevf_main.c
> @@ -2488,10 +2488,9 @@ int ixgbevf_setup_tx_resources(struct
> ixgbevf_adapter *adapter,
> int size;
>
> size = sizeof(struct ixgbevf_tx_buffer) * tx_ring->count;
> - tx_ring->tx_buffer_info = vmalloc(size);
> + tx_ring->tx_buffer_info = vzalloc(size);
> if (!tx_ring->tx_buffer_info)
> goto err;
> - memset(tx_ring->tx_buffer_info, 0, size);
>
> /* round up to nearest 4K */
> tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
> @@ -2555,14 +2554,13 @@ int ixgbevf_setup_rx_resources(struct
> ixgbevf_adapter *adapter,
> int size;
>
> size = sizeof(struct ixgbevf_rx_buffer) * rx_ring->count;
> - rx_ring->rx_buffer_info = vmalloc(size);
> + rx_ring->rx_buffer_info = vzalloc(size);
> if (!rx_ring->rx_buffer_info) {
> hw_dbg(&adapter->hw,
> "Unable to vmalloc buffer memory for "
> "the receive descriptor ring\n");
> goto alloc_failed;
> }
> - memset(rx_ring->rx_buffer_info, 0, size);
>
> /* Round up to nearest 4K */
> rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
> --
> 1.7.3.1.g432b3.dirty
Acked By: Greg Rose <Gregory.v.rose@intel.com>
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 27/49] drivers/net/netxen: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (28 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
2010-11-05 5:18 ` Amit Salecha
-1 siblings, 1 reply; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Amit Kumar Salecha, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/netxen/netxen_nic_init.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 95fe552..731077d 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -214,13 +214,12 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
tx_ring->num_desc = adapter->num_txd;
tx_ring->txq = netdev_get_tx_queue(netdev, 0);
- cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring));
+ cmd_buf_arr = vzalloc(TX_BUFF_RINGSIZE(tx_ring));
if (cmd_buf_arr == NULL) {
dev_err(&pdev->dev, "%s: failed to allocate cmd buffer ring\n",
netdev->name);
goto err_out;
}
- memset(cmd_buf_arr, 0, TX_BUFF_RINGSIZE(tx_ring));
tx_ring->cmd_buf_arr = cmd_buf_arr;
recv_ctx = &adapter->recv_ctx;
@@ -279,8 +278,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
break;
}
- rds_ring->rx_buf_arr = (struct netxen_rx_buffer *)
- vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
+ rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
if (rds_ring->rx_buf_arr == NULL) {
printk(KERN_ERR "%s: Failed to allocate "
"rx buffer ring %d\n",
@@ -288,7 +286,6 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
/* free whatever was already allocated */
goto err_out;
}
- memset(rds_ring->rx_buf_arr, 0, RCV_BUFF_RINGSIZE(rds_ring));
INIT_LIST_HEAD(&rds_ring->free_list);
/*
* Now go through all of them, set reference handles
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* RE: [PATCH 27/49] drivers/net/netxen: Use vzalloc
2010-11-05 3:07 ` [PATCH 27/49] drivers/net/netxen: " Joe Perches
@ 2010-11-05 5:18 ` Amit Salecha
0 siblings, 0 replies; 153+ messages in thread
From: Amit Salecha @ 2010-11-05 5:18 UTC (permalink / raw)
To: Joe Perches, Jiri Kosina; +Cc: netdev, linux-kernel
> From: Joe Perches [joe@perches.com]
> Sent: Friday, November 05, 2010 8:37 AM
> To: Jiri Kosina
> Cc: Amit Salecha; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 27/49] drivers/net/netxen: Use vzalloc
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/netxen/netxen_nic_init.c | 7 ++-----
> files changed, 2 insertions(+), 5 deletions(-)
Thanks.
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 28/49] drivers/net/pch_gbe: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (29 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/pch_gbe/pch_gbe_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c
index 472056b..afb7506 100644
--- a/drivers/net/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/pch_gbe/pch_gbe_main.c
@@ -1523,12 +1523,11 @@ int pch_gbe_setup_tx_resources(struct pch_gbe_adapter *adapter,
int desNo;
size = (int)sizeof(struct pch_gbe_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info) {
pr_err("Unable to allocate memory for the buffer infomation\n");
return -ENOMEM;
}
- memset(tx_ring->buffer_info, 0, size);
tx_ring->size = tx_ring->count * (int)sizeof(struct pch_gbe_tx_desc);
@@ -1573,12 +1572,11 @@ int pch_gbe_setup_rx_resources(struct pch_gbe_adapter *adapter,
int desNo;
size = (int)sizeof(struct pch_gbe_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info) {
pr_err("Unable to allocate memory for the receive descriptor ring\n");
return -ENOMEM;
}
- memset(rx_ring->buffer_info, 0, size);
rx_ring->size = rx_ring->count * (int)sizeof(struct pch_gbe_rx_desc);
rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
&rx_ring->dma, GFP_KERNEL);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 29/49] drivers/net/qlcnic: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (30 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Amit Kumar Salecha, Anirban Chakraborty, linux-driver, netdev,
linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/qlcnic/qlcnic_init.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 0d180c6..c5ea2f4 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -236,12 +236,11 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
tx_ring->num_desc = adapter->num_txd;
tx_ring->txq = netdev_get_tx_queue(netdev, 0);
- cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring));
+ cmd_buf_arr = vzalloc(TX_BUFF_RINGSIZE(tx_ring));
if (cmd_buf_arr == NULL) {
dev_err(&netdev->dev, "failed to allocate cmd buffer ring\n");
goto err_out;
}
- memset(cmd_buf_arr, 0, TX_BUFF_RINGSIZE(tx_ring));
tx_ring->cmd_buf_arr = cmd_buf_arr;
recv_ctx = &adapter->recv_ctx;
@@ -275,14 +274,12 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
rds_ring->dma_size + NET_IP_ALIGN;
break;
}
- rds_ring->rx_buf_arr = (struct qlcnic_rx_buffer *)
- vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
+ rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
if (rds_ring->rx_buf_arr == NULL) {
dev_err(&netdev->dev, "Failed to allocate "
"rx buffer ring %d\n", ring);
goto err_out;
}
- memset(rds_ring->rx_buf_arr, 0, RCV_BUFF_RINGSIZE(rds_ring));
INIT_LIST_HEAD(&rds_ring->free_list);
/*
* Now go through all of them, set reference handles
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 30/49] drivers/net/sfc: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (31 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Solarflare linux maintainers, Steve Hodgson, Ben Hutchings,
netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/sfc/filter.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/sfc/filter.c b/drivers/net/sfc/filter.c
index 52cb608..44500b5 100644
--- a/drivers/net/sfc/filter.c
+++ b/drivers/net/sfc/filter.c
@@ -428,10 +428,9 @@ int efx_probe_filters(struct efx_nic *efx)
GFP_KERNEL);
if (!table->used_bitmap)
goto fail;
- table->spec = vmalloc(table->size * sizeof(*table->spec));
+ table->spec = vzalloc(table->size * sizeof(*table->spec));
if (!table->spec)
goto fail;
- memset(table->spec, 0, table->size * sizeof(*table->spec));
}
return 0;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 31/49] drivers/net/vxge: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (32 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Ramkrishna Vepa, Sivakumar Subramani, Sreenivasa Honnur,
Jon Mason, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/vxge/vxge-config.c | 37 +++++++++----------------------------
1 files changed, 9 insertions(+), 28 deletions(-)
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c
index 906a3ca3..0c0a4e4 100644
--- a/drivers/net/vxge/vxge-config.c
+++ b/drivers/net/vxge/vxge-config.c
@@ -776,14 +776,12 @@ vxge_hw_device_initialize(
if (status != VXGE_HW_OK)
goto exit;
- hldev = (struct __vxge_hw_device *)
- vmalloc(sizeof(struct __vxge_hw_device));
+ hldev = vzalloc(sizeof(struct __vxge_hw_device));
if (hldev == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto exit;
}
- memset(hldev, 0, sizeof(struct __vxge_hw_device));
hldev->magic = VXGE_HW_DEVICE_MAGIC;
vxge_hw_device_debug_set(hldev, VXGE_ERR, VXGE_COMPONENT_ALL);
@@ -1627,15 +1625,12 @@ __vxge_hw_mempool_grow(struct vxge_hw_mempool *mempool, u32 num_allocate,
* allocate new memblock and its private part at once.
* This helps to minimize memory usage a lot. */
mempool->memblocks_priv_arr[i] =
- vmalloc(mempool->items_priv_size * n_items);
+ vzalloc(mempool->items_priv_size * n_items);
if (mempool->memblocks_priv_arr[i] == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto exit;
}
- memset(mempool->memblocks_priv_arr[i], 0,
- mempool->items_priv_size * n_items);
-
/* allocate DMA-capable memblock */
mempool->memblocks_arr[i] =
__vxge_hw_blockpool_malloc(mempool->devh,
@@ -1707,13 +1702,11 @@ __vxge_hw_mempool_create(
goto exit;
}
- mempool = (struct vxge_hw_mempool *)
- vmalloc(sizeof(struct vxge_hw_mempool));
+ mempool = vzalloc(sizeof(struct vxge_hw_mempool));
if (mempool == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto exit;
}
- memset(mempool, 0, sizeof(struct vxge_hw_mempool));
mempool->devh = devh;
mempool->memblock_size = memblock_size;
@@ -1733,31 +1726,27 @@ __vxge_hw_mempool_create(
/* allocate array of memblocks */
mempool->memblocks_arr =
- (void **) vmalloc(sizeof(void *) * mempool->memblocks_max);
+ vzalloc(sizeof(void *) * mempool->memblocks_max);
if (mempool->memblocks_arr == NULL) {
__vxge_hw_mempool_destroy(mempool);
status = VXGE_HW_ERR_OUT_OF_MEMORY;
mempool = NULL;
goto exit;
}
- memset(mempool->memblocks_arr, 0,
- sizeof(void *) * mempool->memblocks_max);
/* allocate array of private parts of items per memblocks */
mempool->memblocks_priv_arr =
- (void **) vmalloc(sizeof(void *) * mempool->memblocks_max);
+ vzalloc(sizeof(void *) * mempool->memblocks_max);
if (mempool->memblocks_priv_arr == NULL) {
__vxge_hw_mempool_destroy(mempool);
status = VXGE_HW_ERR_OUT_OF_MEMORY;
mempool = NULL;
goto exit;
}
- memset(mempool->memblocks_priv_arr, 0,
- sizeof(void *) * mempool->memblocks_max);
/* allocate array of memblocks DMA objects */
- mempool->memblocks_dma_arr = (struct vxge_hw_mempool_dma *)
- vmalloc(sizeof(struct vxge_hw_mempool_dma) *
+ mempool->memblocks_dma_arr =
+ vzalloc(sizeof(struct vxge_hw_mempool_dma) *
mempool->memblocks_max);
if (mempool->memblocks_dma_arr == NULL) {
@@ -1766,20 +1755,15 @@ __vxge_hw_mempool_create(
mempool = NULL;
goto exit;
}
- memset(mempool->memblocks_dma_arr, 0,
- sizeof(struct vxge_hw_mempool_dma) *
- mempool->memblocks_max);
/* allocate hash array of items */
- mempool->items_arr =
- (void **) vmalloc(sizeof(void *) * mempool->items_max);
+ mempool->items_arr = vzalloc(sizeof(void *) * mempool->items_max);
if (mempool->items_arr == NULL) {
__vxge_hw_mempool_destroy(mempool);
status = VXGE_HW_ERR_OUT_OF_MEMORY;
mempool = NULL;
goto exit;
}
- memset(mempool->items_arr, 0, sizeof(void *) * mempool->items_max);
/* calculate initial number of memblocks */
memblocks_to_allocate = (mempool->items_initial +
@@ -4242,15 +4226,12 @@ vxge_hw_vpath_open(struct __vxge_hw_device *hldev,
if (status != VXGE_HW_OK)
goto vpath_open_exit1;
- vp = (struct __vxge_hw_vpath_handle *)
- vmalloc(sizeof(struct __vxge_hw_vpath_handle));
+ vp = vzalloc(sizeof(struct __vxge_hw_vpath_handle));
if (vp == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto vpath_open_exit2;
}
- memset(vp, 0, sizeof(struct __vxge_hw_vpath_handle));
-
vp->vpath = vpath;
if (vpath->vp_config->fifo.enable == VXGE_HW_FIFO_ENABLE) {
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 32/49] drivers/net/bnx2.c: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (33 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Michael Chan, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/bnx2.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 062600b..aba4d0f 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -766,13 +766,10 @@ bnx2_alloc_rx_mem(struct bnx2 *bp)
int j;
rxr->rx_buf_ring =
- vmalloc(SW_RXBD_RING_SIZE * bp->rx_max_ring);
+ vzalloc(SW_RXBD_RING_SIZE * bp->rx_max_ring);
if (rxr->rx_buf_ring == NULL)
return -ENOMEM;
- memset(rxr->rx_buf_ring, 0,
- SW_RXBD_RING_SIZE * bp->rx_max_ring);
-
for (j = 0; j < bp->rx_max_ring; j++) {
rxr->rx_desc_ring[j] =
dma_alloc_coherent(&bp->pdev->dev,
@@ -785,13 +782,10 @@ bnx2_alloc_rx_mem(struct bnx2 *bp)
}
if (bp->rx_pg_ring_size) {
- rxr->rx_pg_ring = vmalloc(SW_RXPG_RING_SIZE *
+ rxr->rx_pg_ring = vzalloc(SW_RXPG_RING_SIZE *
bp->rx_max_pg_ring);
if (rxr->rx_pg_ring == NULL)
return -ENOMEM;
-
- memset(rxr->rx_pg_ring, 0, SW_RXPG_RING_SIZE *
- bp->rx_max_pg_ring);
}
for (j = 0; j < bp->rx_max_pg_ring; j++) {
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 33/49] drivers/s390: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (34 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Martin Schwidefsky, Heiko Carstens, linux390, linux-s390, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/s390/cio/blacklist.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
index 76058a5..08c6603 100644
--- a/drivers/s390/cio/blacklist.c
+++ b/drivers/s390/cio/blacklist.c
@@ -335,10 +335,9 @@ cio_ignore_write(struct file *file, const char __user *user_buf,
return -EINVAL;
if (user_len > 65536)
user_len = 65536;
- buf = vmalloc (user_len + 1); /* maybe better use the stack? */
+ buf = vzalloc(user_len + 1); /* maybe better use the stack? */
if (buf == NULL)
return -ENOMEM;
- memset(buf, 0, user_len + 1);
if (strncpy_from_user (buf, user_buf, user_len) < 0) {
rc = -EFAULT;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 34/49] drivers/scsi: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (35 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jing Huang, James E.J. Bottomley, Willem Riede, Andrew Vasquez,
linux-driver, linux-scsi, linux-kernel, osst-users
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/scsi/bfa/bfad.c | 3 +--
drivers/scsi/bfa/bfad_debugfs.c | 8 ++------
drivers/scsi/cxgbi/libcxgbi.h | 9 +++------
drivers/scsi/osst.c | 3 +--
drivers/scsi/qla2xxx/qla_attr.c | 3 +--
drivers/scsi/qla2xxx/qla_bsg.c | 3 +--
drivers/scsi/scsi_debug.c | 7 ++-----
7 files changed, 11 insertions(+), 25 deletions(-)
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 1f93897..10dc5d2 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -600,13 +600,12 @@ retry:
meminfo_elem = &hal_meminfo->meminfo[i];
switch (meminfo_elem->mem_type) {
case BFA_MEM_TYPE_KVA:
- kva = vmalloc(meminfo_elem->mem_len);
+ kva = vzalloc(meminfo_elem->mem_len);
if (kva == NULL) {
bfad_hal_mem_release(bfad);
rc = BFA_STATUS_ENOMEM;
goto ext;
}
- memset(kva, 0, meminfo_elem->mem_len);
meminfo_elem->kva = kva;
break;
case BFA_MEM_TYPE_DMA:
diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c
index 1fedeeb..0f7af51 100644
--- a/drivers/scsi/bfa/bfad_debugfs.c
+++ b/drivers/scsi/bfa/bfad_debugfs.c
@@ -79,7 +79,7 @@ bfad_debugfs_open_fwtrc(struct inode *inode, struct file *file)
fw_debug->buffer_len = sizeof(struct bfa_trc_mod_s);
- fw_debug->debug_buffer = vmalloc(fw_debug->buffer_len);
+ fw_debug->debug_buffer = vzalloc(fw_debug->buffer_len);
if (!fw_debug->debug_buffer) {
kfree(fw_debug);
printk(KERN_INFO "bfad[%d]: Failed to allocate fwtrc buffer\n",
@@ -87,8 +87,6 @@ bfad_debugfs_open_fwtrc(struct inode *inode, struct file *file)
return -ENOMEM;
}
- memset(fw_debug->debug_buffer, 0, fw_debug->buffer_len);
-
spin_lock_irqsave(&bfad->bfad_lock, flags);
rc = bfa_debug_fwtrc(&bfad->bfa,
fw_debug->debug_buffer,
@@ -123,7 +121,7 @@ bfad_debugfs_open_fwsave(struct inode *inode, struct file *file)
fw_debug->buffer_len = sizeof(struct bfa_trc_mod_s);
- fw_debug->debug_buffer = vmalloc(fw_debug->buffer_len);
+ fw_debug->debug_buffer = vzalloc(fw_debug->buffer_len);
if (!fw_debug->debug_buffer) {
kfree(fw_debug);
printk(KERN_INFO "bfad[%d]: Failed to allocate fwsave buffer\n",
@@ -131,8 +129,6 @@ bfad_debugfs_open_fwsave(struct inode *inode, struct file *file)
return -ENOMEM;
}
- memset(fw_debug->debug_buffer, 0, fw_debug->buffer_len);
-
spin_lock_irqsave(&bfad->bfad_lock, flags);
rc = bfa_debug_fwsave(&bfad->bfa,
fw_debug->debug_buffer,
diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h
index c57d59d..7627e37 100644
--- a/drivers/scsi/cxgbi/libcxgbi.h
+++ b/drivers/scsi/cxgbi/libcxgbi.h
@@ -658,14 +658,11 @@ static inline u32 cxgbi_tag_nonrsvd_bits(struct cxgbi_tag_format *tformat,
return v1 | v2;
}
-static inline void *cxgbi_alloc_big_mem(unsigned int size,
- gfp_t gfp)
+static inline void *cxgbi_alloc_big_mem(unsigned int size, gfp_t gfp)
{
- void *p = kmalloc(size, gfp);
+ void *p = kzalloc(size, gfp);
if (!p)
- p = vmalloc(size);
- if (p)
- memset(p, 0, size);
+ p = vzalloc(size);
return p;
}
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 54de1d1..02bc1cc 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -2296,11 +2296,10 @@ static int osst_write_header(struct osst_tape * STp, struct osst_request ** aSRp
if (STp->raw) return 0;
if (STp->header_cache == NULL) {
- if ((STp->header_cache = (os_header_t *)vmalloc(sizeof(os_header_t))) == NULL) {
+ if ((STp->header_cache = vzalloc(sizeof(os_header_t))) == NULL) {
printk(KERN_ERR "%s:E: Failed to allocate header cache\n", name);
return (-ENOMEM);
}
- memset(STp->header_cache, 0, sizeof(os_header_t));
#if DEBUG
printk(OSST_DEB_MSG "%s:D: Allocated and cleared memory for header cache\n", name);
#endif
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index bc8194f..7151b04 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -271,7 +271,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj,
ha->optrom_size - start : size;
ha->optrom_state = QLA_SREADING;
- ha->optrom_buffer = vmalloc(ha->optrom_region_size);
+ ha->optrom_buffer = vzalloc(ha->optrom_region_size);
if (ha->optrom_buffer == NULL) {
qla_printk(KERN_WARNING, ha,
"Unable to allocate memory for optrom retrieval "
@@ -291,7 +291,6 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj,
"Reading flash region -- 0x%x/0x%x.\n",
ha->optrom_region_start, ha->optrom_region_size));
- memset(ha->optrom_buffer, 0, ha->optrom_region_size);
ha->isp_ops->read_optrom(vha, ha->optrom_buffer,
ha->optrom_region_start, ha->optrom_region_size);
break;
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index 31a4121..27f7f79 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -1356,7 +1356,7 @@ qla2x00_optrom_setup(struct fc_bsg_job *bsg_job, struct qla_hw_data *ha,
ha->optrom_state = QLA_SREADING;
}
- ha->optrom_buffer = vmalloc(ha->optrom_region_size);
+ ha->optrom_buffer = vzalloc(ha->optrom_region_size);
if (!ha->optrom_buffer) {
qla_printk(KERN_WARNING, ha,
"Read: Unable to allocate memory for optrom retrieval "
@@ -1366,7 +1366,6 @@ qla2x00_optrom_setup(struct fc_bsg_job *bsg_job, struct qla_hw_data *ha,
return -ENOMEM;
}
- memset(ha->optrom_buffer, 0, ha->optrom_region_size);
return 0;
}
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 2c36bae..e6aaad4 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3305,12 +3305,11 @@ static int __init scsi_debug_init(void)
(sdebug_sectors_per * sdebug_heads);
}
- fake_storep = vmalloc(sz);
+ fake_storep = vzalloc(sz);
if (NULL == fake_storep) {
printk(KERN_ERR "scsi_debug_init: out of memory, 1\n");
return -ENOMEM;
}
- memset(fake_storep, 0, sz);
if (scsi_debug_num_parts > 0)
sdebug_build_parts(fake_storep, sz);
@@ -3355,7 +3354,7 @@ static int __init scsi_debug_init(void)
map_size = (sdebug_store_sectors / scsi_debug_unmap_granularity);
map_bytes = map_size >> 3;
- map_storep = vmalloc(map_bytes);
+ map_storep = vzalloc(map_bytes);
printk(KERN_INFO "scsi_debug_init: %lu provisioning blocks\n",
map_size);
@@ -3366,8 +3365,6 @@ static int __init scsi_debug_init(void)
goto free_vm;
}
- memset(map_storep, 0x0, map_bytes);
-
/* Map first 1KB for partition table */
if (scsi_debug_num_parts)
map_region(0, 2);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 35/49] drivers/staging: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (36 preceding siblings ...)
(?)
@ 2010-11-05 3:07 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Greg Kroah-Hartman, devel, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/staging/comedi/drivers.c | 4 +---
drivers/staging/rtl8192e/r8192E_core.c | 4 +---
drivers/staging/udlfb/udlfb.c | 5 ++---
drivers/staging/xgifb/XGI_main_26.c | 3 +--
drivers/staging/zram/zram_drv.c | 3 +--
5 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 4a29ed7..ef24a53 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -470,10 +470,8 @@ int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
struct page **pages = NULL;
async->buf_page_list =
- vmalloc(sizeof(struct comedi_buf_page) * n_pages);
+ vzalloc(sizeof(struct comedi_buf_page) * n_pages);
if (async->buf_page_list) {
- memset(async->buf_page_list, 0,
- sizeof(struct comedi_buf_page) * n_pages);
pages = vmalloc(sizeof(struct page *) * n_pages);
}
if (pages) {
diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index a202194..c870014 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -2283,9 +2283,7 @@ static void rtl8192_init_priv_variable(struct net_device* dev)
IMR_TXFOVW | IMR_BcnInt | IMR_TBDOK | IMR_TBDER);
priv->AcmControl = 0;
- priv->pFirmware = (rt_firmware*)vmalloc(sizeof(rt_firmware));
- if (priv->pFirmware)
- memset(priv->pFirmware, 0, sizeof(rt_firmware));
+ priv->pFirmware = vzalloc(sizeof(rt_firmware));
/* rx related queue */
skb_queue_head_init(&priv->rx_queue);
diff --git a/drivers/staging/udlfb/udlfb.c b/drivers/staging/udlfb/udlfb.c
index 5969e84..e228329 100644
--- a/drivers/staging/udlfb/udlfb.c
+++ b/drivers/staging/udlfb/udlfb.c
@@ -1163,14 +1163,13 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
* But with imperfect damage info we may send pixels over USB
* that were, in fact, unchanged - wasting limited USB bandwidth
*/
- new_back = vmalloc(new_len);
+ new_back = vzalloc(new_len);
if (!new_back)
- dl_info("No shadow/backing buffer allcoated\n");
+ dl_info("No shadow/backing buffer allocated\n");
else {
if (dev->backing_buffer)
vfree(dev->backing_buffer);
dev->backing_buffer = new_back;
- memset(dev->backing_buffer, 0, new_len);
}
}
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 4f73d09..1ebf1a0 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -2178,8 +2178,7 @@ static int XGIfb_heap_init(void)
#ifndef AGPOFF
if (XGIfb_queuemode == AGP_CMD_QUEUE) {
- agp_info = vmalloc(sizeof(*agp_info));
- memset((void *)agp_info, 0x00, sizeof(*agp_info));
+ agp_info = vzalloc(sizeof(*agp_info));
agp_copy_info(agp_info);
agp_backend_acquire();
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 8c3c057..43fd608 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -533,7 +533,7 @@ int zram_init_device(struct zram *zram)
}
num_pages = zram->disksize >> PAGE_SHIFT;
- zram->table = vmalloc(num_pages * sizeof(*zram->table));
+ zram->table = vzalloc(num_pages * sizeof(*zram->table));
if (!zram->table) {
pr_err("Error allocating zram address table\n");
/* To prevent accessing table entries during cleanup */
@@ -541,7 +541,6 @@ int zram_init_device(struct zram *zram)
ret = -ENOMEM;
goto fail;
}
- memset(zram->table, 0, num_pages * sizeof(*zram->table));
set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 36/49] drivers/video: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (37 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
2010-11-05 5:27 ` Dave Young
2010-11-08 16:43 ` Konrad Rzeszutek Wilk
-1 siblings, 2 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jaya Kumar, Jeremy Fitzhardinge, Konrad Rzeszutek Wilk,
linux-kernel, xen-devel, virtualization
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/video/arcfb.c | 5 ++---
drivers/video/broadsheetfb.c | 4 +---
drivers/video/hecubafb.c | 5 ++---
drivers/video/metronomefb.c | 4 +---
drivers/video/xen-fbfront.c | 3 +--
5 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 3ec4923..86573e2 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
/* We need a flat backing store for the Arc's
less-flat actual paged framebuffer */
- if (!(videomemory = vmalloc(videomemorysize)))
+ videomemory = vmalloc(videomemorysize);
+ if (!videomemory)
return retval;
- memset(videomemory, 0, videomemorysize);
-
info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
if (!info)
goto err;
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index ebda687..377dde3 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -1101,12 +1101,10 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
videomemorysize = roundup((dpyw*dpyh), PAGE_SIZE);
- videomemory = vmalloc(videomemorysize);
+ videomemory = vzalloc(videomemorysize);
if (!videomemory)
goto err_fb_rel;
- memset(videomemory, 0, videomemorysize);
-
info->screen_base = (char *)videomemory;
info->fbops = &broadsheetfb_ops;
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index c77bcc6..a941e6f 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -231,11 +231,10 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
videomemorysize = (DPY_W*DPY_H)/8;
- if (!(videomemory = vmalloc(videomemorysize)))
+ videomemory = vzalloc(videomemorysize);
+ if (!videomemory)
return retval;
- memset(videomemory, 0, videomemorysize);
-
info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev);
if (!info)
goto err_fballoc;
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
index 63ed3b7..c0c358c 100644
--- a/drivers/video/metronomefb.c
+++ b/drivers/video/metronomefb.c
@@ -628,12 +628,10 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
/* we need to add a spare page because our csum caching scheme walks
* to the end of the page */
videomemorysize = PAGE_SIZE + (fw * fh);
- videomemory = vmalloc(videomemorysize);
+ videomemory = vzalloc(videomemorysize);
if (!videomemory)
goto err_fb_rel;
- memset(videomemory, 0, videomemorysize);
-
info->screen_base = (char __force __iomem *)videomemory;
info->fbops = &metronomefb_ops;
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 428d273..81fcaea 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -395,10 +395,9 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
spin_lock_init(&info->dirty_lock);
spin_lock_init(&info->resize_lock);
- info->fb = vmalloc(fb_size);
+ info->fb = vzalloc(fb_size);
if (info->fb == NULL)
goto error_nomem;
- memset(info->fb, 0, fb_size);
info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 36/49] drivers/video: Use vzalloc
2010-11-05 3:08 ` [PATCH 36/49] drivers/video: " Joe Perches
@ 2010-11-05 5:27 ` Dave Young
2010-11-05 5:31 ` Joe Perches
2010-11-08 16:43 ` Konrad Rzeszutek Wilk
1 sibling, 1 reply; 153+ messages in thread
From: Dave Young @ 2010-11-05 5:27 UTC (permalink / raw)
To: Joe Perches
Cc: Jiri Kosina, Jaya Kumar, Jeremy Fitzhardinge,
Konrad Rzeszutek Wilk, linux-kernel, xen-devel, virtualization
On Fri, Nov 5, 2010 at 11:08 AM, Joe Perches <joe@perches.com> wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/video/arcfb.c | 5 ++---
> drivers/video/broadsheetfb.c | 4 +---
> drivers/video/hecubafb.c | 5 ++---
> drivers/video/metronomefb.c | 4 +---
> drivers/video/xen-fbfront.c | 3 +--
> 5 files changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
> index 3ec4923..86573e2 100644
> --- a/drivers/video/arcfb.c
> +++ b/drivers/video/arcfb.c
> @@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
>
> /* We need a flat backing store for the Arc's
> less-flat actual paged framebuffer */
> - if (!(videomemory = vmalloc(videomemorysize)))
> + videomemory = vmalloc(videomemorysize);
typo?
> + if (!videomemory)
> return retval;
>
> - memset(videomemory, 0, videomemorysize);
> -
> info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
> if (!info)
> goto err;
> diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
> index ebda687..377dde3 100644
> --- a/drivers/video/broadsheetfb.c
> +++ b/drivers/video/broadsheetfb.c
> @@ -1101,12 +1101,10 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
>
> videomemorysize = roundup((dpyw*dpyh), PAGE_SIZE);
>
> - videomemory = vmalloc(videomemorysize);
> + videomemory = vzalloc(videomemorysize);
> if (!videomemory)
> goto err_fb_rel;
>
> - memset(videomemory, 0, videomemorysize);
> -
> info->screen_base = (char *)videomemory;
> info->fbops = &broadsheetfb_ops;
>
> diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
> index c77bcc6..a941e6f 100644
> --- a/drivers/video/hecubafb.c
> +++ b/drivers/video/hecubafb.c
> @@ -231,11 +231,10 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
>
> videomemorysize = (DPY_W*DPY_H)/8;
>
> - if (!(videomemory = vmalloc(videomemorysize)))
> + videomemory = vzalloc(videomemorysize);
> + if (!videomemory)
> return retval;
>
> - memset(videomemory, 0, videomemorysize);
> -
> info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev);
> if (!info)
> goto err_fballoc;
> diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
> index 63ed3b7..c0c358c 100644
> --- a/drivers/video/metronomefb.c
> +++ b/drivers/video/metronomefb.c
> @@ -628,12 +628,10 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
> /* we need to add a spare page because our csum caching scheme walks
> * to the end of the page */
> videomemorysize = PAGE_SIZE + (fw * fh);
> - videomemory = vmalloc(videomemorysize);
> + videomemory = vzalloc(videomemorysize);
> if (!videomemory)
> goto err_fb_rel;
>
> - memset(videomemory, 0, videomemorysize);
> -
> info->screen_base = (char __force __iomem *)videomemory;
> info->fbops = &metronomefb_ops;
>
> diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
> index 428d273..81fcaea 100644
> --- a/drivers/video/xen-fbfront.c
> +++ b/drivers/video/xen-fbfront.c
> @@ -395,10 +395,9 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
> spin_lock_init(&info->dirty_lock);
> spin_lock_init(&info->resize_lock);
>
> - info->fb = vmalloc(fb_size);
> + info->fb = vzalloc(fb_size);
> if (info->fb == NULL)
> goto error_nomem;
> - memset(info->fb, 0, fb_size);
>
> info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
>
> --
> 1.7.3.1.g432b3.dirty
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Regards
dave
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 36/49] drivers/video: Use vzalloc
2010-11-05 5:27 ` Dave Young
@ 2010-11-05 5:31 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 5:31 UTC (permalink / raw)
To: Dave Young
Cc: Jiri Kosina, Jaya Kumar, Jeremy Fitzhardinge,
Konrad Rzeszutek Wilk, linux-kernel, xen-devel, virtualization
On Fri, 2010-11-05 at 13:27 +0800, Dave Young wrote:
> On Fri, Nov 5, 2010 at 11:08 AM, Joe Perches <joe@perches.com> wrote:
> > diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
> > @@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
> >
> > /* We need a flat backing store for the Arc's
> > less-flat actual paged framebuffer */
> > - if (!(videomemory = vmalloc(videomemorysize)))
> > + videomemory = vmalloc(videomemorysize);
> typo?
Yes. Thanks for catching that.
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 36/49] drivers/video: Use vzalloc
2010-11-05 3:08 ` [PATCH 36/49] drivers/video: " Joe Perches
2010-11-05 5:27 ` Dave Young
@ 2010-11-08 16:43 ` Konrad Rzeszutek Wilk
1 sibling, 0 replies; 153+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-11-08 16:43 UTC (permalink / raw)
To: Joe Perches
Cc: Jiri Kosina, Jaya Kumar, Jeremy Fitzhardinge, linux-kernel,
xen-devel, virtualization
On Thu, Nov 04, 2010 at 08:08:00PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
Looks good on xen-fb.
> ---
> drivers/video/arcfb.c | 5 ++---
> drivers/video/broadsheetfb.c | 4 +---
> drivers/video/hecubafb.c | 5 ++---
> drivers/video/metronomefb.c | 4 +---
> drivers/video/xen-fbfront.c | 3 +--
> 5 files changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
> index 3ec4923..86573e2 100644
> --- a/drivers/video/arcfb.c
> +++ b/drivers/video/arcfb.c
> @@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
>
> /* We need a flat backing store for the Arc's
> less-flat actual paged framebuffer */
> - if (!(videomemory = vmalloc(videomemorysize)))
> + videomemory = vmalloc(videomemorysize);
> + if (!videomemory)
> return retval;
>
> - memset(videomemory, 0, videomemorysize);
> -
> info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
> if (!info)
> goto err;
> diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
> index ebda687..377dde3 100644
> --- a/drivers/video/broadsheetfb.c
> +++ b/drivers/video/broadsheetfb.c
> @@ -1101,12 +1101,10 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
>
> videomemorysize = roundup((dpyw*dpyh), PAGE_SIZE);
>
> - videomemory = vmalloc(videomemorysize);
> + videomemory = vzalloc(videomemorysize);
> if (!videomemory)
> goto err_fb_rel;
>
> - memset(videomemory, 0, videomemorysize);
> -
> info->screen_base = (char *)videomemory;
> info->fbops = &broadsheetfb_ops;
>
> diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
> index c77bcc6..a941e6f 100644
> --- a/drivers/video/hecubafb.c
> +++ b/drivers/video/hecubafb.c
> @@ -231,11 +231,10 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
>
> videomemorysize = (DPY_W*DPY_H)/8;
>
> - if (!(videomemory = vmalloc(videomemorysize)))
> + videomemory = vzalloc(videomemorysize);
> + if (!videomemory)
> return retval;
>
> - memset(videomemory, 0, videomemorysize);
> -
> info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev);
> if (!info)
> goto err_fballoc;
> diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
> index 63ed3b7..c0c358c 100644
> --- a/drivers/video/metronomefb.c
> +++ b/drivers/video/metronomefb.c
> @@ -628,12 +628,10 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
> /* we need to add a spare page because our csum caching scheme walks
> * to the end of the page */
> videomemorysize = PAGE_SIZE + (fw * fh);
> - videomemory = vmalloc(videomemorysize);
> + videomemory = vzalloc(videomemorysize);
> if (!videomemory)
> goto err_fb_rel;
>
> - memset(videomemory, 0, videomemorysize);
> -
> info->screen_base = (char __force __iomem *)videomemory;
> info->fbops = &metronomefb_ops;
>
> diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
> index 428d273..81fcaea 100644
> --- a/drivers/video/xen-fbfront.c
> +++ b/drivers/video/xen-fbfront.c
> @@ -395,10 +395,9 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
> spin_lock_init(&info->dirty_lock);
> spin_lock_init(&info->resize_lock);
>
> - info->fb = vmalloc(fb_size);
> + info->fb = vzalloc(fb_size);
> if (info->fb == NULL)
> goto error_nomem;
> - memset(info->fb, 0, fb_size);
>
> info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
>
> --
> 1.7.3.1.g432b3.dirty
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 37/49] fs/ext4: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (38 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
2010-11-05 7:02 ` Andreas Dilger
-1 siblings, 1 reply; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
fs/ext4/super.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 40131b7..9ed90f4 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1909,9 +1909,7 @@ static int ext4_fill_flex_info(struct super_block *sb)
size = flex_group_count * sizeof(struct flex_groups);
sbi->s_flex_groups = kzalloc(size, GFP_KERNEL);
if (sbi->s_flex_groups == NULL) {
- sbi->s_flex_groups = vmalloc(size);
- if (sbi->s_flex_groups)
- memset(sbi->s_flex_groups, 0, size);
+ sbi->s_flex_groups = vzalloc(size);
}
if (sbi->s_flex_groups == NULL) {
ext4_msg(sb, KERN_ERR, "not enough memory for "
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 37/49] fs/ext4: Use vzalloc
2010-11-05 3:08 ` [PATCH 37/49] fs/ext4: " Joe Perches
@ 2010-11-05 7:02 ` Andreas Dilger
2010-11-05 7:18 ` [PATCH V2 " Joe Perches
0 siblings, 1 reply; 153+ messages in thread
From: Andreas Dilger @ 2010-11-05 7:02 UTC (permalink / raw)
To: Joe Perches; +Cc: Jiri Kosina, Theodore Ts'o, Ext4 Developers List
On 2010-11-04, at 21:08, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> @@ -1909,9 +1909,7 @@ static int ext4_fill_flex_info(struct super_block *sb)
> size = flex_group_count * sizeof(struct flex_groups);
> sbi->s_flex_groups = kzalloc(size, GFP_KERNEL);
> if (sbi->s_flex_groups == NULL) {
> - sbi->s_flex_groups = vmalloc(size);
> - if (sbi->s_flex_groups)
> - memset(sbi->s_flex_groups, 0, size);
> + sbi->s_flex_groups = vzalloc(size);
> }
> if (sbi->s_flex_groups == NULL) {
> ext4_msg(sb, KERN_ERR, "not enough memory for "
You may as well move the second s_flex_groups == NULL check inside the first one:
if (sbi->s_flex_groups == NULL) {
sbi->s_flex_groups = vzalloc(size);
if (sbi->s_flex_groups == NULL) {
ext4_msg(sb, KERN_ERR, "not enough memory for "
"%u flex groups", flex_group_count);
goto failed;
}
}
Cheers, Andreas
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH V2 37/49] fs/ext4: Use vzalloc
2010-11-05 7:02 ` Andreas Dilger
@ 2010-11-05 7:18 ` Joe Perches
2010-12-20 3:22 ` Ted Ts'o
0 siblings, 1 reply; 153+ messages in thread
From: Joe Perches @ 2010-11-05 7:18 UTC (permalink / raw)
To: Andreas Dilger; +Cc: Jiri Kosina, Theodore Ts'o, Ext4 Developers List, LKML
Signed-off-by: Joe Perches <joe@perches.com>
---
differences from V1:
Andreas Dilger requested a block be moved so that
sbi->s_flex_groups isn't tested for NULL twice.
Also coalesced a ext4_msg printk format.
fs/ext4/super.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 40131b7..6dbc4379 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1909,14 +1909,13 @@ static int ext4_fill_flex_info(struct
super_block *sb)
size = flex_group_count * sizeof(struct flex_groups);
sbi->s_flex_groups = kzalloc(size, GFP_KERNEL);
if (sbi->s_flex_groups == NULL) {
- sbi->s_flex_groups = vmalloc(size);
- if (sbi->s_flex_groups)
- memset(sbi->s_flex_groups, 0, size);
- }
- if (sbi->s_flex_groups == NULL) {
- ext4_msg(sb, KERN_ERR, "not enough memory for "
- "%u flex groups", flex_group_count);
- goto failed;
+ sbi->s_flex_groups = vzalloc(size);
+ if (sbi->s_flex_groups == NULL) {
+ ext4_msg(sb, KERN_ERR,
+ "not enough memory for %u flex groups",
+ flex_group_count);
+ goto failed;
+ }
}
for (i = 0; i < sbi->s_groups_count; i++) {
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH V2 37/49] fs/ext4: Use vzalloc
2010-11-05 7:18 ` [PATCH V2 " Joe Perches
@ 2010-12-20 3:22 ` Ted Ts'o
0 siblings, 0 replies; 153+ messages in thread
From: Ted Ts'o @ 2010-12-20 3:22 UTC (permalink / raw)
To: Joe Perches; +Cc: Andreas Dilger, Jiri Kosina, Ext4 Developers List, LKML
On Fri, Nov 05, 2010 at 12:18:31AM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> differences from V1:
> Andreas Dilger requested a block be moved so that
> sbi->s_flex_groups isn't tested for NULL twice.
> Also coalesced a ext4_msg printk format.
Thanks, applied to the ext4 tree
- Ted
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 38/49] fs/jffs2: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:08 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: David Woodhouse, linux-mtd, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
fs/jffs2/build.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/jffs2/build.c b/fs/jffs2/build.c
index 85c6be2..3005ec4 100644
--- a/fs/jffs2/build.c
+++ b/fs/jffs2/build.c
@@ -336,14 +336,13 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
size = sizeof(struct jffs2_eraseblock) * c->nr_blocks;
#ifndef __ECOS
if (jffs2_blocks_use_vmalloc(c))
- c->blocks = vmalloc(size);
+ c->blocks = vzalloc(size);
else
#endif
- c->blocks = kmalloc(size, GFP_KERNEL);
+ c->blocks = kzalloc(size, GFP_KERNEL);
if (!c->blocks)
return -ENOMEM;
- memset(c->blocks, 0, size);
for (i=0; i<c->nr_blocks; i++) {
INIT_LIST_HEAD(&c->blocks[i].list);
c->blocks[i].offset = i * c->sector_size;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 38/49] fs/jffs2: Use vzalloc
@ 2010-11-05 3:08 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-mtd, David Woodhouse, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
fs/jffs2/build.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/jffs2/build.c b/fs/jffs2/build.c
index 85c6be2..3005ec4 100644
--- a/fs/jffs2/build.c
+++ b/fs/jffs2/build.c
@@ -336,14 +336,13 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
size = sizeof(struct jffs2_eraseblock) * c->nr_blocks;
#ifndef __ECOS
if (jffs2_blocks_use_vmalloc(c))
- c->blocks = vmalloc(size);
+ c->blocks = vzalloc(size);
else
#endif
- c->blocks = kmalloc(size, GFP_KERNEL);
+ c->blocks = kzalloc(size, GFP_KERNEL);
if (!c->blocks)
return -ENOMEM;
- memset(c->blocks, 0, size);
for (i=0; i<c->nr_blocks; i++) {
INIT_LIST_HEAD(&c->blocks[i].list);
c->blocks[i].offset = i * c->sector_size;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 38/49] fs/jffs2: Use vzalloc
2010-11-05 3:08 ` Joe Perches
@ 2010-11-13 11:19 ` Artem Bityutskiy
-1 siblings, 0 replies; 153+ messages in thread
From: Artem Bityutskiy @ 2010-11-13 11:19 UTC (permalink / raw)
To: Joe Perches; +Cc: Jiri Kosina, David Woodhouse, linux-mtd, linux-kernel
On Thu, 2010-11-04 at 20:08 -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> fs/jffs2/build.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
Pushed to l2-mtd-2.6.git, thanks.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 38/49] fs/jffs2: Use vzalloc
@ 2010-11-13 11:19 ` Artem Bityutskiy
0 siblings, 0 replies; 153+ messages in thread
From: Artem Bityutskiy @ 2010-11-13 11:19 UTC (permalink / raw)
To: Joe Perches; +Cc: David Woodhouse, Jiri Kosina, linux-kernel, linux-mtd
On Thu, 2010-11-04 at 20:08 -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> fs/jffs2/build.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
Pushed to l2-mtd-2.6.git, thanks.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 39/49] fs/reiserfs: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (40 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: reiserfs-devel, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
fs/reiserfs/journal.c | 9 +++------
fs/reiserfs/resize.c | 4 +---
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 076c8b1..d8a2592 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -292,14 +292,13 @@ int reiserfs_allocate_list_bitmaps(struct super_block *sb,
for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) {
jb = jb_array + i;
jb->journal_list = NULL;
- jb->bitmaps = vmalloc(mem);
+ jb->bitmaps = vzalloc(mem);
if (!jb->bitmaps) {
reiserfs_warning(sb, "clm-2000", "unable to "
"allocate bitmaps for journal lists");
failed = 1;
break;
}
- memset(jb->bitmaps, 0, mem);
}
if (failed) {
free_list_bitmaps(sb, jb_array);
@@ -354,11 +353,10 @@ static struct reiserfs_journal_cnode *allocate_cnodes(int num_cnodes)
if (num_cnodes <= 0) {
return NULL;
}
- head = vmalloc(num_cnodes * sizeof(struct reiserfs_journal_cnode));
+ head = vzalloc(num_cnodes * sizeof(struct reiserfs_journal_cnode));
if (!head) {
return NULL;
}
- memset(head, 0, num_cnodes * sizeof(struct reiserfs_journal_cnode));
head[0].prev = NULL;
head[0].next = head + 1;
for (i = 1; i < num_cnodes; i++) {
@@ -2703,14 +2701,13 @@ int journal_init(struct super_block *sb, const char *j_dev_name,
* dependency inversion warnings.
*/
reiserfs_write_unlock(sb);
- journal = SB_JOURNAL(sb) = vmalloc(sizeof(struct reiserfs_journal));
+ journal = SB_JOURNAL(sb) = vzalloc(sizeof(struct reiserfs_journal));
if (!journal) {
reiserfs_warning(sb, "journal-1256",
"unable to get memory for journal structure");
reiserfs_write_lock(sb);
return 1;
}
- memset(journal, 0, sizeof(struct reiserfs_journal));
INIT_LIST_HEAD(&journal->j_bitmap_nodes);
INIT_LIST_HEAD(&journal->j_prealloc_list);
INIT_LIST_HEAD(&journal->j_working_list);
diff --git a/fs/reiserfs/resize.c b/fs/reiserfs/resize.c
index b3a94d2..cfb5196 100644
--- a/fs/reiserfs/resize.c
+++ b/fs/reiserfs/resize.c
@@ -111,15 +111,13 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
/* allocate additional bitmap blocks, reallocate array of bitmap
* block pointers */
bitmap =
- vmalloc(sizeof(struct reiserfs_bitmap_info) * bmap_nr_new);
+ vzalloc(sizeof(struct reiserfs_bitmap_info) * bmap_nr_new);
if (!bitmap) {
/* Journal bitmaps are still supersized, but the memory isn't
* leaked, so I guess it's ok */
printk("reiserfs_resize: unable to allocate memory.\n");
return -ENOMEM;
}
- memset(bitmap, 0,
- sizeof(struct reiserfs_bitmap_info) * bmap_nr_new);
for (i = 0; i < bmap_nr; i++)
bitmap[i] = old_bitmap[i];
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 40/49] fs/udf: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (41 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
2010-11-05 9:11 ` Jan Kara
-1 siblings, 1 reply; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Jan Kara, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
fs/udf/super.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 4a5c7c6..6e07d99 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -959,9 +959,9 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
(sizeof(struct buffer_head *) * nr_groups);
if (size <= PAGE_SIZE)
- bitmap = kmalloc(size, GFP_KERNEL);
+ bitmap = kzalloc(size, GFP_KERNEL);
else
- bitmap = vmalloc(size); /* TODO: get rid of vmalloc */
+ bitmap = vzalloc(size); /* TODO: get rid of vmalloc */
if (bitmap == NULL) {
udf_error(sb, __func__,
@@ -970,7 +970,6 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
return NULL;
}
- memset(bitmap, 0x00, size);
bitmap->s_block_bitmap = (struct buffer_head **)(bitmap + 1);
bitmap->s_nr_groups = nr_groups;
return bitmap;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 40/49] fs/udf: Use vzalloc
2010-11-05 3:08 ` [PATCH 40/49] fs/udf: " Joe Perches
@ 2010-11-05 9:11 ` Jan Kara
2010-11-05 9:15 ` Peter Bortas
0 siblings, 1 reply; 153+ messages in thread
From: Jan Kara @ 2010-11-05 9:11 UTC (permalink / raw)
To: Joe Perches; +Cc: Jiri Kosina, Jan Kara, linux-kernel
On Thu 04-11-10 20:08:04, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> fs/udf/super.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
I've merged the patch into my tree.
Honza
>
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index 4a5c7c6..6e07d99 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -959,9 +959,9 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
> (sizeof(struct buffer_head *) * nr_groups);
>
> if (size <= PAGE_SIZE)
> - bitmap = kmalloc(size, GFP_KERNEL);
> + bitmap = kzalloc(size, GFP_KERNEL);
> else
> - bitmap = vmalloc(size); /* TODO: get rid of vmalloc */
> + bitmap = vzalloc(size); /* TODO: get rid of vmalloc */
>
> if (bitmap == NULL) {
> udf_error(sb, __func__,
> @@ -970,7 +970,6 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
> return NULL;
> }
>
> - memset(bitmap, 0x00, size);
> bitmap->s_block_bitmap = (struct buffer_head **)(bitmap + 1);
> bitmap->s_nr_groups = nr_groups;
> return bitmap;
> --
> 1.7.3.1.g432b3.dirty
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 40/49] fs/udf: Use vzalloc
2010-11-05 9:11 ` Jan Kara
@ 2010-11-05 9:15 ` Peter Bortas
2010-11-05 9:30 ` Jan Kara
0 siblings, 1 reply; 153+ messages in thread
From: Peter Bortas @ 2010-11-05 9:15 UTC (permalink / raw)
To: Jan Kara; +Cc: Joe Perches, Jiri Kosina, linux-kernel
Hi,
On Fri, Nov 5, 2010 at 10:11 AM, Jan Kara <jack@suse.cz> wrote:
> On Thu 04-11-10 20:08:04, Joe Perches wrote:
>> Signed-off-by: Joe Perches <joe@perches.com>
>> ---
>> fs/udf/super.c | 5 ++---
>> 1 files changed, 2 insertions(+), 3 deletions(-)
> I've merged the patch into my tree.
>
> Honza
>
>>
>> diff --git a/fs/udf/super.c b/fs/udf/super.c
>> index 4a5c7c6..6e07d99 100644
>> --- a/fs/udf/super.c
>> +++ b/fs/udf/super.c
>> @@ -959,9 +959,9 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
>> (sizeof(struct buffer_head *) * nr_groups);
>>
>> if (size <= PAGE_SIZE)
>> - bitmap = kmalloc(size, GFP_KERNEL);
>> + bitmap = kzalloc(size, GFP_KERNEL);
>> else
>> - bitmap = vmalloc(size); /* TODO: get rid of vmalloc */
>> + bitmap = vzalloc(size); /* TODO: get rid of vmalloc */
Shouldn't this comment be removed or at least changed to match the new malloc?
>>
>> if (bitmap == NULL) {
>> udf_error(sb, __func__,
>> @@ -970,7 +970,6 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
>> return NULL;
>> }
>>
>> - memset(bitmap, 0x00, size);
>> bitmap->s_block_bitmap = (struct buffer_head **)(bitmap + 1);
>> bitmap->s_nr_groups = nr_groups;
>> return bitmap;
>> --
>> 1.7.3.1.g432b3.dirty
>>
> --
> Jan Kara <jack@suse.cz>
> SUSE Labs, CR
--
Peter Bortas
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 40/49] fs/udf: Use vzalloc
2010-11-05 9:15 ` Peter Bortas
@ 2010-11-05 9:30 ` Jan Kara
0 siblings, 0 replies; 153+ messages in thread
From: Jan Kara @ 2010-11-05 9:30 UTC (permalink / raw)
To: Peter Bortas; +Cc: Jan Kara, Joe Perches, Jiri Kosina, linux-kernel
On Fri 05-11-10 10:15:15, Peter Bortas wrote:
> >> - bitmap = vmalloc(size); /* TODO: get rid of vmalloc */
> >> + bitmap = vzalloc(size); /* TODO: get rid of vmalloc */
>
> Shouldn't this comment be removed or at least changed to match the new malloc?
OK, changed. Thanks for pointing this out.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 41/49] fs/xfs: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:08 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Alex Elder, xfs-masters, xfs, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
fs/xfs/linux-2.6/kmem.h | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h
index f7c8f7a..292eff1 100644
--- a/fs/xfs/linux-2.6/kmem.h
+++ b/fs/xfs/linux-2.6/kmem.h
@@ -61,12 +61,7 @@ extern void kmem_free(const void *);
static inline void *kmem_zalloc_large(size_t size)
{
- void *ptr;
-
- ptr = vmalloc(size);
- if (ptr)
- memset(ptr, 0, size);
- return ptr;
+ return vzalloc(size);
}
static inline void kmem_free_large(void *ptr)
{
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 41/49] fs/xfs: Use vzalloc
@ 2010-11-05 3:08 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: xfs-masters, xfs, linux-kernel, Alex Elder
Signed-off-by: Joe Perches <joe@perches.com>
---
fs/xfs/linux-2.6/kmem.h | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h
index f7c8f7a..292eff1 100644
--- a/fs/xfs/linux-2.6/kmem.h
+++ b/fs/xfs/linux-2.6/kmem.h
@@ -61,12 +61,7 @@ extern void kmem_free(const void *);
static inline void *kmem_zalloc_large(size_t size)
{
- void *ptr;
-
- ptr = vmalloc(size);
- if (ptr)
- memset(ptr, 0, size);
- return ptr;
+ return vzalloc(size);
}
static inline void kmem_free_large(void *ptr)
{
--
1.7.3.1.g432b3.dirty
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 41/49] fs/xfs: Use vzalloc
2010-11-05 3:08 ` Joe Perches
@ 2010-11-05 17:09 ` Alex Elder
-1 siblings, 0 replies; 153+ messages in thread
From: Alex Elder @ 2010-11-05 17:09 UTC (permalink / raw)
To: Joe Perches; +Cc: Jiri Kosina, xfs-masters, xfs, linux-kernel
On Thu, 2010-11-04 at 20:08 -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> fs/xfs/linux-2.6/kmem.h | 7 +------
> 1 files changed, 1 insertions(+), 6 deletions(-)
>
> diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h
> index f7c8f7a..292eff1 100644
> --- a/fs/xfs/linux-2.6/kmem.h
> +++ b/fs/xfs/linux-2.6/kmem.h
> @@ -61,12 +61,7 @@ extern void kmem_free(const void *);
>
> static inline void *kmem_zalloc_large(size_t size)
> {
> - void *ptr;
> -
> - ptr = vmalloc(size);
> - if (ptr)
> - memset(ptr, 0, size);
> - return ptr;
> + return vzalloc(size);
> }
> static inline void kmem_free_large(void *ptr)
> {
Looks good to me.
Reviewed-by: Alex Elder <aelder@sgi.com>
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 41/49] fs/xfs: Use vzalloc
@ 2010-11-05 17:09 ` Alex Elder
0 siblings, 0 replies; 153+ messages in thread
From: Alex Elder @ 2010-11-05 17:09 UTC (permalink / raw)
To: Joe Perches; +Cc: xfs-masters, Jiri Kosina, linux-kernel, xfs
On Thu, 2010-11-04 at 20:08 -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> fs/xfs/linux-2.6/kmem.h | 7 +------
> 1 files changed, 1 insertions(+), 6 deletions(-)
>
> diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h
> index f7c8f7a..292eff1 100644
> --- a/fs/xfs/linux-2.6/kmem.h
> +++ b/fs/xfs/linux-2.6/kmem.h
> @@ -61,12 +61,7 @@ extern void kmem_free(const void *);
>
> static inline void *kmem_zalloc_large(size_t size)
> {
> - void *ptr;
> -
> - ptr = vmalloc(size);
> - if (ptr)
> - memset(ptr, 0, size);
> - return ptr;
> + return vzalloc(size);
> }
> static inline void kmem_free_large(void *ptr)
> {
Looks good to me.
Reviewed-by: Alex Elder <aelder@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 42/49] include/linux/coda_linux.h: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (43 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Jan Harkes, coda, codalist, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/coda_linux.h | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index 2e914d0..57460f3 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -55,19 +55,25 @@ unsigned short coda_flags_to_cflags(unsigned short);
void coda_sysctl_init(void);
void coda_sysctl_clean(void);
-#define CODA_ALLOC(ptr, cast, size) do { \
- if (size < PAGE_SIZE) \
- ptr = kmalloc((unsigned long) size, GFP_KERNEL); \
- else \
- ptr = (cast)vmalloc((unsigned long) size); \
- if (!ptr) \
- printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \
- else memset( ptr, 0, size ); \
+#define CODA_ALLOC(ptr, cast, size) \
+do { \
+ if (size < PAGE_SIZE) \
+ ptr = kzalloc((unsigned long) size, GFP_KERNEL); \
+ else \
+ ptr = vzalloc((unsigned long) size); \
+ if (!ptr) \
+ printk(KERN_ERR "kernel malloc returns 0 at %s:%d\n", \
+ __FILE__, __LINE__); \
} while (0)
-#define CODA_FREE(ptr,size) \
- do { if (size < PAGE_SIZE) kfree((ptr)); else vfree((ptr)); } while (0)
+#define CODA_FREE(ptr, size) \
+do { \
+ if (size < PAGE_SIZE) \
+ kfree((ptr)); \
+ else \
+ vfree((ptr)); \
+} while (0)
/* inode to cnode access functions */
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 43/49] kernel: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (44 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
kernel/profile.c | 6 ++----
kernel/relay.c | 4 +---
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/kernel/profile.c b/kernel/profile.c
index 66f841b..14c9f87 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -126,11 +126,9 @@ int __ref profile_init(void)
if (prof_buffer)
return 0;
- prof_buffer = vmalloc(buffer_bytes);
- if (prof_buffer) {
- memset(prof_buffer, 0, buffer_bytes);
+ prof_buffer = vzalloc(buffer_bytes);
+ if (prof_buffer)
return 0;
- }
free_cpumask_var(prof_cpu_mask);
return -ENOMEM;
diff --git a/kernel/relay.c b/kernel/relay.c
index c7cf397..11fbe89 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -74,9 +74,7 @@ static struct page **relay_alloc_page_array(unsigned int n_pages)
size_t pa_size = n_pages * sizeof(struct page *);
if (pa_size > PAGE_SIZE) {
- array = vmalloc(pa_size);
- if (array)
- memset(array, 0, pa_size);
+ array = vzalloc(pa_size);
} else {
array = kzalloc(pa_size, GFP_KERNEL);
}
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 44/49] mm: Use vzalloc
2010-11-05 3:07 ` Joe Perches
@ 2010-11-05 3:08 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina
Cc: Balbir Singh, Daisuke Nishimura, KAMEZAWA Hiroyuki, Paul Menage,
Li Zefan, linux-mm, linux-kernel, containers
Signed-off-by: Joe Perches <joe@perches.com>
---
mm/memcontrol.c | 5 ++---
mm/page_cgroup.c | 3 +--
mm/percpu.c | 8 ++------
mm/swapfile.c | 3 +--
4 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 9a99cfa..90da698 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4199,14 +4199,13 @@ static struct mem_cgroup *mem_cgroup_alloc(void)
/* Can be very big if MAX_NUMNODES is very big */
if (size < PAGE_SIZE)
- mem = kmalloc(size, GFP_KERNEL);
+ mem = kzalloc(size, GFP_KERNEL);
else
- mem = vmalloc(size);
+ mem = vzalloc(size);
if (!mem)
return NULL;
- memset(mem, 0, size);
mem->stat = alloc_percpu(struct mem_cgroup_stat_cpu);
if (!mem->stat) {
if (size < PAGE_SIZE)
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 5bffada..34970c7 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -450,11 +450,10 @@ int swap_cgroup_swapon(int type, unsigned long max_pages)
length = ((max_pages/SC_PER_PAGE) + 1);
array_size = length * sizeof(void *);
- array = vmalloc(array_size);
+ array = vzalloc(array_size);
if (!array)
goto nomem;
- memset(array, 0, array_size);
ctrl = &swap_cgroup_ctrl[type];
mutex_lock(&swap_cgroup_mutex);
ctrl->length = length;
diff --git a/mm/percpu.c b/mm/percpu.c
index efe8168..9e16d1c 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -293,12 +293,8 @@ static void *pcpu_mem_alloc(size_t size)
if (size <= PAGE_SIZE)
return kzalloc(size, GFP_KERNEL);
- else {
- void *ptr = vmalloc(size);
- if (ptr)
- memset(ptr, 0, size);
- return ptr;
- }
+ else
+ return vzalloc(size);
}
/**
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 67ddaaf..43e6988 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2044,13 +2044,12 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
goto bad_swap;
/* OK, set up the swap map and apply the bad block list */
- swap_map = vmalloc(maxpages);
+ swap_map = vzalloc(maxpages);
if (!swap_map) {
error = -ENOMEM;
goto bad_swap;
}
- memset(swap_map, 0, maxpages);
nr_good_pages = maxpages - 1; /* omit header page */
for (i = 0; i < swap_header->info.nr_badpages; i++) {
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 44/49] mm: Use vzalloc
@ 2010-11-05 3:08 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina
Cc: Balbir Singh, Daisuke Nishimura, KAMEZAWA Hiroyuki, Paul Menage,
Li Zefan, linux-mm, linux-kernel, containers
Signed-off-by: Joe Perches <joe@perches.com>
---
mm/memcontrol.c | 5 ++---
mm/page_cgroup.c | 3 +--
mm/percpu.c | 8 ++------
mm/swapfile.c | 3 +--
4 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 9a99cfa..90da698 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4199,14 +4199,13 @@ static struct mem_cgroup *mem_cgroup_alloc(void)
/* Can be very big if MAX_NUMNODES is very big */
if (size < PAGE_SIZE)
- mem = kmalloc(size, GFP_KERNEL);
+ mem = kzalloc(size, GFP_KERNEL);
else
- mem = vmalloc(size);
+ mem = vzalloc(size);
if (!mem)
return NULL;
- memset(mem, 0, size);
mem->stat = alloc_percpu(struct mem_cgroup_stat_cpu);
if (!mem->stat) {
if (size < PAGE_SIZE)
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 5bffada..34970c7 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -450,11 +450,10 @@ int swap_cgroup_swapon(int type, unsigned long max_pages)
length = ((max_pages/SC_PER_PAGE) + 1);
array_size = length * sizeof(void *);
- array = vmalloc(array_size);
+ array = vzalloc(array_size);
if (!array)
goto nomem;
- memset(array, 0, array_size);
ctrl = &swap_cgroup_ctrl[type];
mutex_lock(&swap_cgroup_mutex);
ctrl->length = length;
diff --git a/mm/percpu.c b/mm/percpu.c
index efe8168..9e16d1c 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -293,12 +293,8 @@ static void *pcpu_mem_alloc(size_t size)
if (size <= PAGE_SIZE)
return kzalloc(size, GFP_KERNEL);
- else {
- void *ptr = vmalloc(size);
- if (ptr)
- memset(ptr, 0, size);
- return ptr;
- }
+ else
+ return vzalloc(size);
}
/**
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 67ddaaf..43e6988 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2044,13 +2044,12 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
goto bad_swap;
/* OK, set up the swap map and apply the bad block list */
- swap_map = vmalloc(maxpages);
+ swap_map = vzalloc(maxpages);
if (!swap_map) {
error = -ENOMEM;
goto bad_swap;
}
- memset(swap_map, 0, maxpages);
nr_good_pages = maxpages - 1; /* omit header page */
for (i = 0; i < swap_header->info.nr_badpages; i++) {
--
1.7.3.1.g432b3.dirty
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 45/49] net/core/pktgen.c: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (46 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: David S. Miller, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
net/core/pktgen.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index fbce4b0..ccca6cd 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3706,13 +3706,12 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
return -ENOMEM;
strcpy(pkt_dev->odevname, ifname);
- pkt_dev->flows = vmalloc_node(MAX_CFLOWS * sizeof(struct flow_state),
+ pkt_dev->flows = vzalloc_node(MAX_CFLOWS * sizeof(struct flow_state),
node);
if (pkt_dev->flows == NULL) {
kfree(pkt_dev);
return -ENOMEM;
}
- memset(pkt_dev->flows, 0, MAX_CFLOWS * sizeof(struct flow_state));
pkt_dev->removal_mark = 0;
pkt_dev->min_pkt_size = ETH_ZLEN;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 46/49] net/netfilter: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (47 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
2010-11-05 6:30 ` Eric Dumazet
-1 siblings, 1 reply; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina
Cc: Patrick McHardy, David S. Miller, netfilter-devel, netfilter,
coreteam, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
net/netfilter/x_tables.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 8046350..89e8895 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -753,12 +753,11 @@ static int xt_jumpstack_alloc(struct xt_table_info *i)
size = sizeof(void **) * nr_cpu_ids;
if (size > PAGE_SIZE)
- i->jumpstack = vmalloc(size);
+ i->jumpstack = vzalloc(size);
else
- i->jumpstack = kmalloc(size, GFP_KERNEL);
+ i->jumpstack = kzalloc(size, GFP_KERNEL);
if (i->jumpstack == NULL)
return -ENOMEM;
- memset(i->jumpstack, 0, size);
i->stacksize *= xt_jumpstack_multiplier;
size = sizeof(void *) * i->stacksize;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
2010-11-05 3:08 ` [PATCH 46/49] net/netfilter: " Joe Perches
@ 2010-11-05 6:30 ` Eric Dumazet
2010-11-05 6:55 ` Joe Perches
0 siblings, 1 reply; 153+ messages in thread
From: Eric Dumazet @ 2010-11-05 6:30 UTC (permalink / raw)
To: Joe Perches, Jesper Juhl
Cc: Jiri Kosina, Patrick McHardy, David S. Miller, netfilter-devel,
netfilter, coreteam, netdev, linux-kernel
Le jeudi 04 novembre 2010 à 20:08 -0700, Joe Perches a écrit :
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> net/netfilter/x_tables.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
So many 'vzalloc' patches for net tree...
I had _one_ patch, waiting that David actually had vzalloc() in its tree
before sending it.
Given Jesper Juhl was doing this work, could you please take another
one, please ?
For example, explaining him how to use other tools than "bash+egrep
+manual inspection" as he mentioned in a previous mail.
Really Joe, your behavior should be smarter than that.
Thanks
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
2010-11-05 6:30 ` Eric Dumazet
@ 2010-11-05 6:55 ` Joe Perches
2010-11-05 7:16 ` Eric Dumazet
2010-11-05 15:10 ` Jiri Kosina
0 siblings, 2 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 6:55 UTC (permalink / raw)
To: Eric Dumazet
Cc: Jesper Juhl, Jiri Kosina, Patrick McHardy, David S. Miller,
netfilter-devel, netfilter, coreteam, netdev, linux-kernel
On Fri, 2010-11-05 at 07:30 +0100, Eric Dumazet wrote:
> I had _one_ patch, waiting that David actually had vzalloc() in its tree
> before sending it.
Fine by me, use yours.
> Given Jesper Juhl was doing this work, could you please take another
> one, please ?
> For example, explaining him how to use other tools than "bash+egrep
> +manual inspection" as he mentioned in a previous mail.
Jesper Juhl was both pointed at the cocci docs and
given a cocci script. He said he'd investigate it
when he could. I trust he will get to it.
I think that for this sort of patchset, grep and
manual inspection works just as well as spatch
and likely better because a simple cocci script
doesn't transform code like:
if (size > PAGE_SIZE)
ptr = vmalloc(size);
else
ptr = kmalloc(size, GFP);
if (ptr)
memset(ptr, 0, size);
I did say in the 00 cover that this was broken up
just to cc the maintainers of each block.
I also think a single rolled-up single patch is good.
I believe Jiri Kosina can easily apply all these
individual patches as a single patch if he chooses.
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
2010-11-05 6:55 ` Joe Perches
@ 2010-11-05 7:16 ` Eric Dumazet
2010-11-05 15:10 ` Jiri Kosina
1 sibling, 0 replies; 153+ messages in thread
From: Eric Dumazet @ 2010-11-05 7:16 UTC (permalink / raw)
To: Joe Perches
Cc: Jesper Juhl, Jiri Kosina, Patrick McHardy, David S. Miller,
netfilter-devel, netfilter, coreteam, netdev, linux-kernel
Le jeudi 04 novembre 2010 à 23:55 -0700, Joe Perches a écrit :
> On Fri, 2010-11-05 at 07:30 +0100, Eric Dumazet wrote:
> > I had _one_ patch, waiting that David actually had vzalloc() in its tree
> > before sending it.
>
> Fine by me, use yours.
I dont care at all, only to say that David tree was not ready yet.
>
> > Given Jesper Juhl was doing this work, could you please take another
> > one, please ?
> > For example, explaining him how to use other tools than "bash+egrep
> > +manual inspection" as he mentioned in a previous mail.
>
> Jesper Juhl was both pointed at the cocci docs and
> given a cocci script. He said he'd investigate it
> when he could. I trust he will get to it.
>
Yes, yet you posted patches, knowing he was working on the _same_
subject.
I remember other occurrences of such behavior.
I find this behavior very unfriendly, time consuming, and not useful.
We try to work together, to increase our common knowledge, not to throw
a bunch of patches "just because I know better than you"
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
@ 2010-11-05 7:16 ` Eric Dumazet
0 siblings, 0 replies; 153+ messages in thread
From: Eric Dumazet @ 2010-11-05 7:16 UTC (permalink / raw)
To: Joe Perches
Cc: Jesper Juhl, Jiri Kosina, Patrick McHardy, David S. Miller,
netfilter-devel, netfilter, coreteam, netdev, linux-kernel
Le jeudi 04 novembre 2010 à 23:55 -0700, Joe Perches a écrit :
> On Fri, 2010-11-05 at 07:30 +0100, Eric Dumazet wrote:
> > I had _one_ patch, waiting that David actually had vzalloc() in its tree
> > before sending it.
>
> Fine by me, use yours.
I dont care at all, only to say that David tree was not ready yet.
>
> > Given Jesper Juhl was doing this work, could you please take another
> > one, please ?
> > For example, explaining him how to use other tools than "bash+egrep
> > +manual inspection" as he mentioned in a previous mail.
>
> Jesper Juhl was both pointed at the cocci docs and
> given a cocci script. He said he'd investigate it
> when he could. I trust he will get to it.
>
Yes, yet you posted patches, knowing he was working on the _same_
subject.
I remember other occurrences of such behavior.
I find this behavior very unfriendly, time consuming, and not useful.
We try to work together, to increase our common knowledge, not to throw
a bunch of patches "just because I know better than you"
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
2010-11-05 7:16 ` Eric Dumazet
(?)
@ 2010-11-05 17:01 ` Jesper Juhl
-1 siblings, 0 replies; 153+ messages in thread
From: Jesper Juhl @ 2010-11-05 17:01 UTC (permalink / raw)
To: Eric Dumazet, Joe Perches
Cc: Jiri Kosina, Patrick McHardy, David S. Miller, netfilter-devel,
netfilter, coreteam, netdev, linux-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2136 bytes --]
On Fri, 5 Nov 2010, Eric Dumazet wrote:
> Le jeudi 04 novembre 2010 à 23:55 -0700, Joe Perches a écrit :
> > On Fri, 2010-11-05 at 07:30 +0100, Eric Dumazet wrote:
> > > I had _one_ patch, waiting that David actually had vzalloc() in its tree
> > > before sending it.
> >
> > Fine by me, use yours.
>
> I dont care at all, only to say that David tree was not ready yet.
>
>
> >
> > > Given Jesper Juhl was doing this work, could you please take another
> > > one, please ?
> > > For example, explaining him how to use other tools than "bash+egrep
> > > +manual inspection" as he mentioned in a previous mail.
> >
> > Jesper Juhl was both pointed at the cocci docs and
> > given a cocci script. He said he'd investigate it
> > when he could. I trust he will get to it.
> >
>
> Yes, yet you posted patches, knowing he was working on the _same_
> subject.
>
And I will get to look at cocci and spatch, they are definately tools that
I want in my arsenal.
> I remember other occurrences of such behavior.
>
> I find this behavior very unfriendly, time consuming, and not useful.
>
> We try to work together, to increase our common knowledge, not to throw
> a bunch of patches "just because I know better than you"
>
To be completely honest, I did get the feeling that the task I'd set for
myself and was having fun doing in the little spare time I have got
hijacked and I did waste about an hour and a half doing a few more
cleanups before I saw the patchset on lkml.
But on the other hand, the most important thing is that it gets done, not
who ends up doing it - especially since it's such a trivial cleanup, so I
choose to see it as my initial patches just getting the ball rolling.
It would have been nice with at least an email along the lines of "I
know how we can do all those patches in a jiffy, mind if I just go along
and do that?", but I'll live. There's plenty of other stuff to do :-)
--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Plain text mails only, please http://www.expita.com/nomime.html
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
2010-11-05 6:55 ` Joe Perches
2010-11-05 7:16 ` Eric Dumazet
@ 2010-11-05 15:10 ` Jiri Kosina
2010-11-05 15:25 ` Joe Perches
1 sibling, 1 reply; 153+ messages in thread
From: Jiri Kosina @ 2010-11-05 15:10 UTC (permalink / raw)
To: Joe Perches
Cc: Eric Dumazet, Jesper Juhl, Patrick McHardy, David S. Miller,
netfilter-devel, netfilter, coreteam, netdev, linux-kernel
On Thu, 4 Nov 2010, Joe Perches wrote:
> I also think a single rolled-up single patch is good.
>
> I believe Jiri Kosina can easily apply all these individual patches as a
> single patch if he chooses.
I will, after this settles a little bit (the same for the WARN series).
I prefer waiting a bit before applying your patches usually.
First to see what lands in linux-next through maintainer's trees, second
to gather Acks.
--
Jiri Kosina
SUSE Labs, Novell Inc.
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
2010-11-05 15:10 ` Jiri Kosina
@ 2010-11-05 15:25 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 15:25 UTC (permalink / raw)
To: Jiri Kosina
Cc: Eric Dumazet, Jesper Juhl, Patrick McHardy, David S. Miller,
netfilter-devel, netfilter, coreteam, netdev, linux-kernel
On Fri, 2010-11-05 at 11:10 -0400, Jiri Kosina wrote:
> On Thu, 4 Nov 2010, Joe Perches wrote:
> > I also think a single rolled-up single patch is good.
> > I believe Jiri Kosina can easily apply all these individual patches as a
> > single patch if he chooses.
> I will, after this settles a little bit (the same for the WARN series).
> I prefer waiting a bit before applying your patches usually.
> First to see what lands in linux-next through maintainer's trees, second
> to gather Acks.
I think that's the right way to do these
sorts of trivial changes too.
Individual patches cc'd to maintainers for
feedback, improvement, acks or to be directly
applied to their trees, followed by a longish
delay before any unapplied patches are taken
up as a single patch by your trivial queue.
Thanks for doing that work Jiri.
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 47/49] net/rds: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (48 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Andy Grover, David S. Miller, rds-devel, netdev, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
net/rds/ib_cm.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index ee369d2..cc6b073 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -374,23 +374,21 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
goto out;
}
- ic->i_sends = vmalloc_node(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work),
+ ic->i_sends = vzalloc_node(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work),
ibdev_to_node(dev));
if (!ic->i_sends) {
ret = -ENOMEM;
rdsdebug("send allocation failed\n");
goto out;
}
- memset(ic->i_sends, 0, ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work));
- ic->i_recvs = vmalloc_node(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work),
+ ic->i_recvs = vzalloc_node(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work),
ibdev_to_node(dev));
if (!ic->i_recvs) {
ret = -ENOMEM;
rdsdebug("recv allocation failed\n");
goto out;
}
- memset(ic->i_recvs, 0, ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work));
rds_ib_recv_init_ack(ic);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH 48/49] sound/oss/dev_table.c: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (49 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
2010-11-22 6:59 ` Takashi Iwai
-1 siblings, 1 reply; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
sound/oss/dev_table.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/oss/dev_table.c b/sound/oss/dev_table.c
index 727bdb9..d8cf3e5 100644
--- a/sound/oss/dev_table.c
+++ b/sound/oss/dev_table.c
@@ -71,7 +71,7 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
if (sound_nblocks >= MAX_MEM_BLOCKS)
sound_nblocks = MAX_MEM_BLOCKS - 1;
- op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations)));
+ op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct audio_operations)));
sound_nblocks++;
if (sound_nblocks >= MAX_MEM_BLOCKS)
sound_nblocks = MAX_MEM_BLOCKS - 1;
@@ -81,7 +81,6 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
sound_unload_audiodev(num);
return -(ENOMEM);
}
- memset((char *) op, 0, sizeof(struct audio_operations));
init_waitqueue_head(&op->in_sleeper);
init_waitqueue_head(&op->out_sleeper);
init_waitqueue_head(&op->poll_sleeper);
@@ -128,7 +127,7 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
/* FIXME: This leaks a mixer_operations struct every time its called
until you unload sound! */
- op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations)));
+ op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct mixer_operations)));
sound_nblocks++;
if (sound_nblocks >= MAX_MEM_BLOCKS)
sound_nblocks = MAX_MEM_BLOCKS - 1;
@@ -137,7 +136,6 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name);
return -ENOMEM;
}
- memset((char *) op, 0, sizeof(struct mixer_operations));
memcpy((char *) op, (char *) driver, driver_size);
strlcpy(op->name, name, sizeof(op->name));
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 48/49] sound/oss/dev_table.c: Use vzalloc
2010-11-05 3:08 ` [PATCH 48/49] sound/oss/dev_table.c: " Joe Perches
@ 2010-11-22 6:59 ` Takashi Iwai
0 siblings, 0 replies; 153+ messages in thread
From: Takashi Iwai @ 2010-11-22 6:59 UTC (permalink / raw)
To: Joe Perches; +Cc: Jiri Kosina, Jaroslav Kysela, alsa-devel, linux-kernel
At Thu, 4 Nov 2010 20:08:12 -0700,
Joe Perches wrote:
>
> Signed-off-by: Joe Perches <joe@perches.com>
Thanks, applied.
[Sorry to be late, this has been already applied in my tree but this
reply mail wasn't triggered to be sent out until now...]
Takashi
> ---
> sound/oss/dev_table.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/sound/oss/dev_table.c b/sound/oss/dev_table.c
> index 727bdb9..d8cf3e5 100644
> --- a/sound/oss/dev_table.c
> +++ b/sound/oss/dev_table.c
> @@ -71,7 +71,7 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
> if (sound_nblocks >= MAX_MEM_BLOCKS)
> sound_nblocks = MAX_MEM_BLOCKS - 1;
>
> - op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations)));
> + op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct audio_operations)));
> sound_nblocks++;
> if (sound_nblocks >= MAX_MEM_BLOCKS)
> sound_nblocks = MAX_MEM_BLOCKS - 1;
> @@ -81,7 +81,6 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
> sound_unload_audiodev(num);
> return -(ENOMEM);
> }
> - memset((char *) op, 0, sizeof(struct audio_operations));
> init_waitqueue_head(&op->in_sleeper);
> init_waitqueue_head(&op->out_sleeper);
> init_waitqueue_head(&op->poll_sleeper);
> @@ -128,7 +127,7 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
> /* FIXME: This leaks a mixer_operations struct every time its called
> until you unload sound! */
>
> - op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations)));
> + op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct mixer_operations)));
> sound_nblocks++;
> if (sound_nblocks >= MAX_MEM_BLOCKS)
> sound_nblocks = MAX_MEM_BLOCKS - 1;
> @@ -137,7 +136,6 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
> printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name);
> return -ENOMEM;
> }
> - memset((char *) op, 0, sizeof(struct mixer_operations));
> memcpy((char *) op, (char *) driver, driver_size);
>
> strlcpy(op->name, name, sizeof(op->name));
> --
> 1.7.3.1.g432b3.dirty
>
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 48/49] sound/oss/dev_table.c: Use vzalloc
@ 2010-11-22 6:59 ` Takashi Iwai
0 siblings, 0 replies; 153+ messages in thread
From: Takashi Iwai @ 2010-11-22 6:59 UTC (permalink / raw)
To: Joe Perches; +Cc: alsa-devel, Jiri Kosina, linux-kernel
At Thu, 4 Nov 2010 20:08:12 -0700,
Joe Perches wrote:
>
> Signed-off-by: Joe Perches <joe@perches.com>
Thanks, applied.
[Sorry to be late, this has been already applied in my tree but this
reply mail wasn't triggered to be sent out until now...]
Takashi
> ---
> sound/oss/dev_table.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/sound/oss/dev_table.c b/sound/oss/dev_table.c
> index 727bdb9..d8cf3e5 100644
> --- a/sound/oss/dev_table.c
> +++ b/sound/oss/dev_table.c
> @@ -71,7 +71,7 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
> if (sound_nblocks >= MAX_MEM_BLOCKS)
> sound_nblocks = MAX_MEM_BLOCKS - 1;
>
> - op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations)));
> + op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct audio_operations)));
> sound_nblocks++;
> if (sound_nblocks >= MAX_MEM_BLOCKS)
> sound_nblocks = MAX_MEM_BLOCKS - 1;
> @@ -81,7 +81,6 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
> sound_unload_audiodev(num);
> return -(ENOMEM);
> }
> - memset((char *) op, 0, sizeof(struct audio_operations));
> init_waitqueue_head(&op->in_sleeper);
> init_waitqueue_head(&op->out_sleeper);
> init_waitqueue_head(&op->poll_sleeper);
> @@ -128,7 +127,7 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
> /* FIXME: This leaks a mixer_operations struct every time its called
> until you unload sound! */
>
> - op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations)));
> + op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct mixer_operations)));
> sound_nblocks++;
> if (sound_nblocks >= MAX_MEM_BLOCKS)
> sound_nblocks = MAX_MEM_BLOCKS - 1;
> @@ -137,7 +136,6 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
> printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name);
> return -ENOMEM;
> }
> - memset((char *) op, 0, sizeof(struct mixer_operations));
> memcpy((char *) op, (char *) driver, driver_size);
>
> strlcpy(op->name, name, sizeof(op->name));
> --
> 1.7.3.1.g432b3.dirty
>
^ permalink raw reply [flat|nested] 153+ messages in thread
* [PATCH 49/49] virt/kvm/kvm_main.c: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (50 preceding siblings ...)
(?)
@ 2010-11-05 3:08 ` Joe Perches
2010-11-05 4:25 ` Takuya Yoshikawa
-1 siblings, 1 reply; 153+ messages in thread
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Avi Kivity, Marcelo Tosatti, kvm, linux-kernel
Signed-off-by: Joe Perches <joe@perches.com>
---
virt/kvm/kvm_main.c | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 5225052..c2a08e6e 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -604,13 +604,10 @@ int __kvm_set_memory_region(struct kvm *kvm,
/* Allocate if a slot is being created */
#ifndef CONFIG_S390
if (npages && !new.rmap) {
- new.rmap = vmalloc(npages * sizeof(*new.rmap));
-
+ new.rmap = vzalloc(npages * sizeof(*new.rmap));
if (!new.rmap)
goto out_free;
- memset(new.rmap, 0, npages * sizeof(*new.rmap));
-
new.user_alloc = user_alloc;
new.userspace_addr = mem->userspace_addr;
}
@@ -633,14 +630,11 @@ int __kvm_set_memory_region(struct kvm *kvm,
>> KVM_HPAGE_GFN_SHIFT(level));
lpages -= base_gfn >> KVM_HPAGE_GFN_SHIFT(level);
- new.lpage_info[i] = vmalloc(lpages * sizeof(*new.lpage_info[i]));
+ new.lpage_info[i] = vzalloc(lpages * sizeof(*new.lpage_info[i]));
if (!new.lpage_info[i])
goto out_free;
- memset(new.lpage_info[i], 0,
- lpages * sizeof(*new.lpage_info[i]));
-
if (base_gfn & (KVM_PAGES_PER_HPAGE(level) - 1))
new.lpage_info[i][0].write_count = 1;
if ((base_gfn+npages) & (KVM_PAGES_PER_HPAGE(level) - 1))
@@ -663,10 +657,9 @@ skip_lpage:
if ((new.flags & KVM_MEM_LOG_DIRTY_PAGES) && !new.dirty_bitmap) {
unsigned long dirty_bytes = kvm_dirty_bitmap_bytes(&new);
- new.dirty_bitmap = vmalloc(dirty_bytes);
+ new.dirty_bitmap = vzalloc(dirty_bytes);
if (!new.dirty_bitmap)
goto out_free;
- memset(new.dirty_bitmap, 0, dirty_bytes);
/* destroy any largepage mappings for dirty tracking */
if (old.npages)
flush_shadow = 1;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread
* Re: [PATCH 49/49] virt/kvm/kvm_main.c: Use vzalloc
2010-11-05 3:08 ` [PATCH 49/49] virt/kvm/kvm_main.c: " Joe Perches
@ 2010-11-05 4:25 ` Takuya Yoshikawa
2010-11-05 4:44 ` Joe Perches
0 siblings, 1 reply; 153+ messages in thread
From: Takuya Yoshikawa @ 2010-11-05 4:25 UTC (permalink / raw)
To: Joe Perches; +Cc: Jiri Kosina, Avi Kivity, Marcelo Tosatti, kvm, linux-kernel
(2010/11/05 12:08), Joe Perches wrote:
> Signed-off-by: Joe Perches<joe@perches.com>
> ---
> virt/kvm/kvm_main.c | 13 +++----------
> 1 files changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
Already changed to vzalloc(), see kvm.git.
Takuya
> index 5225052..c2a08e6e 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -604,13 +604,10 @@ int __kvm_set_memory_region(struct kvm *kvm,
> /* Allocate if a slot is being created */
> #ifndef CONFIG_S390
> if (npages&& !new.rmap) {
> - new.rmap = vmalloc(npages * sizeof(*new.rmap));
> -
> + new.rmap = vzalloc(npages * sizeof(*new.rmap));
> if (!new.rmap)
> goto out_free;
>
> - memset(new.rmap, 0, npages * sizeof(*new.rmap));
> -
> new.user_alloc = user_alloc;
> new.userspace_addr = mem->userspace_addr;
> }
> @@ -633,14 +630,11 @@ int __kvm_set_memory_region(struct kvm *kvm,
> >> KVM_HPAGE_GFN_SHIFT(level));
> lpages -= base_gfn>> KVM_HPAGE_GFN_SHIFT(level);
>
> - new.lpage_info[i] = vmalloc(lpages * sizeof(*new.lpage_info[i]));
> + new.lpage_info[i] = vzalloc(lpages * sizeof(*new.lpage_info[i]));
>
> if (!new.lpage_info[i])
> goto out_free;
>
> - memset(new.lpage_info[i], 0,
> - lpages * sizeof(*new.lpage_info[i]));
> -
> if (base_gfn& (KVM_PAGES_PER_HPAGE(level) - 1))
> new.lpage_info[i][0].write_count = 1;
> if ((base_gfn+npages)& (KVM_PAGES_PER_HPAGE(level) - 1))
> @@ -663,10 +657,9 @@ skip_lpage:
> if ((new.flags& KVM_MEM_LOG_DIRTY_PAGES)&& !new.dirty_bitmap) {
> unsigned long dirty_bytes = kvm_dirty_bitmap_bytes(&new);
>
> - new.dirty_bitmap = vmalloc(dirty_bytes);
> + new.dirty_bitmap = vzalloc(dirty_bytes);
> if (!new.dirty_bitmap)
> goto out_free;
> - memset(new.dirty_bitmap, 0, dirty_bytes);
> /* destroy any largepage mappings for dirty tracking */
> if (old.npages)
> flush_shadow = 1;
^ permalink raw reply [flat|nested] 153+ messages in thread
* Re: [PATCH 49/49] virt/kvm/kvm_main.c: Use vzalloc
2010-11-05 4:25 ` Takuya Yoshikawa
@ 2010-11-05 4:44 ` Joe Perches
0 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 4:44 UTC (permalink / raw)
To: Takuya Yoshikawa
Cc: Jiri Kosina, Avi Kivity, Marcelo Tosatti, kvm, linux-kernel
On Fri, 2010-11-05 at 13:25 +0900, Takuya Yoshikawa wrote:
> (2010/11/05 12:08), Joe Perches wrote:
> > Signed-off-by: Joe Perches<joe@perches.com>
> > ---
> > virt/kvm/kvm_main.c | 13 +++----------
> > 1 files changed, 3 insertions(+), 10 deletions(-)
> >
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>
> Already changed to vzalloc(), see kvm.git.
Thanks. No worries.
fyi: the kvm git isn't in MAINTAINERS.
Perhaps something like this is appropriate
---
MAINTAINERS | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index ec7e4a4..73bfe4f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3443,6 +3443,7 @@ M: Avi Kivity <avi@redhat.com>
M: Marcelo Tosatti <mtosatti@redhat.com>
L: kvm@vger.kernel.org
W: http://kvm.qumranet.com
+T: git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
S: Supported
F: Documentation/*/kvm.txt
F: arch/*/kvm/
^ permalink raw reply related [flat|nested] 153+ messages in thread
* [PATCH V2 36/49] drivers/video: Use vzalloc
2010-11-05 3:07 ` Joe Perches
` (51 preceding siblings ...)
(?)
@ 2010-11-05 5:31 ` Joe Perches
-1 siblings, 0 replies; 153+ messages in thread
From: Joe Perches @ 2010-11-05 5:31 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jaya Kumar, Jeremy Fitzhardinge, Konrad Rzeszutek Wilk,
linux-kernel, xen-devel, virtualization
Signed-off-by: Joe Perches <joe@perches.com>
---
V2 - Fixed vmalloc/vzalloc typo
Thanks to Dave Young for noticing.
drivers/video/arcfb.c | 5 ++---
drivers/video/broadsheetfb.c | 4 +---
drivers/video/hecubafb.c | 5 ++---
drivers/video/metronomefb.c | 4 +---
drivers/video/xen-fbfront.c | 3 +--
5 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 3ec4923..86573e2 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
/* We need a flat backing store for the Arc's
less-flat actual paged framebuffer */
- if (!(videomemory = vmalloc(videomemorysize)))
+ videomemory = vzalloc(videomemorysize);
+ if (!videomemory)
return retval;
- memset(videomemory, 0, videomemorysize);
-
info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
if (!info)
goto err;
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index ebda687..377dde3 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -1101,12 +1101,10 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
videomemorysize = roundup((dpyw*dpyh), PAGE_SIZE);
- videomemory = vmalloc(videomemorysize);
+ videomemory = vzalloc(videomemorysize);
if (!videomemory)
goto err_fb_rel;
- memset(videomemory, 0, videomemorysize);
-
info->screen_base = (char *)videomemory;
info->fbops = &broadsheetfb_ops;
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index c77bcc6..a941e6f 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -231,11 +231,10 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
videomemorysize = (DPY_W*DPY_H)/8;
- if (!(videomemory = vmalloc(videomemorysize)))
+ videomemory = vzalloc(videomemorysize);
+ if (!videomemory)
return retval;
- memset(videomemory, 0, videomemorysize);
-
info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev);
if (!info)
goto err_fballoc;
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
index 63ed3b7..c0c358c 100644
--- a/drivers/video/metronomefb.c
+++ b/drivers/video/metronomefb.c
@@ -628,12 +628,10 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
/* we need to add a spare page because our csum caching scheme walks
* to the end of the page */
videomemorysize = PAGE_SIZE + (fw * fh);
- videomemory = vmalloc(videomemorysize);
+ videomemory = vzalloc(videomemorysize);
if (!videomemory)
goto err_fb_rel;
- memset(videomemory, 0, videomemorysize);
-
info->screen_base = (char __force __iomem *)videomemory;
info->fbops = &metronomefb_ops;
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 428d273..81fcaea 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -395,10 +395,9 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
spin_lock_init(&info->dirty_lock);
spin_lock_init(&info->resize_lock);
- info->fb = vmalloc(fb_size);
+ info->fb = vzalloc(fb_size);
if (info->fb == NULL)
goto error_nomem;
- memset(info->fb, 0, fb_size);
info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 153+ messages in thread