aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorArnd Bergmann <[email protected]>2021-03-23 13:04:20 +0000
committerAlex Deucher <[email protected]>2021-04-09 20:42:25 +0000
commit19c383affd5866fffe7646b913aa78cbdd608325 (patch)
treec80d85faaba1c8b31d04d03c36e8fa3d5f1da94e /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parentamdgpu: avoid incorrect %hu format string (diff)
downloadkernel-19c383affd5866fffe7646b913aa78cbdd608325.tar.gz
kernel-19c383affd5866fffe7646b913aa78cbdd608325.zip
amdgpu: fix gcc -Wrestrict warning
gcc warns about an sprintf() that uses the same buffer as source and destination, which is undefined behavior in C99: drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c: In function 'amdgpu_securedisplay_debugfs_write': drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c:141:6: error: 'sprintf' argument 3 overlaps destination object 'i2c_output' [-Werror=restrict] 141 | sprintf(i2c_output, "%s 0x%X", i2c_output, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 142 | securedisplay_cmd->securedisplay_out_message.send_roi_crc.i2c_buf[i]); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c:97:7: note: destination object referenced by 'restrict'-qualified argument 1 was declared here 97 | char i2c_output[256]; | ^~~~~~~~~~ Rewrite it to remember the current offset into the buffer instead. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions