OSDN Git Service

1f4d2fd394eb211365ca68ea9fcfa1d310602f41
[immortalwrt/immortalwrt.git] / target / linux / generic / hack-5.15 / 904-debloat_dma_buf.patch
1 From e3692cb2fcd5ba1244512a0f43b8118f65f1c375 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Sat, 8 Jul 2017 08:20:43 +0200
4 Subject: debloat: dmabuf
5
6 Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 ---
8  drivers/base/Kconfig      |  2 +-
9  drivers/dma-buf/Makefile  | 10 +++++++---
10  drivers/dma-buf/dma-buf.c |  4 +++-
11  kernel/sched/core.c       |  1 +
12  4 files changed, 12 insertions(+), 5 deletions(-)
13
14 --- a/drivers/base/Kconfig
15 +++ b/drivers/base/Kconfig
16 @@ -187,7 +187,7 @@ config SOC_BUS
17  source "drivers/base/regmap/Kconfig"
18  
19  config DMA_SHARED_BUFFER
20 -       bool
21 +       tristate
22         default n
23         select IRQ_WORK
24         help
25 --- a/drivers/dma-buf/heaps/Makefile
26 +++ b/drivers/dma-buf/heaps/Makefile
27 @@ -1,3 +1,3 @@
28  # SPDX-License-Identifier: GPL-2.0
29 -obj-$(CONFIG_DMABUF_HEAPS_SYSTEM)      += system_heap.o
30 -obj-$(CONFIG_DMABUF_HEAPS_CMA)         += cma_heap.o
31 +dma-buf-objs-$(CONFIG_DMABUF_HEAPS_SYSTEM)     += system_heap.o
32 +dma-buf-objs-$(CONFIG_DMABUF_HEAPS_CMA)                += cma_heap.o
33 --- a/drivers/dma-buf/Makefile
34 +++ b/drivers/dma-buf/Makefile
35 @@ -1,16 +1,20 @@
36  # SPDX-License-Identifier: GPL-2.0-only
37 -obj-y := dma-buf.o dma-fence.o dma-fence-array.o dma-fence-chain.o \
38 +obj-$(CONFIG_DMA_SHARED_BUFFER) := dma-shared-buffer.o
39 +
40 +dma-buf-objs-y := dma-buf.o dma-fence.o dma-fence-array.o dma-fence-chain.o \
41          dma-resv.o seqno-fence.o
42 -obj-$(CONFIG_DMABUF_HEAPS)     += dma-heap.o
43 -obj-$(CONFIG_DMABUF_HEAPS)     += heaps/
44 -obj-$(CONFIG_SYNC_FILE)                += sync_file.o
45 -obj-$(CONFIG_SW_SYNC)          += sw_sync.o sync_debug.o
46 -obj-$(CONFIG_UDMABUF)          += udmabuf.o
47 -obj-$(CONFIG_DMABUF_SYSFS_STATS) += dma-buf-sysfs-stats.o
48 +dma-buf-objs-$(CONFIG_DMABUF_HEAPS)    += dma-heap.o
49 +obj-$(CONFIG_DMABUF_HEAPS)             += heaps/
50 +dma-buf-objs-$(CONFIG_SYNC_FILE)       += sync_file.o
51 +dma-buf-objs-$(CONFIG_SW_SYNC)         += sw_sync.o sync_debug.o
52 +dma-buf-objs-$(CONFIG_UDMABUF)         += udmabuf.o
53 +dma-buf-objs-$(CONFIG_DMABUF_SYSFS_STATS) += udmabuf.o
54  
55  dmabuf_selftests-y := \
56         selftest.o \
57         st-dma-fence.o \
58         st-dma-fence-chain.o
59  
60 -obj-$(CONFIG_DMABUF_SELFTESTS) += dmabuf_selftests.o
61 +dma-buf-objs-$(CONFIG_DMABUF_SELFTESTS)        += dmabuf_selftests.o
62 +
63 +dma-shared-buffer-objs :=  $(dma-buf-objs-y)
64 --- a/drivers/dma-buf/dma-buf.c
65 +++ b/drivers/dma-buf/dma-buf.c
66 @@ -1506,4 +1506,5 @@ static void __exit dma_buf_deinit(void)
67         kern_unmount(dma_buf_mnt);
68         dma_buf_uninit_sysfs_statistics();
69  }
70 -__exitcall(dma_buf_deinit);
71 +module_exit(dma_buf_deinit);
72 +MODULE_LICENSE("GPL");
73 --- a/kernel/sched/core.c
74 +++ b/kernel/sched/core.c
75 @@ -4175,6 +4175,7 @@ int wake_up_state(struct task_struct *p,
76  {
77         return try_to_wake_up(p, state, 0);
78  }
79 +EXPORT_SYMBOL_GPL(wake_up_state);
80  
81  /*
82   * Perform scheduler related setup for a newly forked process p.
83 --- a/fs/d_path.c
84 +++ b/fs/d_path.c
85 @@ -316,6 +316,7 @@ char *dynamic_dname(struct dentry *dentr
86         buffer += buflen - sz;
87         return memcpy(buffer, temp, sz);
88  }
89 +EXPORT_SYMBOL_GPL(dynamic_dname);
90  
91  char *simple_dname(struct dentry *dentry, char *buffer, int buflen)
92  {