drm/amd/display: Use kernel alloc/free

Abstractions are frowned upon.

cocci script:
virtual context
virtual patch
virtual org
virtual report

@@
expression ptr;
@@

- dm_alloc(ptr)
+ kzalloc(ptr, GFP_KERNEL)

@@
expression ptr, size;
@@

- dm_realloc(ptr, size)
+ krealloc(ptr, size, GFP_KERNEL)

@@
expression ptr;
@@

- dm_free(ptr)
+ kfree(ptr)

v2: use GFP_KERNEL, not GFP_ATOMIC. add cocci script

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Harry Wentland
2017-09-27 10:53:50 -04:00
committed by Alex Deucher
parent 82b400a62f
commit 2004f45ef8
59 changed files with 362 additions and 330 deletions

View File

@@ -87,7 +87,7 @@ static void virtual_link_encoder_connect_dig_be_to_fe(
static void virtual_link_encoder_destroy(struct link_encoder **enc)
{
dm_free(*enc);
kfree(*enc);
*enc = NULL;
}

View File

@@ -121,7 +121,7 @@ bool virtual_stream_encoder_construct(
struct stream_encoder *virtual_stream_encoder_create(
struct dc_context *ctx, struct dc_bios *bp)
{
struct stream_encoder *enc = dm_alloc(sizeof(*enc));
struct stream_encoder *enc = kzalloc(sizeof(*enc), GFP_KERNEL);
if (!enc)
return NULL;
@@ -130,7 +130,7 @@ struct stream_encoder *virtual_stream_encoder_create(
return enc;
BREAK_TO_DEBUGGER();
dm_free(enc);
kfree(enc);
return NULL;
}