Commit 8e5e9521 authored by Jesper Juhl's avatar Jesper Juhl Committed by Ingo Molnar

x86: Remove unnecessary casts of void ptr returning alloc function return values

The [vk][cmz]alloc(_node) family of functions return void
pointers which it's completely unnecessary/pointless to cast to
other pointer types since that happens implicitly.

This patch removes such casts from arch/x86.
Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Cc: trivial@kernel.org
Cc: amd64-microcode@amd64.org
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
LKML-Reference: <alpine.LNX.2.00.1011082310220.23697@swampdragon.chaosbits.net>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 0059b243
...@@ -212,7 +212,7 @@ static int install_equiv_cpu_table(const u8 *buf) ...@@ -212,7 +212,7 @@ static int install_equiv_cpu_table(const u8 *buf)
return 0; return 0;
} }
equiv_cpu_table = (struct equiv_cpu_entry *) vmalloc(size); equiv_cpu_table = vmalloc(size);
if (!equiv_cpu_table) { if (!equiv_cpu_table) {
pr_err("failed to allocate equivalent CPU table\n"); pr_err("failed to allocate equivalent CPU table\n");
return 0; return 0;
......
...@@ -1343,8 +1343,8 @@ uv_activation_descriptor_init(int node, int pnode) ...@@ -1343,8 +1343,8 @@ uv_activation_descriptor_init(int node, int pnode)
* each bau_desc is 64 bytes; there are 8 (UV_ITEMS_PER_DESCRIPTOR) * each bau_desc is 64 bytes; there are 8 (UV_ITEMS_PER_DESCRIPTOR)
* per cpu; and up to 32 (UV_ADP_SIZE) cpu's per uvhub * per cpu; and up to 32 (UV_ADP_SIZE) cpu's per uvhub
*/ */
bau_desc = (struct bau_desc *)kmalloc_node(sizeof(struct bau_desc)* bau_desc = kmalloc_node(sizeof(struct bau_desc) * UV_ADP_SIZE
UV_ADP_SIZE*UV_ITEMS_PER_DESCRIPTOR, GFP_KERNEL, node); * UV_ITEMS_PER_DESCRIPTOR, GFP_KERNEL, node);
BUG_ON(!bau_desc); BUG_ON(!bau_desc);
pa = uv_gpa(bau_desc); /* need the real nasid*/ pa = uv_gpa(bau_desc); /* need the real nasid*/
...@@ -1402,9 +1402,9 @@ uv_payload_queue_init(int node, int pnode) ...@@ -1402,9 +1402,9 @@ uv_payload_queue_init(int node, int pnode)
struct bau_payload_queue_entry *pqp_malloc; struct bau_payload_queue_entry *pqp_malloc;
struct bau_control *bcp; struct bau_control *bcp;
pqp = (struct bau_payload_queue_entry *) kmalloc_node( pqp = kmalloc_node((DEST_Q_SIZE + 1)
(DEST_Q_SIZE + 1) * sizeof(struct bau_payload_queue_entry), * sizeof(struct bau_payload_queue_entry),
GFP_KERNEL, node); GFP_KERNEL, node);
BUG_ON(!pqp); BUG_ON(!pqp);
pqp_malloc = pqp; pqp_malloc = pqp;
...@@ -1520,8 +1520,7 @@ static void __init uv_init_per_cpu(int nuvhubs) ...@@ -1520,8 +1520,7 @@ static void __init uv_init_per_cpu(int nuvhubs)
timeout_us = calculate_destination_timeout(); timeout_us = calculate_destination_timeout();
uvhub_descs = (struct uvhub_desc *) uvhub_descs = kmalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL);
kmalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL);
memset(uvhub_descs, 0, nuvhubs * sizeof(struct uvhub_desc)); memset(uvhub_descs, 0, nuvhubs * sizeof(struct uvhub_desc));
uvhub_mask = kzalloc((nuvhubs+7)/8, GFP_KERNEL); uvhub_mask = kzalloc((nuvhubs+7)/8, GFP_KERNEL);
for_each_present_cpu(cpu) { for_each_present_cpu(cpu) {
......
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