Commit 28d76d48 authored by Bernard Zhao's avatar Bernard Zhao Committed by Alex Deucher

drm/amd/display: optimize code runtime a bit

In the function dal_ddc_service_query_ddc_data,
get rid of dal_ddc_i2c_payloads_destroy, call
dal_vector_destruct() directly.
This change is to make the code run a bit fast.
Signed-off-by: default avatarBernard Zhao <bernard@vivo.com>

Changes since V1:
*get rid of dal_ddc_i2c_payloads_destroy, call
dal_vector_destruct() directly.

Link for V1:
*https://lore.kernel.org/patchwork/patch/1309014/Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f349f772
...@@ -148,14 +148,6 @@ static uint32_t dal_ddc_i2c_payloads_get_count(struct i2c_payloads *p) ...@@ -148,14 +148,6 @@ static uint32_t dal_ddc_i2c_payloads_get_count(struct i2c_payloads *p)
return p->payloads.count; return p->payloads.count;
} }
static void dal_ddc_i2c_payloads_destroy(struct i2c_payloads *p)
{
if (!p)
return;
dal_vector_destruct(&p->payloads);
}
#define DDC_MIN(a, b) (((a) < (b)) ? (a) : (b)) #define DDC_MIN(a, b) (((a) < (b)) ? (a) : (b))
void dal_ddc_i2c_payloads_add( void dal_ddc_i2c_payloads_add(
...@@ -582,7 +574,7 @@ bool dal_ddc_service_query_ddc_data( ...@@ -582,7 +574,7 @@ bool dal_ddc_service_query_ddc_data(
ddc->link, ddc->link,
&command); &command);
dal_ddc_i2c_payloads_destroy(&payloads); dal_vector_destruct(&payloads.payloads);
} }
return success; return success;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment