linux/drivers/gpu/drm/amd
Arnd Bergmann 19c383affd 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 <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-04-09 16:42:25 -04:00
..
acp
amdgpu amdgpu: fix gcc -Wrestrict warning 2021-04-09 16:42:25 -04:00
amdkfd drm/amdkfd: Fix cat debugfs hang_hws file causes system crash bug 2021-04-09 16:42:11 -04:00
display drm/amd/display: 3.2.128 2021-04-09 16:41:44 -04:00
include drm/amd/pm: add a new sysfs entry for default power limit 2021-03-23 23:30:55 -04:00
pm drm/amd/pm: fix gpu reset failure by MP1 state setting 2021-04-09 16:39:45 -04:00