mirror of https://github.com/dynup/kpatch
kmod/core: checkpatch style fixes
This commit is contained in:
parent
a12715c2e2
commit
96d3d241f5
|
@ -132,6 +132,7 @@ static atomic_t kpatch_state;
|
||||||
static inline void kpatch_state_idle(void)
|
static inline void kpatch_state_idle(void)
|
||||||
{
|
{
|
||||||
int state = atomic_read(&kpatch_state);
|
int state = atomic_read(&kpatch_state);
|
||||||
|
|
||||||
WARN_ON(state != KPATCH_STATE_SUCCESS && state != KPATCH_STATE_FAILURE);
|
WARN_ON(state != KPATCH_STATE_SUCCESS && state != KPATCH_STATE_FAILURE);
|
||||||
atomic_set(&kpatch_state, KPATCH_STATE_IDLE);
|
atomic_set(&kpatch_state, KPATCH_STATE_IDLE);
|
||||||
}
|
}
|
||||||
|
@ -146,6 +147,7 @@ static inline void kpatch_state_updating(void)
|
||||||
static inline int kpatch_state_finish(int state)
|
static inline int kpatch_state_finish(int state)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
WARN_ON(state != KPATCH_STATE_SUCCESS && state != KPATCH_STATE_FAILURE);
|
WARN_ON(state != KPATCH_STATE_SUCCESS && state != KPATCH_STATE_FAILURE);
|
||||||
result = atomic_cmpxchg(&kpatch_state, KPATCH_STATE_UPDATING, state);
|
result = atomic_cmpxchg(&kpatch_state, KPATCH_STATE_UPDATING, state);
|
||||||
return result == KPATCH_STATE_UPDATING ? state : result;
|
return result == KPATCH_STATE_UPDATING ? state : result;
|
||||||
|
@ -231,9 +233,9 @@ static void kpatch_backtrace_address_verify(void *data, unsigned long address,
|
||||||
hash_for_each_rcu(kpatch_func_hash, i, func, node) {
|
hash_for_each_rcu(kpatch_func_hash, i, func, node) {
|
||||||
if (func->op == KPATCH_OP_UNPATCH && !func->force) {
|
if (func->op == KPATCH_OP_UNPATCH && !func->force) {
|
||||||
args->ret = kpatch_compare_addresses(address,
|
args->ret = kpatch_compare_addresses(address,
|
||||||
func->new_addr,
|
func->new_addr,
|
||||||
func->new_size,
|
func->new_size,
|
||||||
func->name);
|
func->name);
|
||||||
if (args->ret)
|
if (args->ret)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -588,29 +590,29 @@ static int kpatch_write_relocations(struct kpatch_module *kpmod,
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (dynrela->type) {
|
switch (dynrela->type) {
|
||||||
case R_X86_64_NONE:
|
case R_X86_64_NONE:
|
||||||
continue;
|
continue;
|
||||||
case R_X86_64_PC32:
|
case R_X86_64_PC32:
|
||||||
loc = dynrela->dest;
|
loc = dynrela->dest;
|
||||||
val = (u32)(dynrela->src + dynrela->addend -
|
val = (u32)(dynrela->src + dynrela->addend -
|
||||||
dynrela->dest);
|
dynrela->dest);
|
||||||
size = 4;
|
size = 4;
|
||||||
break;
|
break;
|
||||||
case R_X86_64_32S:
|
case R_X86_64_32S:
|
||||||
loc = dynrela->dest;
|
loc = dynrela->dest;
|
||||||
val = (s32)dynrela->src + dynrela->addend;
|
val = (s32)dynrela->src + dynrela->addend;
|
||||||
size = 4;
|
size = 4;
|
||||||
break;
|
break;
|
||||||
case R_X86_64_64:
|
case R_X86_64_64:
|
||||||
loc = dynrela->dest;
|
loc = dynrela->dest;
|
||||||
val = dynrela->src;
|
val = dynrela->src;
|
||||||
size = 8;
|
size = 8;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pr_err("unsupported rela type %ld for source %s (0x%lx <- 0x%lx)\n",
|
pr_err("unsupported rela type %ld for source %s (0x%lx <- 0x%lx)\n",
|
||||||
dynrela->type, dynrela->name,
|
dynrela->type, dynrela->name, dynrela->dest,
|
||||||
dynrela->dest, dynrela->src);
|
dynrela->src);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loc >= core && loc < core + core_ro_size)
|
if (loc >= core && loc < core + core_ro_size)
|
||||||
|
|
Loading…
Reference in New Issue