aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-06-25 20:37:40 -0400
committerMike Frysinger <vapier@gentoo.org>2009-09-16 21:28:49 -0400
commit70deca9f9ca99e7a5fb88b9e4cb18e5eb1b79120 (patch)
tree255b0c170127dff22b572a801e9f2a1f5c24f0bb /arch/blackfin/kernel
parentdc6b1ac98434d2c39d86de19aec9cf701b588c81 (diff)
Blackfin: convert malloc()/memset() to zalloc() in module code
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r--arch/blackfin/kernel/module.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/blackfin/kernel/module.c b/arch/blackfin/kernel/module.c
index b8f4c67eb2ec..50d7fbfe1ce6 100644
--- a/arch/blackfin/kernel/module.c
+++ b/arch/blackfin/kernel/module.c
@@ -98,14 +98,13 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
98 if (strcmp(".l1.bss", secstrings + s->sh_name) == 0 || 98 if (strcmp(".l1.bss", secstrings + s->sh_name) == 0 ||
99 ((strcmp(".bss", secstrings + s->sh_name) == 0) && 99 ((strcmp(".bss", secstrings + s->sh_name) == 0) &&
100 (hdr->e_flags & EF_BFIN_DATA_IN_L1) && (s->sh_size > 0))) { 100 (hdr->e_flags & EF_BFIN_DATA_IN_L1) && (s->sh_size > 0))) {
101 dest = l1_data_sram_alloc(s->sh_size); 101 dest = l1_data_sram_zalloc(s->sh_size);
102 mod->arch.bss_a_l1 = dest; 102 mod->arch.bss_a_l1 = dest;
103 if (dest == NULL) { 103 if (dest == NULL) {
104 pr_err("L1 data memory allocation failed\n", 104 pr_err("L1 data memory allocation failed\n",
105 mod->name); 105 mod->name);
106 return -1; 106 return -1;
107 } 107 }
108 memset(dest, 0, s->sh_size);
109 s->sh_flags &= ~SHF_ALLOC; 108 s->sh_flags &= ~SHF_ALLOC;
110 s->sh_addr = (unsigned long)dest; 109 s->sh_addr = (unsigned long)dest;
111 } 110 }
@@ -164,14 +163,13 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
164 if (strcmp(".l2.bss", secstrings + s->sh_name) == 0 || 163 if (strcmp(".l2.bss", secstrings + s->sh_name) == 0 ||
165 ((strcmp(".bss", secstrings + s->sh_name) == 0) && 164 ((strcmp(".bss", secstrings + s->sh_name) == 0) &&
166 (hdr->e_flags & EF_BFIN_DATA_IN_L2) && (s->sh_size > 0))) { 165 (hdr->e_flags & EF_BFIN_DATA_IN_L2) && (s->sh_size > 0))) {
167 dest = l2_sram_alloc(s->sh_size); 166 dest = l2_sram_zalloc(s->sh_size);
168 mod->arch.bss_l2 = dest; 167 mod->arch.bss_l2 = dest;
169 if (dest == NULL) { 168 if (dest == NULL) {
170 pr_err("L2 SRAM allocation failed\n", 169 pr_err("L2 SRAM allocation failed\n",
171 mod->name); 170 mod->name);
172 return -1; 171 return -1;
173 } 172 }
174 memset(dest, 0, s->sh_size);
175 s->sh_flags &= ~SHF_ALLOC; 173 s->sh_flags &= ~SHF_ALLOC;
176 s->sh_addr = (unsigned long)dest; 174 s->sh_addr = (unsigned long)dest;
177 } 175 }