Skip to contentSkip to conversation

drm/ttm: Fix unused variables with huge page support

PATCH In review Tom St Denis 2 participants 2 messages Oct 12, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: Fix unused variables with huge page support

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +8 -1
index b6f16e7ffff3..95022473704b 100644
@@ -723,7 +723,9 @@ static void ttm_put_pages(struct page **pages, unsigned npages, int flags,
 			  enum ttm_caching_state cstate)
 {
 	struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate);
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 	struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate);
+#endif
 	unsigned long irq_flags;
 	unsigned i;
 
@@ -825,7 +827,9 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags,
 			 enum ttm_caching_state cstate)
 {
 	struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate);
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 	struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate);
+#endif
 	struct list_head plist;
 	struct page *p = NULL;
 	unsigned count;
@@ -834,7 +838,10 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags,
 	/* No pool for cached pages */
 	if (pool == NULL) {
 		gfp_t gfp_flags = GFP_USER;
-		unsigned i, j;
+		unsigned i;
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+		unsigned j;
+#endif
 
 		/* set zero flag for page allocation if required */
 		if (flags & TTM_PAGE_FLAG_ZERO_ALLOC)
Signature · 6 lines
2.12.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

Am 12.10.2017 um 13:26 schrieb Tom St Denis:

Quoted 1 line
Quoted 30 lines
---
  drivers/gpu/drm/ttm/ttm_page_alloc.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +4 -0
index b6f16e7ffff3..95022473704b 100644
@@ -723,7 +723,9 @@ static void ttm_put_pages(struct page **pages, unsigned npages, int flags,
  			  enum ttm_caching_state cstate)
  {
  	struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate);
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
  	struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate);
+#endif
  	unsigned long irq_flags;
  	unsigned i;
 
@@ -825,7 +827,9 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags,
  			 enum ttm_caching_state cstate)
  {
  	struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate);
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
  	struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate);
+#endif
  	struct list_head plist;
  	struct page *p = NULL;
  	unsigned count;
@@ -834,7 +838,10 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags,
  	/* No pool for cached pages */

drivers/gpu/drm/ttm/ttm_page_alloc.c static int ttm_get_pages(struct page **pages, unsigned npages, int flags, · line 847

Quoted 10 lines
drivers/gpu/drm/ttm/ttm_page_alloc.c +4 -1
  	if (pool == NULL) {
  		gfp_t gfp_flags = GFP_USER;
-		unsigned i, j;
+		unsigned i;
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+		unsigned j;
+#endif
 
  		/* set zero flag for page allocation if required */
  		if (flags & TTM_PAGE_FLAG_ZERO_ALLOC)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel