dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Das, Nirmoy" <nirmoy.das@amd.com>
To: "Christian König" <christian.koenig@amd.com>,
	dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, Huang Rui <ray.huang@amd.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH 2/4] drm/ttm: do not set NULL to debugfs dentry
Date: Tue, 12 Oct 2021 10:49:51 +0200	[thread overview]
Message-ID: <6baaa89b-d441-84d4-1519-88eecd7b7afe@amd.com> (raw)
In-Reply-To: <f98a7c4d-0d2c-4ae2-fbc2-e3085dfb3e8c@amd.com>


On 10/12/2021 9:09 AM, Christian König wrote:
> Am 11.10.21 um 21:06 schrieb Nirmoy Das:
>> For debugfs directory, it is recommended to save the result
>> and pass over to next debugfs API for creating debugfs
>> files/directories. Error conditions are handled by debugfs APIs.
>>
>> CC: Christian Koenig <christian.koenig@amd.com>
>> CC: Huang Rui <ray.huang@amd.com>
>> CC: David Airlie <airlied@linux.ie>
>> CC: Daniel Vetter <daniel@ffwll.ch>
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>
> Please also add a comment to ttm_debugfs_root that this can also be an 
> ERR_PTR and should not be dereferenced.


Thanks, I will resend with a comment to ttm_debugfs_root.


Nirmoy

>
> Apart from that looks good to me.
>
> Christian.
>
>> ---
>>   drivers/gpu/drm/ttm/ttm_device.c | 6 +-----
>>   1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_device.c 
>> b/drivers/gpu/drm/ttm/ttm_device.c
>> index be24bb6cefd0..225ae6b0b4c2 100644
>> --- a/drivers/gpu/drm/ttm/ttm_device.c
>> +++ b/drivers/gpu/drm/ttm/ttm_device.c
>> @@ -77,9 +77,6 @@ static int ttm_global_init(void)
>>       si_meminfo(&si);
>>
>>       ttm_debugfs_root = debugfs_create_dir("ttm", NULL);
>> -    if (IS_ERR(ttm_debugfs_root)) {
>> -        ttm_debugfs_root = NULL;
>> -    }
>>
>>       /* Limit the number of pages in the pool to about 50% of the total
>>        * system memory.
>> @@ -108,8 +105,7 @@ static int ttm_global_init(void)
>>       debugfs_create_atomic_t("buffer_objects", 0444, ttm_debugfs_root,
>>                   &glob->bo_count);
>>   out:
>> -    if (ret && ttm_debugfs_root)
>> -        debugfs_remove(ttm_debugfs_root);
>> +    debugfs_remove(ttm_debugfs_root);
>>       if (ret)
>>           --ttm_glob_use_count;
>>       mutex_unlock(&ttm_global_mutex);
>> -- 
>> 2.32.0
>>
>

  reply	other threads:[~2021-10-12  8:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 19:06 [PATCH 1/4] dri: do not check for NULL debugfs dentry Nirmoy Das
2021-10-11 19:06 ` [PATCH 2/4] drm/ttm: do not set NULL to " Nirmoy Das
2021-10-12  7:09   ` Christian König
2021-10-12  8:49     ` Das, Nirmoy [this message]
2021-10-11 19:06 ` [PATCH 3/4] drm/i915/gt: do not check for NULL " Nirmoy Das
2021-10-11 19:06 ` [PATCH 4/4] vgaswitcheroo: " Nirmoy Das
2021-10-11 20:24   ` Lukas Wunner
2021-10-12  6:48     ` Lukas Wunner
2021-10-12  8:57       ` Das, Nirmoy
  -- strict thread matches above, loose matches on Subject: below --
2021-10-13 18:35 [PATCH v2 1/4] dri: " Nirmoy Das
2021-10-13 18:35 ` [PATCH 2/4] drm/ttm: do not set NULL to " Nirmoy Das

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=6baaa89b-d441-84d4-1519-88eecd7b7afe@amd.com \
    --to=nirmoy.das@amd.com \
    --cc=airlied@linux.ie \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --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