cgroups: use PTR_TO_U64()

parent 640952e5
...@@ -343,10 +343,10 @@ static int bpf_program_load_kernel(struct bpf_program *prog) ...@@ -343,10 +343,10 @@ static int bpf_program_load_kernel(struct bpf_program *prog)
attr = &(union bpf_attr){ attr = &(union bpf_attr){
.prog_type = prog->prog_type, .prog_type = prog->prog_type,
.insns = PTR_TO_UINT64(prog->instructions), .insns = PTR_TO_U64(prog->instructions),
.insn_cnt = prog->n_instructions, .insn_cnt = prog->n_instructions,
.license = PTR_TO_UINT64("GPL"), .license = PTR_TO_U64("GPL"),
.log_buf = PTR_TO_UINT64(log_buf), .log_buf = PTR_TO_U64(log_buf),
.log_level = log_level, .log_level = log_level,
.log_size = log_size, .log_size = log_size,
}; };
......
...@@ -602,7 +602,8 @@ enum { ...@@ -602,7 +602,8 @@ enum {
#define PTR_TO_PID(p) ((pid_t)((intptr_t)(p))) #define PTR_TO_PID(p) ((pid_t)((intptr_t)(p)))
#define PID_TO_PTR(u) ((void *)((intptr_t)(u))) #define PID_TO_PTR(u) ((void *)((intptr_t)(u)))
#define PTR_TO_UINT64(p) ((uint64_t)((intptr_t)(p))) #define PTR_TO_UINT64(p) ((uint64_t)((uintptr_t)(p)))
#define PTR_TO_U64(p) ((__u64)((uintptr_t)(p)))
#define UINT_TO_PTR(u) ((void *) ((uintptr_t) (u))) #define UINT_TO_PTR(u) ((void *) ((uintptr_t) (u)))
#define PTR_TO_USHORT(p) ((unsigned short)((uintptr_t)(p))) #define PTR_TO_USHORT(p) ((unsigned short)((uintptr_t)(p)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment