Skip to contentSkip to conversation

drm/ttm: make ttm_swap_ops static

PATCH In review Min-Hua Chen 2 participants 2 messages Sep 7, 2024

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

PATCH 1/1 drm/ttm: make ttm_swap_ops static

make ttm_swap_ops static to fix the following sparse warning:

drivers/gpu/drm/ttm/ttm_bo.c:1142:31: sparse: warning: symbol 'ttm_swap_ops' was not declared. Should it be static?

Fixes 10efe34dae79 ("drm/ttm: Use the LRU walker helper for swapping")
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -1
index 320592435252..1aab30767e41 100644
@@ -1139,7 +1139,7 @@ ttm_bo_swapout_cb(struct ttm_lru_walk *walk, struct ttm_buffer_object *bo)
 	return ret;
 }
 
-const struct ttm_lru_walk_ops ttm_swap_ops = {
+static const struct ttm_lru_walk_ops ttm_swap_ops = {
 	.process_bo = ttm_bo_swapout_cb,
 };
 
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Min-Hua Chen

make ttm_swap_ops static to fix the following sparse warning:

drivers/gpu/drm/ttm/ttm_bo.c:1142:31: sparse: warning: symbol 'ttm_swap_ops' was not declared. Should it be static?

This looks correct. I'd drop the 'Should it be static?' from commit messge though. Assume a maintainer of TTM can drop at megre time.

With that:

Quoted 22 lines
Fixes 10efe34dae79 ("drm/ttm: Use the LRU walker helper for swapping")
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -1
index 320592435252..1aab30767e41 100644
@@ -1139,7 +1139,7 @@ ttm_bo_swapout_cb(struct ttm_lru_walk *walk, struct ttm_buffer_object *bo)
 	return ret;
 }
 
-const struct ttm_lru_walk_ops ttm_swap_ops = {
+static const struct ttm_lru_walk_ops ttm_swap_ops = {
 	.process_bo = ttm_bo_swapout_cb,
 };
 
Signature · 1 line
2.43.0