drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c:928 gmc_v6_0_hw_init() warn: missing error code? 'r'
From: Dan Carpenter
Date: Thu Dec 29 2022 - 08:52:17 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1b929c02afd37871d5afb9d498426f83432e71c2
commit: 479e3b02b73a2de2b19df2950863149c59d57bfe drm/amdgpu: add vram check function for GMC
config: ia64-randconfig-m041-20221229
compiler: ia64-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <error27@xxxxxxxxx>
smatch warnings:
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c:928 gmc_v6_0_hw_init() warn: missing error code? 'r'
vim +/r +928 drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
df70502eef80be Ken Wang 2016-01-19 906 static int gmc_v6_0_hw_init(void *handle)
df70502eef80be Ken Wang 2016-01-19 907 {
df70502eef80be Ken Wang 2016-01-19 908 int r;
df70502eef80be Ken Wang 2016-01-19 909 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
df70502eef80be Ken Wang 2016-01-19 910
df70502eef80be Ken Wang 2016-01-19 911 gmc_v6_0_mc_program(adev);
df70502eef80be Ken Wang 2016-01-19 912
df70502eef80be Ken Wang 2016-01-19 913 if (!(adev->flags & AMD_IS_APU)) {
df70502eef80be Ken Wang 2016-01-19 914 r = gmc_v6_0_mc_load_microcode(adev);
df70502eef80be Ken Wang 2016-01-19 915 if (r) {
075719c3cb79f3 Tom St Denis 2016-09-06 916 dev_err(adev->dev, "Failed to load MC firmware!\n");
df70502eef80be Ken Wang 2016-01-19 917 return r;
df70502eef80be Ken Wang 2016-01-19 918 }
df70502eef80be Ken Wang 2016-01-19 919 }
df70502eef80be Ken Wang 2016-01-19 920
df70502eef80be Ken Wang 2016-01-19 921 r = gmc_v6_0_gart_enable(adev);
df70502eef80be Ken Wang 2016-01-19 922 if (r)
df70502eef80be Ken Wang 2016-01-19 923 return r;
df70502eef80be Ken Wang 2016-01-19 924
479e3b02b73a2d Xiaojian Du 2022-01-17 925 if (amdgpu_emu_mode == 1)
479e3b02b73a2d Xiaojian Du 2022-01-17 926 return amdgpu_gmc_vram_checking(adev);
479e3b02b73a2d Xiaojian Du 2022-01-17 927 else
df70502eef80be Ken Wang 2016-01-19 @928 return r;
"r" is zero. Just return a literal "return 0;" or "return EINVAL;"
df70502eef80be Ken Wang 2016-01-19 929 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp