diff options
author | Yan Burman <burman.yan@gmail.com> | 2006-12-02 06:26:57 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 04:42:09 -0500 |
commit | f8485350c22b25f5b9804d89cb8fdf6626d0f5cb (patch) | |
tree | 969b17561afcf17362eebf16e59570bb66272d0b /arch | |
parent | 04d76b937bdf60a8c9ac34e222e3ca977ab9ddc8 (diff) |
[POWERPC] Replace kmalloc+memset with kzalloc
Replace kmalloc+memset with kzalloc.
Signed-off-by: Yan Burman <burman.yan@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/ibmebus.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas_flash.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/smp-tbsync.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/iommu.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/viopath.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/reconfig.c | 3 | ||||
-rw-r--r-- | arch/powerpc/sysdev/qe_lib/ucc_fast.c | 4 | ||||
-rw-r--r-- | arch/powerpc/sysdev/qe_lib/ucc_slow.c | 4 |
9 files changed, 9 insertions, 22 deletions
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 8e515797de6a..82bd2f10770f 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -214,11 +214,10 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_node( | |||
214 | return NULL; | 214 | return NULL; |
215 | } | 215 | } |
216 | 216 | ||
217 | dev = kmalloc(sizeof(struct ibmebus_dev), GFP_KERNEL); | 217 | dev = kzalloc(sizeof(struct ibmebus_dev), GFP_KERNEL); |
218 | if (!dev) { | 218 | if (!dev) { |
219 | return NULL; | 219 | return NULL; |
220 | } | 220 | } |
221 | memset(dev, 0, sizeof(struct ibmebus_dev)); | ||
222 | 221 | ||
223 | dev->ofdev.node = of_node_get(dn); | 222 | dev->ofdev.node = of_node_get(dn); |
224 | 223 | ||
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index afee470de924..6fa9a0a5c8db 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -330,7 +330,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
330 | struct pci_dev *dev; | 330 | struct pci_dev *dev; |
331 | const char *type; | 331 | const char *type; |
332 | 332 | ||
333 | dev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); | 333 | dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); |
334 | if (!dev) | 334 | if (!dev) |
335 | return NULL; | 335 | return NULL; |
336 | type = get_property(node, "device_type", NULL); | 336 | type = get_property(node, "device_type", NULL); |
@@ -339,7 +339,6 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
339 | 339 | ||
340 | DBG(" create device, devfn: %x, type: %s\n", devfn, type); | 340 | DBG(" create device, devfn: %x, type: %s\n", devfn, type); |
341 | 341 | ||
342 | memset(dev, 0, sizeof(struct pci_dev)); | ||
343 | dev->bus = bus; | 342 | dev->bus = bus; |
344 | dev->sysdata = node; | 343 | dev->sysdata = node; |
345 | dev->dev.parent = bus->bridge; | 344 | dev->dev.parent = bus->bridge; |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 6f6fc977cb39..b9561d300516 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
@@ -681,14 +681,12 @@ static int initialize_flash_pde_data(const char *rtas_call_name, | |||
681 | int *status; | 681 | int *status; |
682 | int token; | 682 | int token; |
683 | 683 | ||
684 | dp->data = kmalloc(buf_size, GFP_KERNEL); | 684 | dp->data = kzalloc(buf_size, GFP_KERNEL); |
685 | if (dp->data == NULL) { | 685 | if (dp->data == NULL) { |
686 | remove_flash_pde(dp); | 686 | remove_flash_pde(dp); |
687 | return -ENOMEM; | 687 | return -ENOMEM; |
688 | } | 688 | } |
689 | 689 | ||
690 | memset(dp->data, 0, buf_size); | ||
691 | |||
692 | /* | 690 | /* |
693 | * This code assumes that the status int is the first member of the | 691 | * This code assumes that the status int is the first member of the |
694 | * struct | 692 | * struct |
diff --git a/arch/powerpc/kernel/smp-tbsync.c b/arch/powerpc/kernel/smp-tbsync.c index e1970f83f14a..bc892e69b4f7 100644 --- a/arch/powerpc/kernel/smp-tbsync.c +++ b/arch/powerpc/kernel/smp-tbsync.c | |||
@@ -116,8 +116,7 @@ void __devinit smp_generic_give_timebase(void) | |||
116 | printk("Synchronizing timebase\n"); | 116 | printk("Synchronizing timebase\n"); |
117 | 117 | ||
118 | /* if this fails then this kernel won't work anyway... */ | 118 | /* if this fails then this kernel won't work anyway... */ |
119 | tbsync = kmalloc( sizeof(*tbsync), GFP_KERNEL ); | 119 | tbsync = kzalloc( sizeof(*tbsync), GFP_KERNEL ); |
120 | memset( tbsync, 0, sizeof(*tbsync) ); | ||
121 | mb(); | 120 | mb(); |
122 | running = 1; | 121 | running = 1; |
123 | 122 | ||
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c index ee0a4e42e4f0..d7a756d5135c 100644 --- a/arch/powerpc/platforms/iseries/iommu.c +++ b/arch/powerpc/platforms/iseries/iommu.c | |||
@@ -115,12 +115,10 @@ void iommu_table_getparms_iSeries(unsigned long busno, | |||
115 | { | 115 | { |
116 | struct iommu_table_cb *parms; | 116 | struct iommu_table_cb *parms; |
117 | 117 | ||
118 | parms = kmalloc(sizeof(*parms), GFP_KERNEL); | 118 | parms = kzalloc(sizeof(*parms), GFP_KERNEL); |
119 | if (parms == NULL) | 119 | if (parms == NULL) |
120 | panic("PCI_DMA: TCE Table Allocation failed."); | 120 | panic("PCI_DMA: TCE Table Allocation failed."); |
121 | 121 | ||
122 | memset(parms, 0, sizeof(*parms)); | ||
123 | |||
124 | parms->itc_busno = busno; | 122 | parms->itc_busno = busno; |
125 | parms->itc_slotno = slotno; | 123 | parms->itc_slotno = slotno; |
126 | parms->itc_virtbus = virtbus; | 124 | parms->itc_virtbus = virtbus; |
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c index 04e07e5da0c1..84e7ee2c086f 100644 --- a/arch/powerpc/platforms/iseries/viopath.c +++ b/arch/powerpc/platforms/iseries/viopath.c | |||
@@ -119,10 +119,9 @@ static int proc_viopath_show(struct seq_file *m, void *v) | |||
119 | struct device_node *node; | 119 | struct device_node *node; |
120 | const char *sysid; | 120 | const char *sysid; |
121 | 121 | ||
122 | buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL); | 122 | buf = kzalloc(HW_PAGE_SIZE, GFP_KERNEL); |
123 | if (!buf) | 123 | if (!buf) |
124 | return 0; | 124 | return 0; |
125 | memset(buf, 0, HW_PAGE_SIZE); | ||
126 | 125 | ||
127 | handle = dma_map_single(iSeries_vio_dev, buf, HW_PAGE_SIZE, | 126 | handle = dma_map_single(iSeries_vio_dev, buf, HW_PAGE_SIZE, |
128 | DMA_FROM_DEVICE); | 127 | DMA_FROM_DEVICE); |
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 1773103354be..4ad33e41b008 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -268,11 +268,10 @@ static char * parse_next_property(char *buf, char *end, char **name, int *length | |||
268 | static struct property *new_property(const char *name, const int length, | 268 | static struct property *new_property(const char *name, const int length, |
269 | const unsigned char *value, struct property *last) | 269 | const unsigned char *value, struct property *last) |
270 | { | 270 | { |
271 | struct property *new = kmalloc(sizeof(*new), GFP_KERNEL); | 271 | struct property *new = kzalloc(sizeof(*new), GFP_KERNEL); |
272 | 272 | ||
273 | if (!new) | 273 | if (!new) |
274 | return NULL; | 274 | return NULL; |
275 | memset(new, 0, sizeof(*new)); | ||
276 | 275 | ||
277 | if (!(new->name = kmalloc(strlen(name) + 1, GFP_KERNEL))) | 276 | if (!(new->name = kmalloc(strlen(name) + 1, GFP_KERNEL))) |
278 | goto cleanup; | 277 | goto cleanup; |
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c index 75fa3104a43a..e657559bea93 100644 --- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c +++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c | |||
@@ -216,14 +216,12 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc | |||
216 | return -EINVAL; | 216 | return -EINVAL; |
217 | } | 217 | } |
218 | 218 | ||
219 | uccf = (struct ucc_fast_private *) | 219 | uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL); |
220 | kmalloc(sizeof(struct ucc_fast_private), GFP_KERNEL); | ||
221 | if (!uccf) { | 220 | if (!uccf) { |
222 | uccf_err | 221 | uccf_err |
223 | ("ucc_fast_init: No memory for UCC slow data structure!"); | 222 | ("ucc_fast_init: No memory for UCC slow data structure!"); |
224 | return -ENOMEM; | 223 | return -ENOMEM; |
225 | } | 224 | } |
226 | memset(uccf, 0, sizeof(struct ucc_fast_private)); | ||
227 | 225 | ||
228 | /* Fill fast UCC structure */ | 226 | /* Fill fast UCC structure */ |
229 | uccf->uf_info = uf_info; | 227 | uccf->uf_info = uf_info; |
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c index a49da6b73ecf..47b56203f47e 100644 --- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c +++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c | |||
@@ -168,14 +168,12 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc | |||
168 | return -EINVAL; | 168 | return -EINVAL; |
169 | } | 169 | } |
170 | 170 | ||
171 | uccs = (struct ucc_slow_private *) | 171 | uccs = kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL); |
172 | kmalloc(sizeof(struct ucc_slow_private), GFP_KERNEL); | ||
173 | if (!uccs) { | 172 | if (!uccs) { |
174 | uccs_err | 173 | uccs_err |
175 | ("ucc_slow_init: No memory for UCC slow data structure!"); | 174 | ("ucc_slow_init: No memory for UCC slow data structure!"); |
176 | return -ENOMEM; | 175 | return -ENOMEM; |
177 | } | 176 | } |
178 | memset(uccs, 0, sizeof(struct ucc_slow_private)); | ||
179 | 177 | ||
180 | /* Fill slow UCC structure */ | 178 | /* Fill slow UCC structure */ |
181 | uccs->us_info = us_info; | 179 | uccs->us_info = us_info; |