drm/amd/display: fix compile warning in dml
authorRoman Li <roman.li@amd.com>
Tue, 1 Sep 2020 01:30:26 +0000 (21:30 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Sep 2020 21:52:42 +0000 (17:52 -0400)
[Why]
gcc version 5.4.0 fails compilation with:
‘PixelPTEReqHeightPTEs’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]

[How]
Initialized variable explicitly with 0

Signed-off-by: Roman Li <roman.li@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c

index a576eed..367c82b 100644 (file)
@@ -1294,7 +1294,7 @@ static unsigned int CalculateVMAndRowBytes(
        unsigned int MacroTileHeight;
        unsigned int ExtraDPDEBytesFrame;
        unsigned int PDEAndMetaPTEBytesFrame;
-       unsigned int PixelPTEReqHeightPTEs;
+       unsigned int PixelPTEReqHeightPTEs = 0;
 
        if (DCCEnable == true) {
                *MetaRequestHeight = 8 * BlockHeight256Bytes;