mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Lijo Lazar <lijo.lazar@amd.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Ce Sun <cesun102@amd.com>, Hawking Zhang <Hawking.Zhang@amd.com>
Subject: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:6088:8-9: Unneeded variable: "r". Return "0" on line 6141
Date: Sat, 28 Jun 2025 19:52:57 +0800	[thread overview]
Message-ID: <202506281925.HHIpXiO7-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   aaf724ed69264719550ec4f194d3ab17b886af9a
commit: 785c536c31c0bb057252fddedb30d79ae4979f4b drm/amdgpu: Release reset locks during failures
date:   10 days ago
config: x86_64-randconfig-102-20250628 (https://download.01.org/0day-ci/archive/20250628/202506281925.HHIpXiO7-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506281925.HHIpXiO7-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:6088:8-9: Unneeded variable: "r". Return "0" on line 6141

vim +6088 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

  6080	
  6081	static int amdgpu_device_halt_activities(
  6082		struct amdgpu_device *adev, struct amdgpu_job *job,
  6083		struct amdgpu_reset_context *reset_context,
  6084		struct list_head *device_list, struct amdgpu_hive_info *hive,
  6085		bool need_emergency_restart)
  6086	{
  6087		struct amdgpu_device *tmp_adev = NULL;
> 6088		int i, r = 0;
  6089	
  6090		/* block all schedulers and reset given job's ring */
  6091		list_for_each_entry(tmp_adev, device_list, reset_list) {
  6092			amdgpu_device_set_mp1_state(tmp_adev);
  6093	
  6094			/*
  6095			 * Try to put the audio codec into suspend state
  6096			 * before gpu reset started.
  6097			 *
  6098			 * Due to the power domain of the graphics device
  6099			 * is shared with AZ power domain. Without this,
  6100			 * we may change the audio hardware from behind
  6101			 * the audio driver's back. That will trigger
  6102			 * some audio codec errors.
  6103			 */
  6104			if (!amdgpu_device_suspend_display_audio(tmp_adev))
  6105				tmp_adev->pcie_reset_ctx.audio_suspended = true;
  6106	
  6107			amdgpu_ras_set_error_query_ready(tmp_adev, false);
  6108	
  6109			cancel_delayed_work_sync(&tmp_adev->delayed_init_work);
  6110	
  6111			amdgpu_amdkfd_pre_reset(tmp_adev, reset_context);
  6112	
  6113			/*
  6114			 * Mark these ASICs to be reset as untracked first
  6115			 * And add them back after reset completed
  6116			 */
  6117			amdgpu_unregister_gpu_instance(tmp_adev);
  6118	
  6119			drm_client_dev_suspend(adev_to_drm(tmp_adev), false);
  6120	
  6121			/* disable ras on ALL IPs */
  6122			if (!need_emergency_restart &&
  6123			      (!adev->pcie_reset_ctx.occurs_dpc) &&
  6124			      amdgpu_device_ip_need_full_reset(tmp_adev))
  6125				amdgpu_ras_suspend(tmp_adev);
  6126	
  6127			for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
  6128				struct amdgpu_ring *ring = tmp_adev->rings[i];
  6129	
  6130				if (!amdgpu_ring_sched_ready(ring))
  6131					continue;
  6132	
  6133				drm_sched_stop(&ring->sched, job ? &job->base : NULL);
  6134	
  6135				if (need_emergency_restart)
  6136					amdgpu_job_stop_all_jobs_on_sched(&ring->sched);
  6137			}
  6138			atomic_inc(&tmp_adev->gpu_reset_counter);
  6139		}
  6140	
> 6141		return r;
  6142	}
  6143	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2025-06-28 11:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202506281925.HHIpXiO7-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=cesun102@amd.com \
    --cc=lijo.lazar@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®