[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c9f9b966-6894-dd70-373d-04378e76ae36@amd.com>
Date: Wed, 16 Dec 2020 16:40:58 +0100
From: Christian König <christian.koenig@....com>
To: Martin Peres <martin.peres@...uf.org>,
Arnd Bergmann <arnd@...nel.org>, Huang Rui <ray.huang@....com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Dave Airlie <airlied@...hat.com>,
Madhav Chauhan <madhav.chauhan@....com>
Cc: Arnd Bergmann <arnd@...db.de>,
Alex Deucher <alexander.deucher@....com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/ttm: fix unused function warning
Am 08.12.20 um 10:43 schrieb Christian König:
> Am 08.12.20 um 09:18 schrieb Martin Peres:
>> On 04/12/2020 18:51, Arnd Bergmann wrote:
>>> From: Arnd Bergmann <arnd@...db.de>
>>>
>>> ttm_pool_type_count() is not used when debugfs is disabled:
>>>
>>> drivers/gpu/drm/ttm/ttm_pool.c:243:21: error: unused function
>>> 'ttm_pool_type_count' [-Werror,-Wunused-function]
>>> static unsigned int ttm_pool_type_count(struct ttm_pool_type *pt)
>>>
>>> Move the definition into the #ifdef block.
>>>
>>> Fixes: d099fc8f540a ("drm/ttm: new TT backend allocation pool v3")
>>> Signed-off-by: Arnd Bergmann <arnd@...db.de>
>>
>> Thanks Arnd! The patch looks good to me:
>>
>> Reviewed-by: Martin Peres <martin.peres@...uf.org>
>
> Reviewed-by: Christian König <christian.koenig@....com>
I've just pushed that to drm-misc-next-fixes.
Christian.
>
>>
>>> ---
>>> drivers/gpu/drm/ttm/ttm_pool.c | 29 ++++++++++++++---------------
>>> 1 file changed, 14 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c
>>> b/drivers/gpu/drm/ttm/ttm_pool.c
>>> index 5455b2044759..7b2f60616750 100644
>>> --- a/drivers/gpu/drm/ttm/ttm_pool.c
>>> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
>>> @@ -239,21 +239,6 @@ static struct page *ttm_pool_type_take(struct
>>> ttm_pool_type *pt)
>>> return p;
>>> }
>>> -/* Count the number of pages available in a pool_type */
>>> -static unsigned int ttm_pool_type_count(struct ttm_pool_type *pt)
>>> -{
>>> - unsigned int count = 0;
>>> - struct page *p;
>>> -
>>> - spin_lock(&pt->lock);
>>> - /* Only used for debugfs, the overhead doesn't matter */
>>> - list_for_each_entry(p, &pt->pages, lru)
>>> - ++count;
>>> - spin_unlock(&pt->lock);
>>> -
>>> - return count;
>>> -}
>>> -
>>> /* Initialize and add a pool type to the global shrinker list */
>>> static void ttm_pool_type_init(struct ttm_pool_type *pt, struct
>>> ttm_pool *pool,
>>> enum ttm_caching caching, unsigned int order)
>>> @@ -543,6 +528,20 @@ void ttm_pool_fini(struct ttm_pool *pool)
>>> EXPORT_SYMBOL(ttm_pool_fini);
>>> #ifdef CONFIG_DEBUG_FS
>>> +/* Count the number of pages available in a pool_type */
>>> +static unsigned int ttm_pool_type_count(struct ttm_pool_type *pt)
>>> +{
>>> + unsigned int count = 0;
>>> + struct page *p;
>>> +
>>> + spin_lock(&pt->lock);
>>> + /* Only used for debugfs, the overhead doesn't matter */
>>> + list_for_each_entry(p, &pt->pages, lru)
>>> + ++count;
>>> + spin_unlock(&pt->lock);
>>> +
>>> + return count;
>>> +}
>>> /* Dump information about the different pool types */
>>> static void ttm_pool_debugfs_orders(struct ttm_pool_type *pt,
>>>
>
Powered by blists - more mailing lists