drm/amd/display: Use proper enums in process_channel_reply
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 27 Sep 2018 18:06:33 +0000 (11:06 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Oct 2018 22:04:22 +0000 (17:04 -0500)
Clang warns when one enumerated type is implicitly converted to another.

drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:315:19: warning:
implicit conversion from enumeration type 'enum
aux_channel_operation_result' to different enumeration type 'enum
aux_transaction_reply' [-Wenum-conversion]
                reply->status = AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON;
                              ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/dc/i2caux/dce110/aux_engine_dce110.c:349:19:
warning: implicit conversion from enumeration type 'enum
aux_channel_operation_result' to different enumeration type 'enum
aux_transaction_reply' [-Wenum-conversion]
                reply->status = AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON;
                              ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The current enum is incorrect, it should be from aux_transaction_reply,
so use AUX_TRANSACTION_REPLY_HPD_DISCON.

Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c

index 3f5b2e6f7553f56488412b03be5a900f529a935e..aaeb7faac0c431a6b28812b5b83c63a48229fa54 100644 (file)
@@ -312,7 +312,7 @@ static void process_channel_reply(
 
        /* in case HPD is LOW, exit AUX transaction */
        if ((sw_status & AUX_SW_STATUS__AUX_SW_HPD_DISCON_MASK)) {
-               reply->status = AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON;
+               reply->status = AUX_TRANSACTION_REPLY_HPD_DISCON;
                return;
        }
 
index 8eee8ace1259eba7fb9b4f327d4d7624168d1d76..59c3ed43d609d7d11d3a07315816dd1ed9733c54 100644 (file)
@@ -346,7 +346,7 @@ static void process_channel_reply(
 
        /* in case HPD is LOW, exit AUX transaction */
        if ((sw_status & AUX_SW_STATUS__AUX_SW_HPD_DISCON_MASK)) {
-               reply->status = AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON;
+               reply->status = AUX_TRANSACTION_REPLY_HPD_DISCON;
                return;
        }