The patch titled powerpc: replace kmalloc+memset with kzalloc has been added to the -mm tree. Its filename is powerpc-replace-kmallocmemset-with-kzalloc.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: powerpc: replace kmalloc+memset with kzalloc From: Yan Burman <burman.yan@xxxxxxxxx> Replace kmalloc+memset with kzalloc Signed-off-by: Yan Burman <burman.yan@xxxxxxxxx> Cc: Paul Mackerras <paulus@xxxxxxxxx> Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/powerpc/kernel/ibmebus.c | 3 +-- arch/powerpc/kernel/of_device.c | 3 +-- arch/powerpc/kernel/pci_64.c | 3 +-- arch/powerpc/kernel/rtas_flash.c | 4 +--- arch/powerpc/kernel/smp-tbsync.c | 3 +-- arch/powerpc/platforms/iseries/iommu.c | 4 +--- arch/powerpc/platforms/iseries/viopath.c | 3 +-- arch/powerpc/platforms/pseries/reconfig.c | 3 +-- arch/powerpc/sysdev/qe_lib/ucc_fast.c | 4 +--- arch/powerpc/sysdev/qe_lib/ucc_slow.c | 4 +--- 10 files changed, 10 insertions(+), 24 deletions(-) diff -puN arch/powerpc/kernel/ibmebus.c~powerpc-replace-kmallocmemset-with-kzalloc arch/powerpc/kernel/ibmebus.c --- a/arch/powerpc/kernel/ibmebus.c~powerpc-replace-kmallocmemset-with-kzalloc +++ a/arch/powerpc/kernel/ibmebus.c @@ -210,11 +210,10 @@ static struct ibmebus_dev* __devinit ibm return NULL; } - dev = kmalloc(sizeof(struct ibmebus_dev), GFP_KERNEL); + dev = kzalloc(sizeof(struct ibmebus_dev), GFP_KERNEL); if (!dev) { return NULL; } - memset(dev, 0, sizeof(struct ibmebus_dev)); dev->ofdev.node = of_node_get(dn); diff -puN arch/powerpc/kernel/of_device.c~powerpc-replace-kmallocmemset-with-kzalloc arch/powerpc/kernel/of_device.c --- a/arch/powerpc/kernel/of_device.c~powerpc-replace-kmallocmemset-with-kzalloc +++ a/arch/powerpc/kernel/of_device.c @@ -214,10 +214,9 @@ struct of_device* of_platform_device_cre { struct of_device *dev; - dev = kmalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) return NULL; - memset(dev, 0, sizeof(*dev)); dev->node = of_node_get(np); dev->dma_mask = 0xffffffffUL; diff -puN arch/powerpc/kernel/pci_64.c~powerpc-replace-kmallocmemset-with-kzalloc arch/powerpc/kernel/pci_64.c --- a/arch/powerpc/kernel/pci_64.c~powerpc-replace-kmallocmemset-with-kzalloc +++ a/arch/powerpc/kernel/pci_64.c @@ -329,7 +329,7 @@ struct pci_dev *of_create_pci_dev(struct struct pci_dev *dev; const char *type; - dev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); + dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); if (!dev) return NULL; type = get_property(node, "device_type", NULL); @@ -338,7 +338,6 @@ struct pci_dev *of_create_pci_dev(struct DBG(" create device, devfn: %x, type: %s\n", devfn, type); - memset(dev, 0, sizeof(struct pci_dev)); dev->bus = bus; dev->sysdata = node; dev->dev.parent = bus->bridge; diff -puN arch/powerpc/kernel/rtas_flash.c~powerpc-replace-kmallocmemset-with-kzalloc arch/powerpc/kernel/rtas_flash.c --- a/arch/powerpc/kernel/rtas_flash.c~powerpc-replace-kmallocmemset-with-kzalloc +++ a/arch/powerpc/kernel/rtas_flash.c @@ -681,14 +681,12 @@ static int initialize_flash_pde_data(con int *status; int token; - dp->data = kmalloc(buf_size, GFP_KERNEL); + dp->data = kzalloc(buf_size, GFP_KERNEL); if (dp->data == NULL) { remove_flash_pde(dp); return -ENOMEM; } - memset(dp->data, 0, buf_size); - /* * This code assumes that the status int is the first member of the * struct diff -puN arch/powerpc/kernel/smp-tbsync.c~powerpc-replace-kmallocmemset-with-kzalloc arch/powerpc/kernel/smp-tbsync.c --- a/arch/powerpc/kernel/smp-tbsync.c~powerpc-replace-kmallocmemset-with-kzalloc +++ a/arch/powerpc/kernel/smp-tbsync.c @@ -116,8 +116,7 @@ void __devinit smp_generic_give_timebase printk("Synchronizing timebase\n"); /* if this fails then this kernel won't work anyway... */ - tbsync = kmalloc( sizeof(*tbsync), GFP_KERNEL ); - memset( tbsync, 0, sizeof(*tbsync) ); + tbsync = kzalloc( sizeof(*tbsync), GFP_KERNEL ); mb(); running = 1; diff -puN arch/powerpc/platforms/iseries/iommu.c~powerpc-replace-kmallocmemset-with-kzalloc arch/powerpc/platforms/iseries/iommu.c --- a/arch/powerpc/platforms/iseries/iommu.c~powerpc-replace-kmallocmemset-with-kzalloc +++ a/arch/powerpc/platforms/iseries/iommu.c @@ -114,12 +114,10 @@ void iommu_table_getparms_iSeries(unsign { struct iommu_table_cb *parms; - parms = kmalloc(sizeof(*parms), GFP_KERNEL); + parms = kzalloc(sizeof(*parms), GFP_KERNEL); if (parms == NULL) panic("PCI_DMA: TCE Table Allocation failed."); - memset(parms, 0, sizeof(*parms)); - parms->itc_busno = busno; parms->itc_slotno = slotno; parms->itc_virtbus = virtbus; diff -puN arch/powerpc/platforms/iseries/viopath.c~powerpc-replace-kmallocmemset-with-kzalloc arch/powerpc/platforms/iseries/viopath.c --- a/arch/powerpc/platforms/iseries/viopath.c~powerpc-replace-kmallocmemset-with-kzalloc +++ a/arch/powerpc/platforms/iseries/viopath.c @@ -119,10 +119,9 @@ static int proc_viopath_show(struct seq_ struct device_node *node; const char *sysid; - buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL); + buf = kzalloc(HW_PAGE_SIZE, GFP_KERNEL); if (!buf) return 0; - memset(buf, 0, HW_PAGE_SIZE); handle = dma_map_single(iSeries_vio_dev, buf, HW_PAGE_SIZE, DMA_FROM_DEVICE); diff -puN arch/powerpc/platforms/pseries/reconfig.c~powerpc-replace-kmallocmemset-with-kzalloc arch/powerpc/platforms/pseries/reconfig.c --- a/arch/powerpc/platforms/pseries/reconfig.c~powerpc-replace-kmallocmemset-with-kzalloc +++ a/arch/powerpc/platforms/pseries/reconfig.c @@ -268,11 +268,10 @@ static char * parse_next_property(char * static struct property *new_property(const char *name, const int length, const unsigned char *value, struct property *last) { - struct property *new = kmalloc(sizeof(*new), GFP_KERNEL); + struct property *new = kzalloc(sizeof(*new), GFP_KERNEL); if (!new) return NULL; - memset(new, 0, sizeof(*new)); if (!(new->name = kmalloc(strlen(name) + 1, GFP_KERNEL))) goto cleanup; diff -puN arch/powerpc/sysdev/qe_lib/ucc_fast.c~powerpc-replace-kmallocmemset-with-kzalloc arch/powerpc/sysdev/qe_lib/ucc_fast.c --- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c~powerpc-replace-kmallocmemset-with-kzalloc +++ a/arch/powerpc/sysdev/qe_lib/ucc_fast.c @@ -216,14 +216,12 @@ int ucc_fast_init(struct ucc_fast_info * return -EINVAL; } - uccf = (struct ucc_fast_private *) - kmalloc(sizeof(struct ucc_fast_private), GFP_KERNEL); + uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL); if (!uccf) { uccf_err ("ucc_fast_init: No memory for UCC slow data structure!"); return -ENOMEM; } - memset(uccf, 0, sizeof(struct ucc_fast_private)); /* Fill fast UCC structure */ uccf->uf_info = uf_info; diff -puN arch/powerpc/sysdev/qe_lib/ucc_slow.c~powerpc-replace-kmallocmemset-with-kzalloc arch/powerpc/sysdev/qe_lib/ucc_slow.c --- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c~powerpc-replace-kmallocmemset-with-kzalloc +++ a/arch/powerpc/sysdev/qe_lib/ucc_slow.c @@ -168,14 +168,12 @@ int ucc_slow_init(struct ucc_slow_info * return -EINVAL; } - uccs = (struct ucc_slow_private *) - kmalloc(sizeof(struct ucc_slow_private), GFP_KERNEL); + uccs = kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL); if (!uccs) { uccs_err ("ucc_slow_init: No memory for UCC slow data structure!"); return -ENOMEM; } - memset(uccs, 0, sizeof(struct ucc_slow_private)); /* Fill slow UCC structure */ uccs->us_info = us_info; _ Patches currently in -mm which might be from burman.yan@xxxxxxxxx are reiser-replace-kmallocmemset-with-kzalloc.patch nfsd-replace-kmallocmemset-with-kcalloc.patch jffs2-replace-kmallocmemset-with-kzalloc.patch affs-replace-kmallocmemset-with-kzalloc.patch ia64-replace-kmallocmemset-with-kzalloc.patch arm26-replace-kmallocmemset-with-kzalloc.patch powerpc-replace-kmallocmemset-with-kzalloc.patch m68k-replace-kmallocmemset-with-kzalloc.patch jffs-replace-kmallocmemset-with-kzalloc.patch hostap-replace-kmallocmemset-with-kzalloc.patch prism54-replace-kmallocmemset-with-kzalloc.patch ipw2200-replace-kmallocmemset-with-kcalloc.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html