All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ma, Jun" <majun@amd.com>
To: "Lazar, Lijo" <lijo.lazar@amd.com>, Ma Jun <Jun.Ma2@amd.com>,
	amd-gfx@lists.freedesktop.org
Cc: majun@amd.com, Kenneth.Feng@amd.com, Alexander.Deucher@amd.com,
	kevinyang.wang@amd.com
Subject: Re: [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory
Date: Thu, 18 Apr 2024 09:21:08 +0800	[thread overview]
Message-ID: <94e7176c-4a3a-4a09-b49c-65d45005a9bd@amd.com> (raw)
In-Reply-To: <add8419f-a691-4b4f-af93-4d6b47ffc375@amd.com>



On 4/17/2024 7:52 PM, Lazar, Lijo wrote:
> 
> 
> On 4/17/2024 11:23 AM, Ma Jun wrote:
>> gpu_od should be removed if it's an empty directory
>>
>> Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
>> Reported-by: Yang Wang <kevinyang.wang@amd.com>
>> ---
>>  drivers/gpu/drm/amd/pm/amdgpu_pm.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
>> index a20e03e69d38..0c13e5520e77 100644
>> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
>> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
>> @@ -4338,6 +4338,13 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev)
>>  		}
>>  	}
>>  
>> +	/*
>> +	 * If gpu_od is the first member in the list, that means gpu_od is an
>> +	 * empty directory, so remove it.
>> +	 */
>> +	if (list_is_first(&top_set->entry, &adev->pm.od_kobj_list))
> 
> Instead of assuming any order, what about using "list_is_singular" - if
> this is the only entry in the list?
> 
Thanks, will update it when push.

Regards,
Ma Jun
> Thanks,
> Lijo
>> +		goto err_out;
>> +
>>  	return 0;
>>  
>>  err_out:

      reply	other threads:[~2024-04-18  1:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17  5:53 [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory Ma Jun
2024-04-17  6:06 ` Wang, Yang(Kevin)
2024-04-17 11:52 ` Lazar, Lijo
2024-04-18  1:21   ` Ma, Jun [this message]

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=94e7176c-4a3a-4a09-b49c-65d45005a9bd@amd.com \
    --to=majun@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Jun.Ma2@amd.com \
    --cc=Kenneth.Feng@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=kevinyang.wang@amd.com \
    --cc=lijo.lazar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.