diff mbox series

dma-buf: Remove unused sync_dump()

Message ID 20190419181904.6199-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series dma-buf: Remove unused sync_dump() | expand

Commit Message

Chris Wilson April 19, 2019, 6:19 p.m. UTC
sync_dump() is an unused, unexported, function that adds 64k to the
kernel image and doesn't even provide locking around the global array it
uses.

add/remove: 0/2 grow/shrink: 0/0 up/down: 0/-65734 (-65734)
Function                                     old     new   delta
sync_dump                                    198       -    -198
sync_dump_buf                              65536       -  -65536

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
---
 drivers/dma-buf/sync_debug.c | 26 --------------------------
 drivers/dma-buf/sync_debug.h |  1 -
 2 files changed, 27 deletions(-)

Comments

Daniel Vetter April 23, 2019, 8:21 a.m. UTC | #1
On Fri, Apr 19, 2019 at 07:19:04PM +0100, Chris Wilson wrote:
> sync_dump() is an unused, unexported, function that adds 64k to the
> kernel image and doesn't even provide locking around the global array it
> uses.
> 
> add/remove: 0/2 grow/shrink: 0/0 up/down: 0/-65734 (-65734)
> Function                                     old     new   delta
> sync_dump                                    198       -    -198
> sync_dump_buf                              65536       -  -65536
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Sumit Semwal <sumit.semwal@linaro.org>
> Cc: Gustavo Padovan <gustavo@padovan.org>
> ---
>  drivers/dma-buf/sync_debug.c | 26 --------------------------
>  drivers/dma-buf/sync_debug.h |  1 -
>  2 files changed, 27 deletions(-)
> 
> diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c
> index c0abf37df88b..434a66518e0d 100644
> --- a/drivers/dma-buf/sync_debug.c
> +++ b/drivers/dma-buf/sync_debug.c
> @@ -197,29 +197,3 @@ static __init int sync_debugfs_init(void)
>  	return 0;
>  }
>  late_initcall(sync_debugfs_init);
> -
> -#define DUMP_CHUNK 256
> -static char sync_dump_buf[64 * 1024];
> -void sync_dump(void)
> -{
> -	struct seq_file s = {
> -		.buf = sync_dump_buf,
> -		.size = sizeof(sync_dump_buf) - 1,
> -	};
> -	int i;
> -
> -	sync_info_debugfs_show(&s, NULL);
> -
> -	for (i = 0; i < s.count; i += DUMP_CHUNK) {
> -		if ((s.count - i) > DUMP_CHUNK) {
> -			char c = s.buf[i + DUMP_CHUNK];
> -
> -			s.buf[i + DUMP_CHUNK] = 0;
> -			pr_cont("%s", s.buf + i);
> -			s.buf[i + DUMP_CHUNK] = c;
> -		} else {
> -			s.buf[s.count] = 0;
> -			pr_cont("%s", s.buf + i);
> -		}
> -	}
> -}

Oh dear, good riddance!

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> diff --git a/drivers/dma-buf/sync_debug.h b/drivers/dma-buf/sync_debug.h
> index 05e33f937ad0..6176e52ba2d7 100644
> --- a/drivers/dma-buf/sync_debug.h
> +++ b/drivers/dma-buf/sync_debug.h
> @@ -68,6 +68,5 @@ void sync_timeline_debug_add(struct sync_timeline *obj);
>  void sync_timeline_debug_remove(struct sync_timeline *obj);
>  void sync_file_debug_add(struct sync_file *fence);
>  void sync_file_debug_remove(struct sync_file *fence);
> -void sync_dump(void);
>  
>  #endif /* _LINUX_SYNC_H */
> -- 
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson April 23, 2019, 8:42 a.m. UTC | #2
Quoting Daniel Vetter (2019-04-23 09:21:16)
> On Fri, Apr 19, 2019 at 07:19:04PM +0100, Chris Wilson wrote:
> > sync_dump() is an unused, unexported, function that adds 64k to the
> > kernel image and doesn't even provide locking around the global array it
> > uses.
> > 
> > add/remove: 0/2 grow/shrink: 0/0 up/down: 0/-65734 (-65734)
> > Function                                     old     new   delta
> > sync_dump                                    198       -    -198
> > sync_dump_buf                              65536       -  -65536
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Sumit Semwal <sumit.semwal@linaro.org>
> > Cc: Gustavo Padovan <gustavo@padovan.org>
[snip]
> Oh dear, good riddance!
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Applied to drm-misc-next, hopefully that's the right spot!
-Chris
diff mbox series

Patch

diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c
index c0abf37df88b..434a66518e0d 100644
--- a/drivers/dma-buf/sync_debug.c
+++ b/drivers/dma-buf/sync_debug.c
@@ -197,29 +197,3 @@  static __init int sync_debugfs_init(void)
 	return 0;
 }
 late_initcall(sync_debugfs_init);
-
-#define DUMP_CHUNK 256
-static char sync_dump_buf[64 * 1024];
-void sync_dump(void)
-{
-	struct seq_file s = {
-		.buf = sync_dump_buf,
-		.size = sizeof(sync_dump_buf) - 1,
-	};
-	int i;
-
-	sync_info_debugfs_show(&s, NULL);
-
-	for (i = 0; i < s.count; i += DUMP_CHUNK) {
-		if ((s.count - i) > DUMP_CHUNK) {
-			char c = s.buf[i + DUMP_CHUNK];
-
-			s.buf[i + DUMP_CHUNK] = 0;
-			pr_cont("%s", s.buf + i);
-			s.buf[i + DUMP_CHUNK] = c;
-		} else {
-			s.buf[s.count] = 0;
-			pr_cont("%s", s.buf + i);
-		}
-	}
-}
diff --git a/drivers/dma-buf/sync_debug.h b/drivers/dma-buf/sync_debug.h
index 05e33f937ad0..6176e52ba2d7 100644
--- a/drivers/dma-buf/sync_debug.h
+++ b/drivers/dma-buf/sync_debug.h
@@ -68,6 +68,5 @@  void sync_timeline_debug_add(struct sync_timeline *obj);
 void sync_timeline_debug_remove(struct sync_timeline *obj);
 void sync_file_debug_add(struct sync_file *fence);
 void sync_file_debug_remove(struct sync_file *fence);
-void sync_dump(void);
 
 #endif /* _LINUX_SYNC_H */