[PATCH 9/9] amdgpu/dc: fix construct return values on irq service.
Harry Wentland
harry.wentland at amd.com
Fri Sep 29 14:27:43 UTC 2017
On 2017-09-29 12:34 AM, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This just removes more unused return/errors paths.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
Series is
Reviewed-by: Harry Wentland <harry.wentland at amd.com>
Harry
> ---
> .../gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c | 14 ++++----------
> .../gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c | 14 ++++----------
> .../gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c | 14 ++++----------
> .../gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c | 14 ++++----------
> drivers/gpu/drm/amd/display/dc/irq/irq_service.c | 9 +++++----
> drivers/gpu/drm/amd/display/dc/irq/irq_service.h | 2 +-
> 6 files changed, 22 insertions(+), 45 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c b/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c
> index 5c55896..f7e40b2 100644
> --- a/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c
> +++ b/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c
> @@ -406,17 +406,14 @@ static const struct irq_service_funcs irq_service_funcs_dce110 = {
> .to_dal_irq_source = to_dal_irq_source_dce110
> };
>
> -static bool construct(
> +static void construct(
> struct irq_service *irq_service,
> struct irq_service_init_data *init_data)
> {
> - if (!dal_irq_service_construct(irq_service, init_data))
> - return false;
> + dal_irq_service_construct(irq_service, init_data);
>
> irq_service->info = irq_source_info_dce110;
> irq_service->funcs = &irq_service_funcs_dce110;
> -
> - return true;
> }
>
> struct irq_service *dal_irq_service_dce110_create(
> @@ -428,9 +425,6 @@ struct irq_service *dal_irq_service_dce110_create(
> if (!irq_service)
> return NULL;
>
> - if (construct(irq_service, init_data))
> - return irq_service;
> -
> - kfree(irq_service);
> - return NULL;
> + construct(irq_service, init_data);
> + return irq_service;
> }
> diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c b/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c
> index 61d7c28..2ad56b1 100644
> --- a/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c
> +++ b/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c
> @@ -265,17 +265,14 @@ static const struct irq_service_funcs irq_service_funcs_dce120 = {
> .to_dal_irq_source = to_dal_irq_source_dce110
> };
>
> -static bool construct(
> +static void construct(
> struct irq_service *irq_service,
> struct irq_service_init_data *init_data)
> {
> - if (!dal_irq_service_construct(irq_service, init_data))
> - return false;
> + dal_irq_service_construct(irq_service, init_data);
>
> irq_service->info = irq_source_info_dce120;
> irq_service->funcs = &irq_service_funcs_dce120;
> -
> - return true;
> }
>
> struct irq_service *dal_irq_service_dce120_create(
> @@ -287,9 +284,6 @@ struct irq_service *dal_irq_service_dce120_create(
> if (!irq_service)
> return NULL;
>
> - if (construct(irq_service, init_data))
> - return irq_service;
> -
> - kfree(irq_service);
> - return NULL;
> + construct(irq_service, init_data);
> + return irq_service;
> }
> diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c b/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c
> index d6e1fb6..8a2066c 100644
> --- a/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c
> +++ b/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c
> @@ -277,17 +277,14 @@ static const struct irq_service_funcs irq_service_funcs_dce80 = {
> .to_dal_irq_source = to_dal_irq_source_dce110
> };
>
> -static bool construct(
> +static void construct(
> struct irq_service *irq_service,
> struct irq_service_init_data *init_data)
> {
> - if (!dal_irq_service_construct(irq_service, init_data))
> - return false;
> + dal_irq_service_construct(irq_service, init_data);
>
> irq_service->info = irq_source_info_dce80;
> irq_service->funcs = &irq_service_funcs_dce80;
> -
> - return true;
> }
>
> struct irq_service *dal_irq_service_dce80_create(
> @@ -299,11 +296,8 @@ struct irq_service *dal_irq_service_dce80_create(
> if (!irq_service)
> return NULL;
>
> - if (construct(irq_service, init_data))
> - return irq_service;
> -
> - kfree(irq_service);
> - return NULL;
> + construct(irq_service, init_data);
> + return irq_service;
> }
>
>
> diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c b/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c
> index f6e8611..74ad247 100644
> --- a/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c
> +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c
> @@ -332,17 +332,14 @@ static const struct irq_service_funcs irq_service_funcs_dcn10 = {
> .to_dal_irq_source = to_dal_irq_source_dcn10
> };
>
> -static bool construct(
> +static void construct(
> struct irq_service *irq_service,
> struct irq_service_init_data *init_data)
> {
> - if (!dal_irq_service_construct(irq_service, init_data))
> - return false;
> + dal_irq_service_construct(irq_service, init_data);
>
> irq_service->info = irq_source_info_dcn10;
> irq_service->funcs = &irq_service_funcs_dcn10;
> -
> - return true;
> }
>
> struct irq_service *dal_irq_service_dcn10_create(
> @@ -354,9 +351,6 @@ struct irq_service *dal_irq_service_dcn10_create(
> if (!irq_service)
> return NULL;
>
> - if (construct(irq_service, init_data))
> - return irq_service;
> -
> - kfree(irq_service);
> - return NULL;
> + construct(irq_service, init_data);
> + return irq_service;
> }
> diff --git a/drivers/gpu/drm/amd/display/dc/irq/irq_service.c b/drivers/gpu/drm/amd/display/dc/irq/irq_service.c
> index ce20622..b106513 100644
> --- a/drivers/gpu/drm/amd/display/dc/irq/irq_service.c
> +++ b/drivers/gpu/drm/amd/display/dc/irq/irq_service.c
> @@ -48,15 +48,16 @@
> #define CTX \
> irq_service->ctx
>
> -bool dal_irq_service_construct(
> +void dal_irq_service_construct(
> struct irq_service *irq_service,
> struct irq_service_init_data *init_data)
> {
> - if (!init_data || !init_data->ctx)
> - return false;
> + if (!init_data || !init_data->ctx) {
> + BREAK_TO_DEBUGGER();
> + return;
> + }
>
> irq_service->ctx = init_data->ctx;
> - return true;
> }
>
> void dal_irq_service_destroy(struct irq_service **irq_service)
> diff --git a/drivers/gpu/drm/amd/display/dc/irq/irq_service.h b/drivers/gpu/drm/amd/display/dc/irq/irq_service.h
> index a2a2d69..dbfcb09 100644
> --- a/drivers/gpu/drm/amd/display/dc/irq/irq_service.h
> +++ b/drivers/gpu/drm/amd/display/dc/irq/irq_service.h
> @@ -69,7 +69,7 @@ struct irq_service {
> const struct irq_service_funcs *funcs;
> };
>
> -bool dal_irq_service_construct(
> +void dal_irq_service_construct(
> struct irq_service *irq_service,
> struct irq_service_init_data *init_data);
>
>
More information about the amd-gfx
mailing list