diff options
author | Yan Burman <burman.yan@gmail.com> | 2006-11-30 20:13:09 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-10 05:40:18 -0500 |
commit | 982c2064d9a8b51404088d132489a25e2db807fd (patch) | |
tree | 984706a0496f4f8df7d3c861d32a6d899cfe5894 /arch/sparc64/kernel/pci_sun4v.c | |
parent | d4accd60d23f3c8a576fd08b727f88096f42d445 (diff) |
[SPARC64]: Replace kmalloc+memset with kzalloc
Replace kmalloc+memset with kzalloc
Signed-off-by: Yan Burman <burman.yan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_sun4v.c')
-rw-r--r-- | arch/sparc64/kernel/pci_sun4v.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c index 03ad4c06758e..6b04794b7a97 100644 --- a/arch/sparc64/kernel/pci_sun4v.c +++ b/arch/sparc64/kernel/pci_sun4v.c | |||
@@ -798,7 +798,7 @@ static struct pci_ops pci_sun4v_ops = { | |||
798 | static void pbm_scan_bus(struct pci_controller_info *p, | 798 | static void pbm_scan_bus(struct pci_controller_info *p, |
799 | struct pci_pbm_info *pbm) | 799 | struct pci_pbm_info *pbm) |
800 | { | 800 | { |
801 | struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL); | 801 | struct pcidev_cookie *cookie = kzalloc(sizeof(*cookie), GFP_KERNEL); |
802 | 802 | ||
803 | if (!cookie) { | 803 | if (!cookie) { |
804 | prom_printf("%s: Critical allocation failure.\n", pbm->name); | 804 | prom_printf("%s: Critical allocation failure.\n", pbm->name); |
@@ -806,7 +806,6 @@ static void pbm_scan_bus(struct pci_controller_info *p, | |||
806 | } | 806 | } |
807 | 807 | ||
808 | /* All we care about is the PBM. */ | 808 | /* All we care about is the PBM. */ |
809 | memset(cookie, 0, sizeof(*cookie)); | ||
810 | cookie->pbm = pbm; | 809 | cookie->pbm = pbm; |
811 | 810 | ||
812 | pbm->pci_bus = pci_scan_bus(pbm->pci_first_busno, p->pci_ops, pbm); | 811 | pbm->pci_bus = pci_scan_bus(pbm->pci_first_busno, p->pci_ops, pbm); |
@@ -1048,12 +1047,11 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm) | |||
1048 | /* Allocate and initialize the free area map. */ | 1047 | /* Allocate and initialize the free area map. */ |
1049 | sz = num_tsb_entries / 8; | 1048 | sz = num_tsb_entries / 8; |
1050 | sz = (sz + 7UL) & ~7UL; | 1049 | sz = (sz + 7UL) & ~7UL; |
1051 | iommu->arena.map = kmalloc(sz, GFP_KERNEL); | 1050 | iommu->arena.map = kzalloc(sz, GFP_KERNEL); |
1052 | if (!iommu->arena.map) { | 1051 | if (!iommu->arena.map) { |
1053 | prom_printf("PCI_IOMMU: Error, kmalloc(arena.map) failed.\n"); | 1052 | prom_printf("PCI_IOMMU: Error, kmalloc(arena.map) failed.\n"); |
1054 | prom_halt(); | 1053 | prom_halt(); |
1055 | } | 1054 | } |
1056 | memset(iommu->arena.map, 0, sz); | ||
1057 | iommu->arena.limit = num_tsb_entries; | 1055 | iommu->arena.limit = num_tsb_entries; |
1058 | 1056 | ||
1059 | sz = probe_existing_entries(pbm, iommu); | 1057 | sz = probe_existing_entries(pbm, iommu); |
@@ -1164,24 +1162,20 @@ void sun4v_pci_init(struct device_node *dp, char *model_name) | |||
1164 | per_cpu(pci_iommu_batch, i).pglist = (u64 *) page; | 1162 | per_cpu(pci_iommu_batch, i).pglist = (u64 *) page; |
1165 | } | 1163 | } |
1166 | 1164 | ||
1167 | p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC); | 1165 | p = kzalloc(sizeof(struct pci_controller_info), GFP_ATOMIC); |
1168 | if (!p) | 1166 | if (!p) |
1169 | goto fatal_memory_error; | 1167 | goto fatal_memory_error; |
1170 | 1168 | ||
1171 | memset(p, 0, sizeof(*p)); | 1169 | iommu = kzalloc(sizeof(struct pci_iommu), GFP_ATOMIC); |
1172 | |||
1173 | iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC); | ||
1174 | if (!iommu) | 1170 | if (!iommu) |
1175 | goto fatal_memory_error; | 1171 | goto fatal_memory_error; |
1176 | 1172 | ||
1177 | memset(iommu, 0, sizeof(*iommu)); | ||
1178 | p->pbm_A.iommu = iommu; | 1173 | p->pbm_A.iommu = iommu; |
1179 | 1174 | ||
1180 | iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC); | 1175 | iommu = kzalloc(sizeof(struct pci_iommu), GFP_ATOMIC); |
1181 | if (!iommu) | 1176 | if (!iommu) |
1182 | goto fatal_memory_error; | 1177 | goto fatal_memory_error; |
1183 | 1178 | ||
1184 | memset(iommu, 0, sizeof(*iommu)); | ||
1185 | p->pbm_B.iommu = iommu; | 1179 | p->pbm_B.iommu = iommu; |
1186 | 1180 | ||
1187 | p->next = pci_controller_root; | 1181 | p->next = pci_controller_root; |