aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorShirish S <shirish.s@amd.com>2018-12-20 05:34:35 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-01-14 15:04:46 -0500
commit05794eff1aa6060248bfca34ee936c613f94a942 (patch)
tree22c7d8618ac4534a3573b48c1699fb327b598819 /drivers/gpu/drm/amd
parent32e61361b82e7ad016a83345f66ccc68865f63f4 (diff)
drm/amdgpu/gmc: fix compiler errors [-Werror,-Wmissing-braces] (V2)
Initializing structures with { } is known to be problematic since it doesn't necessararily initialize all bytes, in case of padding, causing random failures when structures are memcmp(). This patch fixes the structure initialisation related compiler error by memset(). V2: rectified missing piece in coding Signed-off-by: Shirish S <shirish.s@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
index 1ad7e6b8ed1d..34440672f938 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
@@ -1471,8 +1471,9 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev,
1471 gmc_v8_0_set_fault_enable_default(adev, false); 1471 gmc_v8_0_set_fault_enable_default(adev, false);
1472 1472
1473 if (printk_ratelimit()) { 1473 if (printk_ratelimit()) {
1474 struct amdgpu_task_info task_info = { 0 }; 1474 struct amdgpu_task_info task_info;
1475 1475
1476 memset(&task_info, 0, sizeof(struct amdgpu_task_info));
1476 amdgpu_vm_get_task_info(adev, entry->pasid, &task_info); 1477 amdgpu_vm_get_task_info(adev, entry->pasid, &task_info);
1477 1478
1478 dev_err(adev->dev, "GPU fault detected: %d 0x%08x for process %s pid %d thread %s pid %d\n", 1479 dev_err(adev->dev, "GPU fault detected: %d 0x%08x for process %s pid %d thread %s pid %d\n",
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index bacdaef77b6c..521ac8954652 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -320,8 +320,9 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,
320 } 320 }
321 321
322 if (printk_ratelimit()) { 322 if (printk_ratelimit()) {
323 struct amdgpu_task_info task_info = { 0 }; 323 struct amdgpu_task_info task_info;
324 324
325 memset(&task_info, 0, sizeof(struct amdgpu_task_info));
325 amdgpu_vm_get_task_info(adev, entry->pasid, &task_info); 326 amdgpu_vm_get_task_info(adev, entry->pasid, &task_info);
326 327
327 dev_err(adev->dev, 328 dev_err(adev->dev,