Skip to content

Commit b3f737a

Browse files
Dr. David Alan GilbertChristianKoenigAMD
authored andcommitted
dma-buf/sw-sync: Remove unused debug code
sync_file_debug_add() and sync_file_debug_remove() have been unused since 2016's commit d4cab38 ("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
1 parent 78184f6 commit b3f737a

2 files changed

Lines changed: 0 additions & 51 deletions

File tree

drivers/dma-buf/sync_debug.c

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ static struct dentry *dbgfs;
1212

1313
static LIST_HEAD(sync_timeline_list_head);
1414
static DEFINE_SPINLOCK(sync_timeline_list_lock);
15-
static LIST_HEAD(sync_file_list_head);
16-
static DEFINE_SPINLOCK(sync_file_list_lock);
1715

1816
void sync_timeline_debug_add(struct sync_timeline *obj)
1917
{
@@ -33,24 +31,6 @@ void sync_timeline_debug_remove(struct sync_timeline *obj)
3331
spin_unlock_irqrestore(&sync_timeline_list_lock, flags);
3432
}
3533

36-
void sync_file_debug_add(struct sync_file *sync_file)
37-
{
38-
unsigned long flags;
39-
40-
spin_lock_irqsave(&sync_file_list_lock, flags);
41-
list_add_tail(&sync_file->sync_file_list, &sync_file_list_head);
42-
spin_unlock_irqrestore(&sync_file_list_lock, flags);
43-
}
44-
45-
void sync_file_debug_remove(struct sync_file *sync_file)
46-
{
47-
unsigned long flags;
48-
49-
spin_lock_irqsave(&sync_file_list_lock, flags);
50-
list_del(&sync_file->sync_file_list);
51-
spin_unlock_irqrestore(&sync_file_list_lock, flags);
52-
}
53-
5434
static const char *sync_status_str(int status)
5535
{
5636
if (status < 0)
@@ -101,26 +81,6 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
10181
spin_unlock(&obj->lock);
10282
}
10383

104-
static void sync_print_sync_file(struct seq_file *s,
105-
struct sync_file *sync_file)
106-
{
107-
char buf[128];
108-
int i;
109-
110-
seq_printf(s, "[%p] %s: %s\n", sync_file,
111-
sync_file_get_name(sync_file, buf, sizeof(buf)),
112-
sync_status_str(dma_fence_get_status(sync_file->fence)));
113-
114-
if (dma_fence_is_array(sync_file->fence)) {
115-
struct dma_fence_array *array = to_dma_fence_array(sync_file->fence);
116-
117-
for (i = 0; i < array->num_fences; ++i)
118-
sync_print_fence(s, array->fences[i], true);
119-
} else {
120-
sync_print_fence(s, sync_file->fence, true);
121-
}
122-
}
123-
12484
static int sync_info_debugfs_show(struct seq_file *s, void *unused)
12585
{
12686
struct list_head *pos;
@@ -140,15 +100,6 @@ static int sync_info_debugfs_show(struct seq_file *s, void *unused)
140100

141101
seq_puts(s, "fences:\n--------------\n");
142102

143-
spin_lock_irq(&sync_file_list_lock);
144-
list_for_each(pos, &sync_file_list_head) {
145-
struct sync_file *sync_file =
146-
container_of(pos, struct sync_file, sync_file_list);
147-
148-
sync_print_sync_file(s, sync_file);
149-
seq_putc(s, '\n');
150-
}
151-
spin_unlock_irq(&sync_file_list_lock);
152103
return 0;
153104
}
154105

drivers/dma-buf/sync_debug.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,5 @@ extern const struct file_operations sw_sync_debugfs_fops;
6868

6969
void sync_timeline_debug_add(struct sync_timeline *obj);
7070
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);
7371

7472
#endif /* _LINUX_SYNC_H */

0 commit comments

Comments
 (0)