Commit 6afc9be1 authored by Julia Lawall's avatar Julia Lawall Committed by Tony Luck

[IA64] eliminate NULL test and memset after alloc_bootmem

As noted by Akinobu Mita in patch b1fceac2,
alloc_bootmem and related functions never return NULL and always return a
zeroed region of memory.  Thus a NULL test or memset after calls to these
functions is unnecessary.
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent fc102125
...@@ -512,7 +512,6 @@ static void __init sn_init_pdas(char **cmdline_p) ...@@ -512,7 +512,6 @@ static void __init sn_init_pdas(char **cmdline_p)
for_each_online_node(cnode) { for_each_online_node(cnode) {
nodepdaindr[cnode] = nodepdaindr[cnode] =
alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t));
memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
memset(nodepdaindr[cnode]->phys_cpuid, -1, memset(nodepdaindr[cnode]->phys_cpuid, -1,
sizeof(nodepdaindr[cnode]->phys_cpuid)); sizeof(nodepdaindr[cnode]->phys_cpuid));
spin_lock_init(&nodepdaindr[cnode]->ptc_lock); spin_lock_init(&nodepdaindr[cnode]->ptc_lock);
...@@ -521,11 +520,9 @@ static void __init sn_init_pdas(char **cmdline_p) ...@@ -521,11 +520,9 @@ static void __init sn_init_pdas(char **cmdline_p)
/* /*
* Allocate & initialize nodepda for TIOs. For now, put them on node 0. * Allocate & initialize nodepda for TIOs. For now, put them on node 0.
*/ */
for (cnode = num_online_nodes(); cnode < num_cnodes; cnode++) { for (cnode = num_online_nodes(); cnode < num_cnodes; cnode++)
nodepdaindr[cnode] = nodepdaindr[cnode] =
alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t)); alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t));
memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
}
/* /*
* Now copy the array of nodepda pointers to each nodepda. * Now copy the array of nodepda pointers to each nodepda.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment