From: Alex Deucher <alexdeucher@xxxxxxxxx> Date: 2020-09-22 03:33:20 To: Bernard Zhao <bernard@xxxxxxxx> Cc: Harry Wentland <harry.wentland@xxxxxxx>,Leo Li <sunpeng.li@xxxxxxx>,Alex Deucher <alexander.deucher@xxxxxxx>,"Christian König" <christian.koenig@xxxxxxx>,David Airlie <airlied@xxxxxxxx>,Daniel Vetter <daniel@xxxxxxxx>,Rodrigo Siqueira <Rodrigo.Siqueira@xxxxxxx>,Jun Lei <Jun.Lei@xxxxxxx>,Aric Cyr <aric.cyr@xxxxxxx>,Wenjing Liu <wenjing.liu@xxxxxxx>,abdoulaye berthe <abdoulaye.berthe@xxxxxxx>,Michael Strauss <michael.strauss@xxxxxxx>,Brandon Syu <Brandon.Syu@xxxxxxx>,Martin Leung <martin.leung@xxxxxxx>,amd-gfx list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>,Maling list - DRI developers <dri-devel@xxxxxxxxxxxxxxxxxxxxx>,LKML <linux-kernel@xxxxxxxxxxxxxxx>,opensource.kernel@xxxxxxxx Subject: Re: [PATCH] drm/amd/display: optimize code runtime a bit>On Mon, Sep 21, 2020 at 9:14 AM Bernard Zhao <bernard@xxxxxxxx> wrote: >> >> Static function dal_ddc_i2c_payloads_destroy is only called >> in dal_ddc_service_query_ddc_data, the parameter is &payloads >> , there is no point NULL risk, so no need to check. >> This change is to make the code run a bit fast. >> > >How about just getting rid of dal_ddc_i2c_payloads_destroy() and just >call dal_vector_destruct() directly. Good idea, I will resubmit a patch, thanks! BR//Bernard >Alex > > >> Signed-off-by: Bernard Zhao <bernard@xxxxxxxx> >> --- >> drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 3 --- >> 1 file changed, 3 deletions(-) >> >> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c >> index b984eecca58b..6dcc666738fc 100644 >> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c >> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c >> @@ -150,9 +150,6 @@ static uint32_t dal_ddc_i2c_payloads_get_count(struct i2c_payloads *p) >> >> static void dal_ddc_i2c_payloads_destroy(struct i2c_payloads *p) >> { >> - if (!p) >> - return; >> - >> dal_vector_destruct(&p->payloads); >> } >> >> -- >> 2.28.0 >> >> _______________________________________________ >> amd-gfx mailing list >> amd-gfx@xxxxxxxxxxxxxxxxxxxxx >> https://lists.freedesktop.org/mailman/listinfo/amd-gfx _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel