Commit 52fd91088bcbaea5ab441d09d39c21eb684e54ea

Authored by Yan Burman
Committed by Tony Luck
1 parent 66888a6e5f

[IA64] replace kmalloc+memset with kzalloc

Replace kmalloc+memset with kzalloc

Signed-off-by: Yan Burman <burman.yan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>

Showing 4 changed files with 6 additions and 13 deletions Side-by-side Diff

arch/ia64/hp/common/sba_iommu.c
... ... @@ -1672,15 +1672,13 @@
1672 1672 * SAC (single address cycle) addressable, so allocate a
1673 1673 * pseudo-device to enforce that.
1674 1674 */
1675   - sac = kmalloc(sizeof(*sac), GFP_KERNEL);
  1675 + sac = kzalloc(sizeof(*sac), GFP_KERNEL);
1676 1676 if (!sac)
1677 1677 panic(PFX "Couldn't allocate struct pci_dev");
1678   - memset(sac, 0, sizeof(*sac));
1679 1678  
1680   - controller = kmalloc(sizeof(*controller), GFP_KERNEL);
  1679 + controller = kzalloc(sizeof(*controller), GFP_KERNEL);
1681 1680 if (!controller)
1682 1681 panic(PFX "Couldn't allocate struct pci_controller");
1683   - memset(controller, 0, sizeof(*controller));
1684 1682  
1685 1683 controller->iommu = ioc;
1686 1684 sac->sysdata = controller;
1687 1685  
... ... @@ -1737,11 +1735,9 @@
1737 1735 struct ioc *ioc;
1738 1736 struct ioc_iommu *info;
1739 1737  
1740   - ioc = kmalloc(sizeof(*ioc), GFP_KERNEL);
  1738 + ioc = kzalloc(sizeof(*ioc), GFP_KERNEL);
1741 1739 if (!ioc)
1742 1740 return NULL;
1743   -
1744   - memset(ioc, 0, sizeof(*ioc));
1745 1741  
1746 1742 ioc->next = ioc_list;
1747 1743 ioc_list = ioc;
arch/ia64/hp/sim/simserial.c
... ... @@ -684,12 +684,11 @@
684 684 *ret_info = sstate->info;
685 685 return 0;
686 686 }
687   - info = kmalloc(sizeof(struct async_struct), GFP_KERNEL);
  687 + info = kzalloc(sizeof(struct async_struct), GFP_KERNEL);
688 688 if (!info) {
689 689 sstate->count--;
690 690 return -ENOMEM;
691 691 }
692   - memset(info, 0, sizeof(struct async_struct));
693 692 init_waitqueue_head(&info->open_wait);
694 693 init_waitqueue_head(&info->close_wait);
695 694 init_waitqueue_head(&info->delta_msr_wait);
arch/ia64/kernel/perfmon.c
... ... @@ -853,9 +853,8 @@
853 853 * allocate context descriptor
854 854 * must be able to free with interrupts disabled
855 855 */
856   - ctx = kmalloc(sizeof(pfm_context_t), GFP_KERNEL);
  856 + ctx = kzalloc(sizeof(pfm_context_t), GFP_KERNEL);
857 857 if (ctx) {
858   - memset(ctx, 0, sizeof(pfm_context_t));
859 858 DPRINT(("alloc ctx @%p\n", ctx));
860 859 }
861 860 return ctx;
... ... @@ -125,11 +125,10 @@
125 125 {
126 126 struct pci_controller *controller;
127 127  
128   - controller = kmalloc(sizeof(*controller), GFP_KERNEL);
  128 + controller = kzalloc(sizeof(*controller), GFP_KERNEL);
129 129 if (!controller)
130 130 return NULL;
131 131  
132   - memset(controller, 0, sizeof(*controller));
133 132 controller->segment = seg;
134 133 controller->node = -1;
135 134 return controller;