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

Commit 9132983a authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by David S. Miller
Browse files

[SPARC64]: kzalloc() conversion



this patch converts arch/sparc64 to kzalloc usage.
Crosscompile tested with allyesconfig.

Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f7c00338
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -277,10 +277,9 @@ static inline void *ebus_alloc(size_t size)
{
	void *mem;

	mem = kmalloc(size, GFP_ATOMIC);
	mem = kzalloc(size, GFP_ATOMIC);
	if (!mem)
		panic("ebus_alloc: out of memory");
	memset((char *)mem, 0, size);
	return mem;
}

+2 −4
Original line number Diff line number Diff line
@@ -316,12 +316,11 @@ unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long
		goto out;
	}

	bucket->irq_info = kmalloc(sizeof(struct irq_desc), GFP_ATOMIC);
	bucket->irq_info = kzalloc(sizeof(struct irq_desc), GFP_ATOMIC);
	if (!bucket->irq_info) {
		prom_printf("IRQ: Error, kmalloc(irq_desc) failed.\n");
		prom_halt();
	}
	memset(bucket->irq_info, 0, sizeof(struct irq_desc));

	/* Ok, looks good, set it up.  Don't touch the irq_chain or
	 * the pending flag.
@@ -357,12 +356,11 @@ unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino, int pil, unsign
	bucket->pil = pil;
	bucket->flags = flags;

	bucket->irq_info = kmalloc(sizeof(struct irq_desc), GFP_ATOMIC);
	bucket->irq_info = kzalloc(sizeof(struct irq_desc), GFP_ATOMIC);
	if (!bucket->irq_info) {
		prom_printf("IRQ: Error, kmalloc(irq_desc) failed.\n");
		prom_halt();
	}
	memset(bucket->irq_info, 0, sizeof(struct irq_desc));

	return __irq(bucket);
}
+3 −6
Original line number Diff line number Diff line
@@ -977,33 +977,30 @@ void pci_register_legacy_regions(struct resource *io_res,
	struct resource *p;

	/* VGA Video RAM. */
	p = kmalloc(sizeof(*p), GFP_KERNEL);
	p = kzalloc(sizeof(*p), GFP_KERNEL);
	if (!p)
		return;

	memset(p, 0, sizeof(*p));
	p->name = "Video RAM area";
	p->start = mem_res->start + 0xa0000UL;
	p->end = p->start + 0x1ffffUL;
	p->flags = IORESOURCE_BUSY;
	request_resource(mem_res, p);

	p = kmalloc(sizeof(*p), GFP_KERNEL);
	p = kzalloc(sizeof(*p), GFP_KERNEL);
	if (!p)
		return;

	memset(p, 0, sizeof(*p));
	p->name = "System ROM";
	p->start = mem_res->start + 0xf0000UL;
	p->end = p->start + 0xffffUL;
	p->flags = IORESOURCE_BUSY;
	request_resource(mem_res, p);

	p = kmalloc(sizeof(*p), GFP_KERNEL);
	p = kzalloc(sizeof(*p), GFP_KERNEL);
	if (!p)
		return;

	memset(p, 0, sizeof(*p));
	p->name = "Video ROM";
	p->start = mem_res->start + 0xc0000UL;
	p->end = p->start + 0x7fffUL;
+1 −2
Original line number Diff line number Diff line
@@ -139,12 +139,11 @@ void pci_iommu_table_init(struct pci_iommu *iommu, int tsbsize, u32 dma_offset,
	/* Allocate and initialize the free area map.  */
	sz = num_tsb_entries / 8;
	sz = (sz + 7UL) & ~7UL;
	iommu->arena.map = kmalloc(sz, GFP_KERNEL);
	iommu->arena.map = kzalloc(sz, GFP_KERNEL);
	if (!iommu->arena.map) {
		prom_printf("PCI_IOMMU: Error, kmalloc(arena.map) failed.\n");
		prom_halt();
	}
	memset(iommu->arena.map, 0, sz);
	iommu->arena.limit = num_tsb_entries;

	/* Allocate and initialize the dummy page which we
+3 −6
Original line number Diff line number Diff line
@@ -1164,7 +1164,7 @@ static void pbm_config_busmastering(struct pci_pbm_info *pbm)
static void pbm_scan_bus(struct pci_controller_info *p,
			 struct pci_pbm_info *pbm)
{
	struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL);
	struct pcidev_cookie *cookie = kzalloc(sizeof(*cookie), GFP_KERNEL);

	if (!cookie) {
		prom_printf("PSYCHO: Critical allocation failure.\n");
@@ -1172,7 +1172,6 @@ static void pbm_scan_bus(struct pci_controller_info *p,
	}

	/* All we care about is the PBM. */
	memset(cookie, 0, sizeof(*cookie));
	cookie->pbm = pbm;

	pbm->pci_bus = pci_scan_bus(pbm->pci_first_busno,
@@ -1465,18 +1464,16 @@ void psycho_init(int node, char *model_name)
		}
	}

	p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
	p = kzalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
	if (!p) {
		prom_printf("PSYCHO: Fatal memory allocation error.\n");
		prom_halt();
	}
	memset(p, 0, sizeof(*p));
	iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
	iommu = kzalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
	if (!iommu) {
		prom_printf("PSYCHO: Fatal memory allocation error.\n");
		prom_halt();
	}
	memset(iommu, 0, sizeof(*iommu));
	p->pbm_A.iommu = p->pbm_B.iommu = iommu;

	p->next = pci_controller_root;
Loading