Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44161
b: refs/heads/master
c: 982c206
h: refs/heads/master
i:
  44159: ee8aaf5
v: v3
  • Loading branch information
Yan Burman authored and David S. Miller committed Dec 10, 2006
1 parent eeea895 commit c6b577a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4accd60d23f3c8a576fd08b727f88096f42d445
refs/heads/master: 982c2064d9a8b51404088d132489a25e2db807fd
3 changes: 1 addition & 2 deletions trunk/arch/sparc64/kernel/chmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,14 @@ static void fetch_decode_regs(struct mctrl_info *mp)

static int init_one_mctrl(struct device_node *dp)
{
struct mctrl_info *mp = kmalloc(sizeof(*mp), GFP_KERNEL);
struct mctrl_info *mp = kzalloc(sizeof(*mp), GFP_KERNEL);
int portid = of_getintprop_default(dp, "portid", -1);
struct linux_prom64_registers *regs;
void *pval;
int len;

if (!mp)
return -1;
memset(mp, 0, sizeof(*mp));
if (portid == -1)
goto fail;

Expand Down
12 changes: 3 additions & 9 deletions trunk/arch/sparc64/kernel/isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,12 @@ static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev)
struct linux_prom_registers *regs;
struct sparc_isa_device *isa_dev;

isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL);
isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
if (!isa_dev) {
fatal_err("cannot allocate child isa_dev");
prom_halt();
}

memset(isa_dev, 0, sizeof(*isa_dev));

/* Link it in to parent. */
isa_dev->next = parent_isa_dev->child;
parent_isa_dev->child = isa_dev;
Expand All @@ -104,14 +102,12 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
struct linux_prom_registers *regs;
struct sparc_isa_device *isa_dev;

isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL);
isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
if (!isa_dev) {
printk(KERN_DEBUG "ISA: cannot allocate isa_dev");
return;
}

memset(isa_dev, 0, sizeof(*isa_dev));

isa_dev->ofdev.node = dp;
isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
isa_dev->ofdev.dev.bus = &isa_bus_type;
Expand Down Expand Up @@ -180,14 +176,12 @@ void __init isa_init(void)
pbm = pdev_cookie->pbm;
dp = pdev_cookie->prom_node;

isa_br = kmalloc(sizeof(*isa_br), GFP_KERNEL);
isa_br = kzalloc(sizeof(*isa_br), GFP_KERNEL);
if (!isa_br) {
printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge");
return;
}

memset(isa_br, 0, sizeof(*isa_br));

isa_br->ofdev.node = dp;
isa_br->ofdev.dev.parent = &pdev->dev;
isa_br->ofdev.dev.bus = &isa_bus_type;
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/sparc64/kernel/of_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,10 +1007,9 @@ struct of_device* of_platform_device_create(struct device_node *np,
{
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->dev.parent = parent;
dev->dev.bus = bus;
Expand Down
16 changes: 5 additions & 11 deletions trunk/arch/sparc64/kernel/pci_sun4v.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,15 +798,14 @@ static struct pci_ops pci_sun4v_ops = {
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("%s: Critical allocation failure.\n", pbm->name);
prom_halt();
}

/* 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, p->pci_ops, pbm);
Expand Down Expand Up @@ -1048,12 +1047,11 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
/* 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;

sz = probe_existing_entries(pbm, iommu);
Expand Down Expand Up @@ -1164,24 +1162,20 @@ void sun4v_pci_init(struct device_node *dp, char *model_name)
per_cpu(pci_iommu_batch, i).pglist = (u64 *) page;
}

p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
p = kzalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
if (!p)
goto fatal_memory_error;

memset(p, 0, sizeof(*p));

iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
iommu = kzalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
if (!iommu)
goto fatal_memory_error;

memset(iommu, 0, sizeof(*iommu));
p->pbm_A.iommu = iommu;

iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
iommu = kzalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
if (!iommu)
goto fatal_memory_error;

memset(iommu, 0, sizeof(*iommu));
p->pbm_B.iommu = iommu;

p->next = pci_controller_root;
Expand Down

0 comments on commit c6b577a

Please sign in to comment.