Skip to content
Snippets Groups Projects
Commit f2466ef4 authored by Maciej Żenczykowski's avatar Maciej Żenczykowski
Browse files

type safety for bool optional


Test: TreeHugger
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Change-Id: I6f10395ca6f1c73f3513031f561fdf1b1dedf451
parent a262bd3d
No related branches found
No related tags found
No related merge requests found
......@@ -364,7 +364,7 @@ static long (*bpf_get_current_comm)(void* buf, uint32_t buf_size) = (void*) BPF_
.gid = (prog_gid), \
.min_kver = (min_kv), \
.max_kver = (max_kv), \
.optional = (opt), \
.optional = (opt).optional, \
.bpfloader_min_ver = (min_loader), \
.bpfloader_max_ver = (max_loader), \
.selinux_context = (selinux), \
......
......@@ -120,9 +120,10 @@ struct shared_bool { bool shared; };
#define PRIVATE ((struct shared_bool){ .shared = false })
#define SHARED ((struct shared_bool){ .shared = true })
// constants for passing in to 'bool optional' (for programs)
static const bool MANDATORY = false;
static const bool OPTIONAL = true;
// for programs:
struct optional_bool { bool optional; };
#define MANDATORY ((struct optional_bool){ .optional = false })
#define OPTIONAL ((struct optional_bool){ .optional = true })
// constants for passing in to ignore_on_eng / ignore_on_user / ignore_on_userdebug
static const bool LOAD_ON_ENG = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment