Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dma-buf/sw-sync: Remove unused debug code

sync_file_debug_add() and sync_file_debug_remove() have been unused
since 2016's
commit d4cab38e153d ("staging/android: prepare sync_file for de-staging")

Remove them.

Since sync_file_debug_add was the only thing to add to
sync_file_list_head, the code that dumps it in part of
sync_info_debugfs_show can be removed, and the declaration of
the list and it's associated lock can be removed.
(The 'fences:\n...' marker in that debugfs file is left in
so as not to change the output)

That leaves the sync_print_sync_file() helper unused, and
is thus removed.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20250505233838.105668-1-linux@treblig.org

authored by

Dr. David Alan Gilbert and committed by
Christian König
b3f737ae 78184f6e

-51
-49
drivers/dma-buf/sync_debug.c
··· 12 12 13 13 static LIST_HEAD(sync_timeline_list_head); 14 14 static DEFINE_SPINLOCK(sync_timeline_list_lock); 15 - static LIST_HEAD(sync_file_list_head); 16 - static DEFINE_SPINLOCK(sync_file_list_lock); 17 15 18 16 void sync_timeline_debug_add(struct sync_timeline *obj) 19 17 { ··· 29 31 spin_lock_irqsave(&sync_timeline_list_lock, flags); 30 32 list_del(&obj->sync_timeline_list); 31 33 spin_unlock_irqrestore(&sync_timeline_list_lock, flags); 32 - } 33 - 34 - void sync_file_debug_add(struct sync_file *sync_file) 35 - { 36 - unsigned long flags; 37 - 38 - spin_lock_irqsave(&sync_file_list_lock, flags); 39 - list_add_tail(&sync_file->sync_file_list, &sync_file_list_head); 40 - spin_unlock_irqrestore(&sync_file_list_lock, flags); 41 - } 42 - 43 - void sync_file_debug_remove(struct sync_file *sync_file) 44 - { 45 - unsigned long flags; 46 - 47 - spin_lock_irqsave(&sync_file_list_lock, flags); 48 - list_del(&sync_file->sync_file_list); 49 - spin_unlock_irqrestore(&sync_file_list_lock, flags); 50 34 } 51 35 52 36 static const char *sync_status_str(int status) ··· 81 101 spin_unlock(&obj->lock); 82 102 } 83 103 84 - static void sync_print_sync_file(struct seq_file *s, 85 - struct sync_file *sync_file) 86 - { 87 - char buf[128]; 88 - int i; 89 - 90 - seq_printf(s, "[%p] %s: %s\n", sync_file, 91 - sync_file_get_name(sync_file, buf, sizeof(buf)), 92 - sync_status_str(dma_fence_get_status(sync_file->fence))); 93 - 94 - if (dma_fence_is_array(sync_file->fence)) { 95 - struct dma_fence_array *array = to_dma_fence_array(sync_file->fence); 96 - 97 - for (i = 0; i < array->num_fences; ++i) 98 - sync_print_fence(s, array->fences[i], true); 99 - } else { 100 - sync_print_fence(s, sync_file->fence, true); 101 - } 102 - } 103 - 104 104 static int sync_info_debugfs_show(struct seq_file *s, void *unused) 105 105 { 106 106 struct list_head *pos; ··· 100 140 101 141 seq_puts(s, "fences:\n--------------\n"); 102 142 103 - spin_lock_irq(&sync_file_list_lock); 104 - list_for_each(pos, &sync_file_list_head) { 105 - struct sync_file *sync_file = 106 - container_of(pos, struct sync_file, sync_file_list); 107 - 108 - sync_print_sync_file(s, sync_file); 109 - seq_putc(s, '\n'); 110 - } 111 - spin_unlock_irq(&sync_file_list_lock); 112 143 return 0; 113 144 } 114 145
-2
drivers/dma-buf/sync_debug.h
··· 68 68 69 69 void sync_timeline_debug_add(struct sync_timeline *obj); 70 70 void sync_timeline_debug_remove(struct sync_timeline *obj); 71 - void sync_file_debug_add(struct sync_file *fence); 72 - void sync_file_debug_remove(struct sync_file *fence); 73 71 74 72 #endif /* _LINUX_SYNC_H */