diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2019-03-05 09:55:59 -0500 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2019-03-05 09:55:59 -0500 |
| commit | 67bae14adc8cdb650b042319136b74cffbad23c8 (patch) | |
| tree | 550db9602f14f9aeeb6ab2f842c7e4491bf1c3cb /samples | |
| parent | bae054372aba0100e7b320f768c4875b5f0c23b3 (diff) | |
| parent | b73d5dc72272c0012999f939476b703d269d21b6 (diff) | |
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')
| -rw-r--r-- | samples/livepatch/livepatch-shadow-fix1.c | 4 | ||||
| -rw-r--r-- | samples/livepatch/livepatch-shadow-fix2.c | 4 | ||||
| -rw-r--r-- | samples/livepatch/livepatch-shadow-mod.c | 11 |
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) | |||
| 71 | return 0; | 71 | return 0; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | struct dummy *livepatch_fix1_dummy_alloc(void) | 74 | static struct dummy *livepatch_fix1_dummy_alloc(void) |
| 75 | { | 75 | { |
| 76 | struct dummy *d; | 76 | struct dummy *d; |
| 77 | void *leak; | 77 | void *leak; |
| @@ -113,7 +113,7 @@ static void livepatch_fix1_dummy_leak_dtor(void *obj, void *shadow_data) | |||
| 113 | __func__, d, *shadow_leak); | 113 | __func__, d, *shadow_leak); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | void livepatch_fix1_dummy_free(struct dummy *d) | 116 | static void livepatch_fix1_dummy_free(struct dummy *d) |
| 117 | { | 117 | { |
| 118 | void **shadow_leak; | 118 | void **shadow_leak; |
| 119 | 119 | ||
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 { | |||
| 50 | unsigned long jiffies_expire; | 50 | unsigned long jiffies_expire; |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | bool livepatch_fix2_dummy_check(struct dummy *d, unsigned long jiffies) | 53 | static bool livepatch_fix2_dummy_check(struct dummy *d, unsigned long jiffies) |
| 54 | { | 54 | { |
| 55 | int *shadow_count; | 55 | int *shadow_count; |
| 56 | 56 | ||
| @@ -78,7 +78,7 @@ static void livepatch_fix2_dummy_leak_dtor(void *obj, void *shadow_data) | |||
| 78 | __func__, d, *shadow_leak); | 78 | __func__, d, *shadow_leak); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void livepatch_fix2_dummy_free(struct dummy *d) | 81 | static void livepatch_fix2_dummy_free(struct dummy *d) |
| 82 | { | 82 | { |
| 83 | void **shadow_leak; | 83 | void **shadow_leak; |
| 84 | int *shadow_count; | 84 | 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"); | |||
| 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 | */ |
| 99 | LIST_HEAD(dummy_list); | 99 | static LIST_HEAD(dummy_list); |
| 100 | DEFINE_MUTEX(dummy_list_mutex); | 100 | static DEFINE_MUTEX(dummy_list_mutex); |
| 101 | 101 | ||
| 102 | struct dummy { | 102 | struct 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 | ||
| 107 | noinline struct dummy *dummy_alloc(void) | 107 | static __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 | ||
| 132 | noinline void dummy_free(struct dummy *d) | 132 | static __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 | ||
| 140 | noinline bool dummy_check(struct dummy *d, unsigned long jiffies) | 140 | static __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 | } |
