summaryrefslogtreecommitdiffstats
path: root/samples/livepatch/livepatch-shadow-mod.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/livepatch/livepatch-shadow-mod.c')
-rw-r--r--samples/livepatch/livepatch-shadow-mod.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/samples/livepatch/livepatch-shadow-mod.c b/samples/livepatch/livepatch-shadow-mod.c
index 4aa8a88d3cd6..4d79c6dc055b 100644
--- a/samples/livepatch/livepatch-shadow-mod.c
+++ b/samples/livepatch/livepatch-shadow-mod.c
@@ -96,15 +96,15 @@ MODULE_DESCRIPTION("Buggy module for shadow variable demo");
96 * Keep a list of all the dummies so we can clean up any residual ones 96 * Keep a list of all the dummies so we can clean up any residual ones
97 * on module exit 97 * on module exit
98 */ 98 */
99LIST_HEAD(dummy_list); 99static LIST_HEAD(dummy_list);
100DEFINE_MUTEX(dummy_list_mutex); 100static DEFINE_MUTEX(dummy_list_mutex);
101 101
102struct dummy { 102struct dummy {
103 struct list_head list; 103 struct list_head list;
104 unsigned long jiffies_expire; 104 unsigned long jiffies_expire;
105}; 105};
106 106
107noinline struct dummy *dummy_alloc(void) 107static __used noinline struct dummy *dummy_alloc(void)
108{ 108{
109 struct dummy *d; 109 struct dummy *d;
110 void *leak; 110 void *leak;
@@ -129,7 +129,7 @@ noinline struct dummy *dummy_alloc(void)
129 return d; 129 return d;
130} 130}
131 131
132noinline void dummy_free(struct dummy *d) 132static __used noinline void dummy_free(struct dummy *d)
133{ 133{
134 pr_info("%s: dummy @ %p, expired = %lx\n", 134 pr_info("%s: dummy @ %p, expired = %lx\n",
135 __func__, d, d->jiffies_expire); 135 __func__, d, d->jiffies_expire);
@@ -137,7 +137,8 @@ noinline void dummy_free(struct dummy *d)
137 kfree(d); 137 kfree(d);
138} 138}
139 139
140noinline bool dummy_check(struct dummy *d, unsigned long jiffies) 140static __used noinline bool dummy_check(struct dummy *d,
141 unsigned long jiffies)
141{ 142{
142 return time_after(jiffies, d->jiffies_expire); 143 return time_after(jiffies, d->jiffies_expire);
143} 144}