lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 17 Jun 2018 10:52:12 +0200
From:   Stefan Agner <stefan@...er.ch>
To:     Alex Deucher <alexander.deucher@....com>
Cc:     Stefan Agner <stefan@...er.ch>, James Zhu <James.Zhu@....com>,
        Christian König <christian.koenig@....com>,
        "David (ChunMing) Zhou" <David1.Zhou@....com>,
        David Airlie <airlied@...ux.ie>, amd-gfx@...ts.freedesktop.org,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drm/amdgpu: use first uvd instance to avoid clang build error

Explicitly use the first uvd instance to avoid a build error when
using clang 6:
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1148:52: error: expected ')'
                container_of(work, struct amdgpu_device, uvd.inst->idle_work.work);
                                                                 ^
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1148:3: note: to match this '('
                container_of(work, struct amdgpu_device, uvd.inst->idle_work.work);
                ^
./include/linux/kernel.h:967:21: note: expanded from macro 'container_of'
        ((type *)(__mptr - offsetof(type, member))); })
                           ^
./include/linux/stddef.h:17:32: note: expanded from macro 'offsetof'
                                ^
./include/linux/compiler-gcc.h:170:20: note: expanded from macro
      '__compiler_offsetof'
        __builtin_offsetof(a, b)
                          ^
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1147:24: error: initializing
      'struct amdgpu_device *' with an expression of incompatible type 'void'
        struct amdgpu_device *adev =
                              ^
2 errors generated.

Fixes: 10dd74eac4db ("drm/amdgpu/vg20:Restruct uvd.inst to support multiple instances")
Cc: James Zhu <James.Zhu@....com>
Signed-off-by: Stefan Agner <stefan@...er.ch>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index bcf68f80bbf0..6666a5888c44 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -1145,7 +1145,7 @@ int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
 static void amdgpu_uvd_idle_work_handler(struct work_struct *work)
 {
 	struct amdgpu_device *adev =
-		container_of(work, struct amdgpu_device, uvd.inst->idle_work.work);
+		container_of(work, struct amdgpu_device, uvd.inst[0].idle_work.work);
 	unsigned fences = 0, i, j;
 
 	for (i = 0; i < adev->uvd.num_uvd_inst; ++i) {
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ