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:
committed by
Alex Deucher
parent
82b400a62f
commit
2004f45ef8
@@ -422,7 +422,8 @@ bool construct(
|
||||
struct irq_service *dal_irq_service_dce110_create(
|
||||
struct irq_service_init_data *init_data)
|
||||
{
|
||||
struct irq_service *irq_service = dm_alloc(sizeof(*irq_service));
|
||||
struct irq_service *irq_service = kzalloc(sizeof(*irq_service),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!irq_service)
|
||||
return NULL;
|
||||
@@ -430,6 +431,6 @@ struct irq_service *dal_irq_service_dce110_create(
|
||||
if (construct(irq_service, init_data))
|
||||
return irq_service;
|
||||
|
||||
dm_free(irq_service);
|
||||
kfree(irq_service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -281,7 +281,8 @@ static bool construct(
|
||||
struct irq_service *dal_irq_service_dce120_create(
|
||||
struct irq_service_init_data *init_data)
|
||||
{
|
||||
struct irq_service *irq_service = dm_alloc(sizeof(*irq_service));
|
||||
struct irq_service *irq_service = kzalloc(sizeof(*irq_service),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!irq_service)
|
||||
return NULL;
|
||||
@@ -289,6 +290,6 @@ struct irq_service *dal_irq_service_dce120_create(
|
||||
if (construct(irq_service, init_data))
|
||||
return irq_service;
|
||||
|
||||
dm_free(irq_service);
|
||||
kfree(irq_service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,8 @@ static bool construct(
|
||||
struct irq_service *dal_irq_service_dce80_create(
|
||||
struct irq_service_init_data *init_data)
|
||||
{
|
||||
struct irq_service *irq_service = dm_alloc(sizeof(*irq_service));
|
||||
struct irq_service *irq_service = kzalloc(sizeof(*irq_service),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!irq_service)
|
||||
return NULL;
|
||||
@@ -301,7 +302,7 @@ struct irq_service *dal_irq_service_dce80_create(
|
||||
if (construct(irq_service, init_data))
|
||||
return irq_service;
|
||||
|
||||
dm_free(irq_service);
|
||||
kfree(irq_service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -348,7 +348,8 @@ static bool construct(
|
||||
struct irq_service *dal_irq_service_dcn10_create(
|
||||
struct irq_service_init_data *init_data)
|
||||
{
|
||||
struct irq_service *irq_service = dm_alloc(sizeof(*irq_service));
|
||||
struct irq_service *irq_service = kzalloc(sizeof(*irq_service),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!irq_service)
|
||||
return NULL;
|
||||
@@ -356,6 +357,6 @@ struct irq_service *dal_irq_service_dcn10_create(
|
||||
if (construct(irq_service, init_data))
|
||||
return irq_service;
|
||||
|
||||
dm_free(irq_service);
|
||||
kfree(irq_service);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ void dal_irq_service_destroy(struct irq_service **irq_service)
|
||||
return;
|
||||
}
|
||||
|
||||
dm_free(*irq_service);
|
||||
kfree(*irq_service);
|
||||
|
||||
*irq_service = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user