Skip to content

Commit

Permalink
[squash] livepatch: adjust annotated sample formatting
Browse files Browse the repository at this point in the history
Note: squash with ("livepatch: Add sample livepatch module")

Juggle a few lines here and there so that the annoted sample is closer
to its original cousin file.

[joe: code shuffle to better match original source file]

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
  • Loading branch information
joe-lawrence committed Mar 18, 2019
1 parent fc04952 commit ce49c70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions samples/livepatch/livepatch-annotated-sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/livepatch.h>
#include <linux/seq_file.h>

/*
* This (dumb) live patch overrides the function that prints the
Expand Down Expand Up @@ -59,6 +58,7 @@

extern char *saved_command_line;

#include <linux/seq_file.h>
static int livepatch_cmdline_proc_show(struct seq_file *m, void *v)
{
seq_printf(m, "%s livepatch=1\n", saved_command_line);
Expand All @@ -69,7 +69,7 @@ KLP_MODULE_RELOC(vmlinux) vmlinux_relocs[] = {
KLP_SYMPOS(saved_command_line, 0)
};

static struct klp_func vmlinux_funcs[] = {
static struct klp_func funcs[] = {
{
.old_name = "cmdline_proc_show",
.new_func = livepatch_cmdline_proc_show,
Expand All @@ -79,7 +79,7 @@ static struct klp_func vmlinux_funcs[] = {
static struct klp_object objs[] = {
{
/* name being NULL means vmlinux */
.funcs = vmlinux_funcs,
.funcs = funcs,
}, { }
};

Expand Down

0 comments on commit ce49c70

Please sign in to comment.