public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, Xiaojian Du <Xiaojian.Du@amd.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Huang Rui <ray.huang@amd.com>
Subject: drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c:928 gmc_v6_0_hw_init() warn: missing error code? 'r'
Date: Thu, 8 Dec 2022 09:25:38 +0300	[thread overview]
Message-ID: <202212080729.ChsUgoMZ-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8ed710da2873c2aeb3bb805864a699affaf1d03b
commit: 479e3b02b73a2de2b19df2950863149c59d57bfe drm/amdgpu: add vram check function for GMC
config: mips-randconfig-m031-20221207
compiler: mips-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>

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;

This seems like a false positive, but it would be more readable as
"return 0;" instead of "return r;"

df70502eef80be Ken Wang     2016-01-19  929  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


             reply	other threads:[~2022-12-08  6:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08  6:25 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-12-29 13:51 drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c:928 gmc_v6_0_hw_init() warn: missing error code? 'r' Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202212080729.ChsUgoMZ-lkp@intel.com \
    --to=error27@gmail.com \
    --cc=Xiaojian.Du@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=ray.huang@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox