From: "Christian König" <christian.koenig@amd.com> To: Martin Peres <martin.peres@mupuf.org>, Arnd Bergmann <arnd@kernel.org>, Huang Rui <ray.huang@amd.com>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Dave Airlie <airlied@redhat.com>, Madhav Chauhan <madhav.chauhan@amd.com> Cc: Arnd Bergmann <arnd@arndb.de>, Alex Deucher <alexander.deucher@amd.com>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/ttm: fix unused function warning Date: Tue, 8 Dec 2020 10:43:35 +0100 [thread overview] Message-ID: <1589a0e4-a337-a24a-720f-09587939e94a@amd.com> (raw) In-Reply-To: <3a55c203-57dd-79f3-99ec-6bdeafaba157@mupuf.org> Am 08.12.20 um 09:18 schrieb Martin Peres: > On 04/12/2020 18:51, Arnd Bergmann wrote: >> From: Arnd Bergmann <arnd@arndb.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@arndb.de> > > Thanks Arnd! The patch looks good to me: > > Reviewed-by: Martin Peres <martin.peres@mupuf.org> Reviewed-by: Christian König <christian.koenig@amd.com> > >> --- >> 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, >>
WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <christian.koenig@amd.com> To: Martin Peres <martin.peres@mupuf.org>, Arnd Bergmann <arnd@kernel.org>, Huang Rui <ray.huang@amd.com>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Dave Airlie <airlied@redhat.com>, Madhav Chauhan <madhav.chauhan@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com>, dri-devel@lists.freedesktop.org, Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/ttm: fix unused function warning Date: Tue, 8 Dec 2020 10:43:35 +0100 [thread overview] Message-ID: <1589a0e4-a337-a24a-720f-09587939e94a@amd.com> (raw) In-Reply-To: <3a55c203-57dd-79f3-99ec-6bdeafaba157@mupuf.org> Am 08.12.20 um 09:18 schrieb Martin Peres: > On 04/12/2020 18:51, Arnd Bergmann wrote: >> From: Arnd Bergmann <arnd@arndb.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@arndb.de> > > Thanks Arnd! The patch looks good to me: > > Reviewed-by: Martin Peres <martin.peres@mupuf.org> Reviewed-by: Christian König <christian.koenig@amd.com> > >> --- >> 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, >> _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-12-08 9:44 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-04 16:51 [PATCH] drm/ttm: fix unused function warning Arnd Bergmann 2020-12-04 16:51 ` Arnd Bergmann 2020-12-08 8:18 ` Martin Peres 2020-12-08 8:18 ` Martin Peres 2020-12-08 9:43 ` Christian König [this message] 2020-12-08 9:43 ` Christian König 2020-12-16 15:40 ` Christian König 2020-12-16 15:40 ` Christian König
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=1589a0e4-a337-a24a-720f-09587939e94a@amd.com \ --to=christian.koenig@amd.com \ --cc=airlied@linux.ie \ --cc=airlied@redhat.com \ --cc=alexander.deucher@amd.com \ --cc=arnd@arndb.de \ --cc=arnd@kernel.org \ --cc=daniel@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=linux-kernel@vger.kernel.org \ --cc=madhav.chauhan@amd.com \ --cc=martin.peres@mupuf.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: linkBe 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.