]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Fix unused-but-set-variable warning
authorAashish Sharma <shraash@google.com>
Thu, 24 Mar 2022 13:40:31 +0000 (19:10 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Apr 2022 14:26:36 +0000 (10:26 -0400)
commitc36905fa9637a75faa3030b504cd5722f0a930a9
tree55ddfaf49fa193853a52f48f78e1012298ce5a65
parent62ec03e5e8ac2e9690a662a403e124ff449326e9
drm/amd/display: Fix unused-but-set-variable warning

Fix the kernel test robot warning below:

drivers/gpu/drm/amd/amdgpu/../display/dmub/inc/dmub_cmd.h:2893:12:
warning: variable 'temp' set but not used [-Wunused-but-set-variable]

Replaced the assignment to the unused temp variable with READ_ONCE()
macro to flush the writes. READ_ONCE() helps avoid the use of
volatile and makes it obvious from the code that the read here is
intentional. Also verified on x86 that the generated code is exactly the
same as before.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Aashish Sharma <shraash@google.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h