Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8485350 authored by Yan Burman's avatar Yan Burman Committed by Paul Mackerras
Browse files

[POWERPC] Replace kmalloc+memset with kzalloc



Replace kmalloc+memset with kzalloc.

Signed-off-by: default avatarYan Burman <burman.yan@gmail.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 04d76b93
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -214,11 +214,10 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_node(
		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);
       
+1 −2
Original line number Diff line number Diff line
@@ -330,7 +330,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
	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);
@@ -339,7 +339,6 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,

	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;
+1 −3
Original line number Diff line number Diff line
@@ -681,14 +681,12 @@ static int initialize_flash_pde_data(const char *rtas_call_name,
	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 
+1 −2
Original line number Diff line number Diff line
@@ -116,8 +116,7 @@ void __devinit smp_generic_give_timebase(void)
	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;

+1 −3
Original line number Diff line number Diff line
@@ -115,12 +115,10 @@ void iommu_table_getparms_iSeries(unsigned long busno,
{
	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;
Loading