Skip to content

eBPF-based security platform

upatches/kernel-obs: follow the kernel coding style

Daniel Borkmann04797a47262b
diff --git a/upatches/kernel-obs/obs_common.h b/upatches/kernel-obs/obs_common.h
index 2e496d73..e4edc54d 100644
--- a/upatches/kernel-obs/obs_common.h
+++ b/upatches/kernel-obs/obs_common.h
@@ -319,9 +319,10 @@ static __always_inline bool obs_words_equal(const void __arena *a,
__u32 i;
#pragma clang loop unroll(full)
- for (i = 0; i < words; i++)
+ for (i = 0; i < words; i++) {
if (x[i] != y[i])
return false;
+ }
return true;
}
@@ -399,8 +400,8 @@ static __always_inline void obs_emit_bytes(struct shirudo_serial_chunk *chunk,
*(__u64 *)&chunk->data[off + i * 8] = s[i];
}
-static __always_inline bool obs_serial_ctx_valid(
- const struct shirudo_serialize_ctx *ctx)
+static __always_inline bool
+obs_serial_ctx_valid(const struct shirudo_serialize_ctx *ctx)
{
return ctx && ctx->magic == SHIRUDO_SERIAL_MAGIC &&
ctx->version == SHIRUDO_SERIAL_VERSION &&
diff --git a/upatches/kernel-obs/obs_priv.bpf.c b/upatches/kernel-obs/obs_priv.bpf.c
index b7bdf99e..b9d6163b 100644
--- a/upatches/kernel-obs/obs_priv.bpf.c
+++ b/upatches/kernel-obs/obs_priv.bpf.c
@@ -118,8 +118,8 @@ static __always_inline void priv_set_detail(struct priv_entry __arena *e,
obs_copy_in(e->val.detail, detail, OBS_PRIV_DETAIL_LEN / 8);
}
-static __always_inline void priv_set_mapping_name(
- struct priv_entry __arena *e, struct file *file)
+static __always_inline void priv_set_mapping_name(struct priv_entry __arena *e,
+ struct file *file)
{
char name[OBS_NAME_LEN] = {};
diff --git a/upatches/kernel-obs/obs_table.h b/upatches/kernel-obs/obs_table.h
index dd087faa..0d056776 100644
--- a/upatches/kernel-obs/obs_table.h
+++ b/upatches/kernel-obs/obs_table.h
@@ -229,9 +229,9 @@ static __always_inline int OBS_FN(chunk_meta)(__u32 key, __u32 flags,
return 0;
}
-static __always_inline int OBS_FN(emit_header)(
- const struct OBS_FN(state) __arena *state, __u32 hdr_flags,
- __u64 now)
+static __always_inline int
+OBS_FN(emit_header)(const struct OBS_FN(state) __arena *state, __u32 hdr_flags,
+ __u64 now)
{
struct shirudo_serial_chunk *chunk;
__u32 off, used;