From b73d5dc72272c0012999f939476b703d269d21b6 Mon Sep 17 00:00:00 2001 From: Nicholas Mc Guire Date: Thu, 24 Jan 2019 02:48:16 +0100 Subject: livepatch: samples: non static warnings fix Sparse reported warnings about non-static symbols. For the variables a simple static attribute is fine - for the functions referenced by livepatch via klp_func the symbol-names must be unmodified in the symbol table and the patchable code has to be emitted. The resolution is to attach __used attribute to the shared statically declared functions. Link: https://lore.kernel.org/lkml/1544965657-26804-1-git-send-email-hofrat@osadl.org/ Suggested-by: Joe Lawrence Signed-off-by: Nicholas Mc Guire Acked-by: Miroslav Benes Signed-off-by: Jiri Kosina --- samples/livepatch/livepatch-shadow-fix2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'samples/livepatch/livepatch-shadow-fix2.c') diff --git a/samples/livepatch/livepatch-shadow-fix2.c b/samples/livepatch/livepatch-shadow-fix2.c index b34c7bf83356..b6dac2b9f97f 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; -- cgit