From 5fb005c4583749f54d5bab6622dbed1d2d56c268 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 29 Sep 2017 13:15:59 +1000 Subject: [PATCH] amdgpu/dc: make dce transform constructor void This never returns anything but true. Signed-off-by: Dave Airlie Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 4 +--- drivers/gpu/drm/amd/display/dc/dce/dce_transform.h | 2 +- .../gpu/drm/amd/display/dc/dce100/dce100_resource.c | 11 +++-------- .../gpu/drm/amd/display/dc/dce110/dce110_resource.c | 10 +++------- .../gpu/drm/amd/display/dc/dce112/dce112_resource.c | 13 ++++--------- .../gpu/drm/amd/display/dc/dce120/dce120_resource.c | 13 ++++--------- .../gpu/drm/amd/display/dc/dce80/dce80_resource.c | 13 ++++--------- 7 files changed, 20 insertions(+), 46 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c index a8f60d7531be..c40d2e9e5f7c 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c @@ -1437,7 +1437,7 @@ static const struct transform_funcs dce_transform_funcs = { /* Constructor, Destructor */ /*****************************************/ -bool dce_transform_construct( +void dce_transform_construct( struct dce_transform *xfm_dce, struct dc_context *ctx, uint32_t inst, @@ -1462,6 +1462,4 @@ bool dce_transform_construct( xfm_dce->lb_bits_per_entry = LB_BITS_PER_ENTRY; xfm_dce->lb_memory_size = LB_TOTAL_NUMBER_OF_ENTRIES; /*0x6B0*/ - - return true; } diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.h b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.h index 805bb9c4e188..e1f1e5129f86 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.h +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.h @@ -481,7 +481,7 @@ struct dce_transform { bool prescaler_on; }; -bool dce_transform_construct(struct dce_transform *xfm_dce, +void dce_transform_construct(struct dce_transform *xfm_dce, struct dc_context *ctx, uint32_t inst, const struct dce_transform_registers *regs, diff --git a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c index 729d82eb6500..1caf2983dda5 100644 --- a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c @@ -486,14 +486,9 @@ static struct transform *dce100_transform_create( if (!transform) return NULL; - if (dce_transform_construct(transform, ctx, inst, - &xfm_regs[inst], &xfm_shift, &xfm_mask)) { - return &transform->base; - } - - BREAK_TO_DEBUGGER(); - kfree(transform); - return NULL; + dce_transform_construct(transform, ctx, inst, + &xfm_regs[inst], &xfm_shift, &xfm_mask); + return &transform->base; } static struct input_pixel_processor *dce100_ipp_create( diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c index 8e3f365177b8..45c5facf79b1 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c @@ -526,13 +526,9 @@ static struct transform *dce110_transform_create( if (!transform) return NULL; - if (dce_transform_construct(transform, ctx, inst, - &xfm_regs[inst], &xfm_shift, &xfm_mask)) - return &transform->base; - - BREAK_TO_DEBUGGER(); - kfree(transform); - return NULL; + dce_transform_construct(transform, ctx, inst, + &xfm_regs[inst], &xfm_shift, &xfm_mask); + return &transform->base; } static struct input_pixel_processor *dce110_ipp_create( diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c index 3cb18cecb800..251e4a29d56f 100644 --- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c @@ -521,15 +521,10 @@ static struct transform *dce112_transform_create( if (!transform) return NULL; - if (dce_transform_construct(transform, ctx, inst, - &xfm_regs[inst], &xfm_shift, &xfm_mask)) { - transform->lb_memory_size = 0x1404; /*5124*/ - return &transform->base; - } - - BREAK_TO_DEBUGGER(); - kfree(transform); - return NULL; + dce_transform_construct(transform, ctx, inst, + &xfm_regs[inst], &xfm_shift, &xfm_mask); + transform->lb_memory_size = 0x1404; /*5124*/ + return &transform->base; } static const struct encoder_feature_support link_enc_feature = { diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c index ea234376c0e2..13d75df71396 100644 --- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c @@ -662,15 +662,10 @@ static struct transform *dce120_transform_create( if (!transform) return NULL; - if (dce_transform_construct(transform, ctx, inst, - &xfm_regs[inst], &xfm_shift, &xfm_mask)) { - transform->lb_memory_size = 0x1404; /*5124*/ - return &transform->base; - } - - BREAK_TO_DEBUGGER(); - kfree(transform); - return NULL; + dce_transform_construct(transform, ctx, inst, + &xfm_regs[inst], &xfm_shift, &xfm_mask); + transform->lb_memory_size = 0x1404; /*5124*/ + return &transform->base; } static void dce120_destroy_resource_pool(struct resource_pool **pool) diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c index 71f265b6b670..db8afb6491cd 100644 --- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c @@ -535,15 +535,10 @@ static struct transform *dce80_transform_create( if (!transform) return NULL; - if (dce_transform_construct(transform, ctx, inst, - &xfm_regs[inst], &xfm_shift, &xfm_mask)) { - transform->prescaler_on = false; - return &transform->base; - } - - BREAK_TO_DEBUGGER(); - kfree(transform); - return NULL; + dce_transform_construct(transform, ctx, inst, + &xfm_regs[inst], &xfm_shift, &xfm_mask); + transform->prescaler_on = false; + return &transform->base; } static const struct encoder_feature_support link_enc_feature = { -- 2.30.2