mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-27 20:08:26 -04:00
drm/amd/display: Remove redundant non-zero and overflow check
[Why] Unsigned int is guaranteed to be >= 0, and read_channel_reply checks for overflows. read_channel_reply also returns -1 on error, which is what dc_link_aux_transfer is expected to return on error. [How] Remove the if-statement. Return result of read_channel_reply directly. Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com> Reviewed-by: Mikita Lipski <Mikita.Lipski@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
2f14bc8968
commit
5678094038
@@ -666,13 +666,9 @@ int dc_link_aux_transfer(struct ddc_service *ddc,
|
||||
|
||||
switch (operation_result) {
|
||||
case AUX_CHANNEL_OPERATION_SUCCEEDED:
|
||||
res = returned_bytes;
|
||||
|
||||
if (res <= size && res >= 0)
|
||||
res = aux_engine->funcs->read_channel_reply(aux_engine, size,
|
||||
buffer, reply,
|
||||
&status);
|
||||
|
||||
res = aux_engine->funcs->read_channel_reply(aux_engine, size,
|
||||
buffer, reply,
|
||||
&status);
|
||||
break;
|
||||
case AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON:
|
||||
res = 0;
|
||||
|
||||
Reference in New Issue
Block a user