Skip to content

Commit d3892e2

Browse files
zhangshkalexdeucher
authored andcommitted
drm/amd/display: Remove the redundant initialization of local variable
Local variable 'i' and 'j' will be initialized in the for loop, so remove the redundant initialization. Cc: Harry Wentland <[email protected]> Cc: Leo Li <[email protected]> Cc: Alex Deucher <[email protected]> Signed-off-by: Shaokun Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent a6c3c37 commit d3892e2

File tree

1 file changed

+8
-9
lines changed
  • drivers/gpu/drm/amd/display/dc/core

1 file changed

+8
-9
lines changed

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
303303
struct dc_stream_state *stream,
304304
struct dc_crtc_timing_adjust *adjust)
305305
{
306-
int i = 0;
306+
int i;
307307
bool ret = false;
308308

309309
stream->adjust.v_total_max = adjust->v_total_max;
@@ -331,7 +331,7 @@ bool dc_stream_get_crtc_position(struct dc *dc,
331331
{
332332
/* TODO: Support multiple streams */
333333
const struct dc_stream_state *stream = streams[0];
334-
int i = 0;
334+
int i;
335335
bool ret = false;
336336
struct crtc_position position;
337337

@@ -538,7 +538,7 @@ void dc_stream_set_dyn_expansion(struct dc *dc, struct dc_stream_state *stream,
538538
enum dc_dynamic_expansion option)
539539
{
540540
/* OPP FMT dyn expansion updates*/
541-
int i = 0;
541+
int i;
542542
struct pipe_ctx *pipe_ctx;
543543

544544
for (i = 0; i < MAX_PIPES; i++) {
@@ -596,7 +596,7 @@ void dc_stream_set_dither_option(struct dc_stream_state *stream,
596596

597597
bool dc_stream_set_gamut_remap(struct dc *dc, const struct dc_stream_state *stream)
598598
{
599-
int i = 0;
599+
int i;
600600
bool ret = false;
601601
struct pipe_ctx *pipes;
602602

@@ -613,7 +613,7 @@ bool dc_stream_set_gamut_remap(struct dc *dc, const struct dc_stream_state *stre
613613

614614
bool dc_stream_program_csc_matrix(struct dc *dc, struct dc_stream_state *stream)
615615
{
616-
int i = 0;
616+
int i;
617617
bool ret = false;
618618
struct pipe_ctx *pipes;
619619

@@ -639,8 +639,7 @@ void dc_stream_set_static_screen_params(struct dc *dc,
639639
int num_streams,
640640
const struct dc_static_screen_params *params)
641641
{
642-
int i = 0;
643-
int j = 0;
642+
int i, j;
644643
struct pipe_ctx *pipes_affected[MAX_PIPES];
645644
int num_pipes_affected = 0;
646645

@@ -895,7 +894,7 @@ static void disable_all_writeback_pipes_for_stream(
895894
static void apply_ctx_interdependent_lock(struct dc *dc, struct dc_state *context,
896895
struct dc_stream_state *stream, bool lock)
897896
{
898-
int i = 0;
897+
int i;
899898

900899
/* Checks if interdependent update function pointer is NULL or not, takes care of DCE110 case */
901900
if (dc->hwss.interdependent_update_lock)
@@ -1155,7 +1154,7 @@ static void enable_timing_multisync(
11551154
struct dc *dc,
11561155
struct dc_state *ctx)
11571156
{
1158-
int i = 0, multisync_count = 0;
1157+
int i, multisync_count = 0;
11591158
int pipe_count = dc->res_pool->pipe_count;
11601159
struct pipe_ctx *multisync_pipes[MAX_PIPES] = { NULL };
11611160

0 commit comments

Comments
 (0)