cgroups: use empty {} to initialize struct

parent 4bc51378
...@@ -2657,7 +2657,7 @@ __cgfsng_ops static int cgfsng_set(struct cgroup_ops *ops, ...@@ -2657,7 +2657,7 @@ __cgfsng_ops static int cgfsng_set(struct cgroup_ops *ops,
*p = '\0'; *p = '\0';
if (pure_unified_layout(ops) && strcmp(controller, "devices") == 0) { if (pure_unified_layout(ops) && strcmp(controller, "devices") == 0) {
struct device_item device = {0}; struct device_item device = {};
ret = device_cgroup_rule_parse(&device, key, value); ret = device_cgroup_rule_parse(&device, key, value);
if (ret < 0) if (ret < 0)
...@@ -2764,7 +2764,7 @@ static int device_cgroup_rule_parse_devpath(struct device_item *device, ...@@ -2764,7 +2764,7 @@ static int device_cgroup_rule_parse_devpath(struct device_item *device,
static int convert_devpath(const char *invalue, char *dest) static int convert_devpath(const char *invalue, char *dest)
{ {
struct device_item device = {0}; struct device_item device = {};
int ret; int ret;
ret = device_cgroup_rule_parse_devpath(&device, invalue); ret = device_cgroup_rule_parse_devpath(&device, invalue);
...@@ -2884,7 +2884,7 @@ static int bpf_device_cgroup_prepare(struct cgroup_ops *ops, ...@@ -2884,7 +2884,7 @@ static int bpf_device_cgroup_prepare(struct cgroup_ops *ops,
const char *val) const char *val)
{ {
#ifdef HAVE_STRUCT_BPF_CGROUP_DEV_CTX #ifdef HAVE_STRUCT_BPF_CGROUP_DEV_CTX
struct device_item device_item = {0}; struct device_item device_item = {};
int ret; int ret;
if (strcmp("devices.allow", key) == 0 && *val == '/') if (strcmp("devices.allow", key) == 0 && *val == '/')
......
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