Skip to content

Commit

Permalink
drm/amd/display: small cleanup in destruct()
Browse files Browse the repository at this point in the history
Static analysis tools get annoyed that we don't indent this if
statement.  Actually, the if statement isn't required because kfree()
can handle NULL pointers just fine.  The DCE110STRENC_FROM_STRENC()
macro is a wrapper around container_of() but it's basically a no-op or a
cast.  Anyway, it's not really appropriate here so it should be removed
as well.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Dan Carpenter authored and Alex Deucher committed Nov 7, 2017
1 parent 26c860d commit 620fd73
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,8 @@ static void destruct(struct dcn10_resource_pool *pool)
}
}

for (i = 0; i < pool->base.stream_enc_count; i++) {
if (pool->base.stream_enc[i] != NULL)
kfree(DCE110STRENC_FROM_STRENC(pool->base.stream_enc[i]));
}
for (i = 0; i < pool->base.stream_enc_count; i++)
kfree(pool->base.stream_enc[i]);

for (i = 0; i < pool->base.audio_count; i++) {
if (pool->base.audios[i])
Expand Down

0 comments on commit 620fd73

Please sign in to comment.