The method in struct amdgpu_virt_ops::trans_msg() is defined as using an 'u32' for its 2nd argument (the request) but the actual implementation()s and calls use an 'enum idh_request' for it.
Fix this by using 'enum idh_request' for the method declaration too.
Signed-off-by: Luc Van Oostenryck luc.vanoostenryck@gmail.com --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h index 722deefc0a7e..3e9aec6f2795 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h @@ -56,7 +56,7 @@ struct amdgpu_virt_ops { int (*rel_full_gpu)(struct amdgpu_device *adev, bool init); int (*reset_gpu)(struct amdgpu_device *adev); int (*wait_reset)(struct amdgpu_device *adev); - void (*trans_msg)(struct amdgpu_device *adev, u32 req, u32 data1, u32 data2, u32 data3); + void (*trans_msg)(struct amdgpu_device *adev, enum idh_request req, u32 data1, u32 data2, u32 data3); };
/*
Hi Luc,
I love your patch! Yet something to improve:
[auto build test ERROR on linus/master] [also build test ERROR on v5.0 next-20190304] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Luc-Van-Oostenryck/drm-amdgpu-fix-t... config: ia64-allmodconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 8.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=8.2.0 make.cross ARCH=ia64
All error/warnings (new ones prefixed by >>):
In file included from drivers/gpu/drm/amd/amdgpu/amdgpu.h:77, from drivers/gpu/drm/amd/amdgpu/../powerplay/inc/amd_powerplay.h:33, from drivers/gpu/drm/amd/amdgpu/../powerplay/inc/hwmgr.h:27, from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega12_thermal.h:27, from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega12_thermal.c:24:
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h:59:53: warning: 'enum idh_request' declared inside parameter list will not be visible outside of this definition or declaration
void (*trans_msg)(struct amdgpu_device *adev, enum idh_request req, u32 data1, u32 data2, u32 data3); ^~~~~~~~~~~ -- In file included from drivers/gpu/drm/amd/amdgpu/amdgpu.h:77, from drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c:24:
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h:59:53: warning: 'enum idh_request' declared inside parameter list will not be visible outside of this definition or declaration
void (*trans_msg)(struct amdgpu_device *adev, enum idh_request req, u32 data1, u32 data2, u32 data3); ^~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c: In function 'amdgpu_vf_error_trans_all':
drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c:82:35: error: type of formal parameter 2 is incomplete
adev->virt.ops->trans_msg(adev, IDH_LOG_VF_ERROR, data1, data2, data3); ^~~~~~~~~~~~~~~~ -- In file included from drivers/gpu/drm/amd/amdgpu/amdgpu.h:77, from drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c:24:
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h:59:53: warning: 'enum idh_request' declared inside parameter list will not be visible outside of this definition or declaration
void (*trans_msg)(struct amdgpu_device *adev, enum idh_request req, u32 data1, u32 data2, u32 data3); ^~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c:376:15: error: initialization of 'void (*)(struct amdgpu_device *, enum idh_request, u32, u32, u32)' {aka 'void (*)(struct amdgpu_device *, enum idh_request, unsigned int, unsigned int, unsigned int)'} from incompatible pointer type 'void (*)(struct amdgpu_device *, enum idh_request, u32, u32, u32)' {aka 'void (*)(struct amdgpu_device *, enum idh_request, unsigned int, unsigned int, unsigned int)'} [-Werror=incompatible-pointer-types]
.trans_msg = xgpu_ai_mailbox_trans_msg, ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c:376:15: note: (near initialization for 'xgpu_ai_virt_ops.trans_msg') cc1: some warnings being treated as errors
vim +376 drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
f98b617e Monk Liu 2017-04-05 370 c9c9de93 Xiangliang Yu 2017-03-10 371 const struct amdgpu_virt_ops xgpu_ai_virt_ops = { c9c9de93 Xiangliang Yu 2017-03-10 372 .req_full_gpu = xgpu_ai_request_full_gpu_access, c9c9de93 Xiangliang Yu 2017-03-10 373 .rel_full_gpu = xgpu_ai_release_full_gpu_access, f98b617e Monk Liu 2017-04-05 374 .reset_gpu = xgpu_ai_request_reset, b5914238 pding 2017-10-24 375 .wait_reset = NULL, 89041940 Gavin Wan 2017-06-23 @376 .trans_msg = xgpu_ai_mailbox_trans_msg,
:::::: The code at line 376 was first introduced by commit :::::: 890419409a3aba2ca7185a824e47d8ded8df11a2 drm/amdgpu: Support passing amdgpu critical error to host via GPU Mailbox.
:::::: TO: Gavin Wan Gavin.Wan@amd.com :::::: CC: Alex Deucher alexander.deucher@amd.com
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
On Mon, Mar 04, 2019 at 02:10:00PM +0100, Luc Van Oostenryck wrote:
The method in struct amdgpu_virt_ops::trans_msg() is defined as using an 'u32' for its 2nd argument (the request) but the actual implementation()s and calls use an 'enum idh_request' for it.
Fix this by using 'enum idh_request' for the method declaration too.
Signed-off-by: Luc Van Oostenryck luc.vanoostenryck@gmail.com
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h index 722deefc0a7e..3e9aec6f2795 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h @@ -56,7 +56,7 @@ struct amdgpu_virt_ops { int (*rel_full_gpu)(struct amdgpu_device *adev, bool init); int (*reset_gpu)(struct amdgpu_device *adev); int (*wait_reset)(struct amdgpu_device *adev);
- void (*trans_msg)(struct amdgpu_device *adev, u32 req, u32 data1, u32 data2, u32 data3);
- void (*trans_msg)(struct amdgpu_device *adev, enum idh_request req, u32 data1, u32 data2, u32 data3);
};
Sorry, this is patch is incorrect. Please ignore it.
-- Luc
dri-devel@lists.freedesktop.org