summaryrefslogtreecommitdiffstats
path: root/samples/livepatch
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2019-03-05 15:55:59 +0100
committerJiri Kosina <jkosina@suse.cz>2019-03-05 15:55:59 +0100
commit67bae14adc8cdb650b042319136b74cffbad23c8 (patch)
tree550db9602f14f9aeeb6ab2f842c7e4491bf1c3cb /samples/livepatch
parentbae054372aba0100e7b320f768c4875b5f0c23b3 (diff)
parentb73d5dc72272c0012999f939476b703d269d21b6 (diff)
downloadlinux-stable-67bae14adc8cdb650b042319136b74cffbad23c8.tar.gz
linux-stable-67bae14adc8cdb650b042319136b74cffbad23c8.tar.bz2
linux-stable-67bae14adc8cdb650b042319136b74cffbad23c8.zip
Merge branch 'for-5.0/upstream-fixes' into for-linus
Document change towards group maintainership of livepatching code samples/ warning fix from Nicholas Mc Guire
Diffstat (limited to 'samples/livepatch')
-rw-r--r--samples/livepatch/livepatch-shadow-fix1.c4
-rw-r--r--samples/livepatch/livepatch-shadow-fix2.c4
-rw-r--r--samples/livepatch/livepatch-shadow-mod.c11
3 files changed, 10 insertions, 9 deletions
diff --git a/samples/livepatch/livepatch-shadow-fix1.c b/samples/livepatch/livepatch-shadow-fix1.c
index a5a5cac21d4d..67a73e5e986e 100644
--- a/samples/livepatch/livepatch-shadow-fix1.c
+++ b/samples/livepatch/livepatch-shadow-fix1.c
@@ -71,7 +71,7 @@ static int shadow_leak_ctor(void *obj, void *shadow_data, void *ctor_data)
return 0;
}
-struct dummy *livepatch_fix1_dummy_alloc(void)
+static struct dummy *livepatch_fix1_dummy_alloc(void)
{
struct dummy *d;
void *leak;
@@ -113,7 +113,7 @@ static void livepatch_fix1_dummy_leak_dtor(void *obj, void *shadow_data)
__func__, d, *shadow_leak);
}
-void livepatch_fix1_dummy_free(struct dummy *d)
+static void livepatch_fix1_dummy_free(struct dummy *d)
{
void **shadow_leak;
diff --git a/samples/livepatch/livepatch-shadow-fix2.c b/samples/livepatch/livepatch-shadow-fix2.c
index 52de947b5526..91c21d52cfea 100644
--- a/samples/livepatch/livepatch-shadow-fix2.c
+++ b/samples/livepatch/livepatch-shadow-fix2.c
@@ -50,7 +50,7 @@ struct dummy {
unsigned long jiffies_expire;
};
-bool livepatch_fix2_dummy_check(struct dummy *d, unsigned long jiffies)
+static bool livepatch_fix2_dummy_check(struct dummy *d, unsigned long jiffies)
{
int *shadow_count;
@@ -78,7 +78,7 @@ static void livepatch_fix2_dummy_leak_dtor(void *obj, void *shadow_data)
__func__, d, *shadow_leak);
}
-void livepatch_fix2_dummy_free(struct dummy *d)
+static void livepatch_fix2_dummy_free(struct dummy *d)
{
void **shadow_leak;
int *shadow_count;
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");
* Keep a list of all the dummies so we can clean up any residual ones
* on module exit
*/
-LIST_HEAD(dummy_list);
-DEFINE_MUTEX(dummy_list_mutex);
+static LIST_HEAD(dummy_list);
+static DEFINE_MUTEX(dummy_list_mutex);
struct dummy {
struct list_head list;
unsigned long jiffies_expire;
};
-noinline struct dummy *dummy_alloc(void)
+static __used noinline struct dummy *dummy_alloc(void)
{
struct dummy *d;
void *leak;
@@ -129,7 +129,7 @@ noinline struct dummy *dummy_alloc(void)
return d;
}
-noinline void dummy_free(struct dummy *d)
+static __used noinline void dummy_free(struct dummy *d)
{
pr_info("%s: dummy @ %p, expired = %lx\n",
__func__, d, d->jiffies_expire);
@@ -137,7 +137,8 @@ noinline void dummy_free(struct dummy *d)
kfree(d);
}
-noinline bool dummy_check(struct dummy *d, unsigned long jiffies)
+static __used noinline bool dummy_check(struct dummy *d,
+ unsigned long jiffies)
{
return time_after(jiffies, d->jiffies_expire);
}